:root {
  --bg: #fbfaf7;
  --ink: #171a17;
  --muted: #6d716c;
  --green: #304a35;
  --green2: #5f755d;
  --pale: #edf1e8;
  --line: #e5e2da;
  --surface: #f4f1eb;
  --white: #ffffff;
  --red: #a44b45;
  --redbg: #f6e9e6;
  --amber: #9a6b25;
  --amberbg: #f6efdf;
  --radius: 10px;
  --serif: "Editor's Note", "Editors Note", "Editorial New", 'Cormorant Garamond', Georgia, serif;
  --subhead: 'Montserrat', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --proposal-heading: 'DM Sans', Arial, sans-serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0.014em;
  line-height: 1.56;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.page-head h1,
.section-title,
.panel-head h2,
.modal-head h2,
.drawer-head h2,
.client-hero h1,
.goal-card h3,
.campaign-card h3,
.client-card h3,
.module-card h3,
.calendar-month h2,
.brand {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.008em;
  text-transform: capitalize;
}

/* Keep every interface title visually consistent and easy to scan. */
h1, h2, h3, h4, h5, h6,
.page-head h1, .section-title, .panel-head h2, .modal-head h2,
.drawer-head h2, .client-hero h1, .goal-card h3, .campaign-card h3,
.client-card h3, .module-card h3, .calendar-month h2 {
  text-transform: capitalize;
}

/* Subheadings, labels, eyebrows, meta information, badges */
.page-head p,
.client-hero p,
.module-card p,
.campaign-card p,
.eyebrow,
.detail-block label,
.field label,
.metric small,
.metric em,
.stat-card small,
.badge,
.calendar-weekday,
.filters .filter,
.nav-item,
.profile-copy small,
.meta-line,
.goal-meta,
.campaign-bottom,
.data-table th,
.hint,
.calendar-legend,
.drawer-head .eyebrow {
  font-family: var(--subhead);
  letter-spacing: 0.022em;
}

.metric strong,
.stat-card strong,
.goal-progress strong,
.data-table td,
.data-table strong {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.page-head p,
.client-hero p {
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.012em;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  font-weight: 700;
  color: var(--green2);
  margin-bottom: 7px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #f7f7f2;
  border-right: 1px solid var(--line);
  padding: 20px 16px 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  padding: 4px 0 16px 4px;
  margin-bottom: 6px;
  overflow: visible;
}
.brand-logo-img {
  width: 100%;
  max-width: 215px;
  height: auto;
  max-height: 88px;
  object-fit: contain;
  object-position: left center;
  display: block;
  transform: scale(1.38);
  transform-origin: left center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.04));
}
.brand-mark {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-family: var(--serif);
  font-size: 21px;
}
.muted { color: var(--muted); font-weight: 400; }

nav { display: flex; flex-direction: column; gap: 3px; overflow: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: #585d58;
  padding: 10px 12px;
  border-radius: 7px;
  text-align: left;
  width: 100%;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: #eeeee8; color: var(--ink); }
.nav-item.active { background: var(--pale); color: var(--green); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.sidebar-user-row { display: flex; align-items: center; gap: 4px; }
.sidebar-user-row .profile { flex: 1; min-width: 0; }
.sidebar-signout-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sidebar-signout-btn:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
  color: var(--red);
}
.profile {
  width: 100%;
  display: flex;
  gap: 9px;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 7px;
}
.profile:hover { background: #eeeee8; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--subhead);
  flex-shrink: 0;
}
.avatar-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.profile-copy { display: flex; flex-direction: column; flex: 1; font-size: 12px; }
.profile-copy small { color: var(--muted); margin-top: 2px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

main { grid-column: 2; min-width: 0; }
.topbar {
  height: 72px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 250, 247, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-trigger {
  width: 310px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 7px;
  color: #8b8e89;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
  font-size: 12px;
  font-family: var(--subhead);
  transition: border-color 0.15s ease;
}
.search-trigger:hover { border-color: #c5c2b9; }
.search-trigger span:nth-child(2) { flex: 1; }
.search-trigger kbd {
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--sans);
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-button:hover { background: var(--surface); color: var(--ink); border-color: #c5c2b9; }
.bell { position: relative; }
.bell i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #b8624f; right: 7px; top: 7px; }

.primary, .secondary, .text-button, .danger {
  border-radius: 7px;
  padding: 10px 15px;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--subhead);
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.primary { background: var(--green); color: #fff; }
.primary:hover { background: #1f3828; }
.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.secondary:hover { background: var(--surface); border-color: #c5c2b9; }
.text-button { background: transparent; color: var(--green); padding: 7px; font-family: var(--subhead); font-weight: 600; font-size: 12px; border: 0; }
.text-button:hover { text-decoration: underline; }
.danger { background: var(--redbg); color: var(--red); }
.compact { padding: 8px 12px; font-size: 11px; }

.content { padding: 38px; max-width: 1500px; margin: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 31px; }
.page-head h1 { font-size: 42px; line-height: 1.08; margin: 0; }
.page-head p { margin: 8px 0 0; }
.head-actions { display: flex; gap: 8px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 30px;
}
.metric { padding: 18px; border-right: 1px solid var(--line); }
.metric, .metric strong, .metric small { min-width: 0; overflow: hidden; word-break: break-word; }
.metric:last-child { border: 0; }
.metric small { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
  font-family: var(--subhead);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}
.metric em { font-style: normal; font-size: 10px; color: var(--green2); font-weight: 600; }

.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 25px; }
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(32, 43, 33, 0.03);
}
.panel-head {
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h2 { font-size: 22px; margin: 0; font-family: var(--serif); }
.panel-body { padding: 8px 20px; }

.attention-row, .task-row, .client-row, .approval-row, .meeting-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.attention-row:last-child, .task-row:last-child, .client-row:last-child, .approval-row:last-child, .meeting-row:last-child {
  border: 0;
}
.attention-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 600;
  flex: 0 0 auto;
}
.row-copy { flex: 1; min-width: 0; }
.row-copy strong { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--subhead); font-weight: 600; }
.row-copy small { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; font-family: var(--subhead); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface);
  color: #5e625e;
  font-family: var(--subhead);
  text-transform: capitalize;
}
.badge.green { background: var(--pale); color: var(--green); }
.badge.amber { background: var(--amberbg); color: var(--amber); }
.badge.red { background: var(--redbg); color: var(--red); }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.progress { height: 4px; background: var(--line); border-radius: 3px; margin-top: 9px; }
.progress span { display: block; height: 100%; background: var(--green2); border-radius: 3px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 25px; }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--subhead);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:hover td { background: #fafaf6; }
.data-table tr:last-child td { border-bottom: 0; }

.client-logo {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 600;
  font-size: 11px;
  font-family: var(--subhead);
  flex: 0 0 auto;
}

.filters { display: flex; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.filter {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--subhead);
  transition: all 0.15s ease;
}
.filter:hover { border-color: #c5c2b9; color: var(--ink); }
.filter.active { background: var(--green); color: white; border-color: var(--green); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.client-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  padding: 19px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.client-card:hover {
  transform: translateY(-2px);
  border-color: #c5c2b9;
  box-shadow: 0 8px 24px rgba(20, 30, 20, 0.06);
}
.client-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.client-card h3 { font-size: 21px; margin: 14px 0 5px; }
.client-card p { color: var(--muted); font-size: 11px; margin: 0 0 10px; }
.client-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}
.client-hero-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.social-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  font-family: var(--subhead);
  font-weight: 500;
  transition: all 0.15s ease;
  line-height: 1.3;
}
.social-chip:hover {
  background: #ffffff;
  border-color: var(--green2);
  color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.social-chip .social-icon { font-size: 12px; }
.social-chip .social-label { font-size: 11px; }
.social-chip .social-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}
.social-chip:hover .social-arrow {
  color: var(--green);
  transform: translate(1px, -1px);
}
.social-chip.instagram:hover { border-color: #d62976; color: #d62976; }
.social-chip.linkedin:hover { border-color: #0077b5; color: #0077b5; }
.social-chip.facebook:hover { border-color: #1877f2; color: #1877f2; }
.social-chip.youtube:hover { border-color: #ff0000; color: #ff0000; }
.social-chip.drive:hover { border-color: #0f9d58; color: #0f9d58; }
.social-chip.figma:hover { border-color: #f24e1e; color: #f24e1e; }
.meta-line { display: flex; justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); font-weight: 500; }

.task-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-card { border: 1px solid var(--line); background: white; padding: 17px; border-radius: 8px; }
.stat-card strong {
  font-size: 24px;
  display: block;
  font-family: var(--subhead);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}
.stat-card small { display: block; color: var(--muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--pale); display: grid; place-items: center; margin: 0 auto 14px; color: var(--green); font-size: 20px; }

.overlay { position: fixed; inset: 0; background: rgba(23, 26, 23, 0.35); backdrop-filter: blur(2px); z-index: 40; }
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(590px, calc(100% - 32px));
  max-height: 84vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  z-index: 50;
  border: 1px solid var(--line);
  box-shadow: 0 20px 58px rgba(20, 30, 20, 0.16);
}
.modal-head {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h2 { font-family: var(--subhead); font-size: 17px; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 7px; background: #fcfcfa; }
.modal-foot .primary, .modal-foot .secondary { min-height: 36px; padding: 7px 13px; font-size: 12px; }
.modal .form-grid { gap: 12px; }
.modal .field { gap: 5px; }
.modal .field label { font-size: 10px; }
.modal .field input, .modal .field select, .modal .field textarea { padding: 9px 10px; font-size: 12.5px; }
.modal .field textarea { min-height: 70px; }
.modal-person-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.modal-person-summary .avatar { width: 32px; height: 32px; font-size: 11px; }
.modal-person-summary strong { display: block; font-family: var(--subhead); font-size: 12.5px; }
.modal-person-summary small { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.close { border: 0; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; padding: 3px 6px; line-height: 1; }
.close:hover { color: var(--ink); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #494e48; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green2);
  box-shadow: 0 0 0 2px var(--pale);
}
.field textarea { resize: vertical; min-height: 82px; }
.hint { font-size: 10px; color: var(--muted); font-weight: 500; }

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(460px, 100%);
  background: var(--bg);
  z-index: 50;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(20, 30, 20, 0.1);
  overflow: auto;
}
.drawer-head { padding: 25px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-head .close { position: absolute; right: 18px; top: 18px; }
.drawer-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.detail-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-block:last-of-type { border-bottom: 0; }
.detail-block label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.detail-block p { font-size: 13px; line-height: 1.6; margin: 7px 0 0; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--green);
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  font-family: var(--subhead);
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(20, 30, 20, 0.2);
  animation: up 0.25s ease;
}
.hidden { display: none !important; }
.mobile-menu { display: none; }
.role-options { display: grid; gap: 8px; }
.role-option {
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.role-option:hover { border-color: var(--green); background: #fdfdfb; }
.role-option strong { font-family: var(--subhead); font-weight: 600; font-size: 13px; }

/* Client Workspace */
.client-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  margin-bottom: 18px;
}
.client-hero-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--serif);
  font-size: 30px;
}
.client-hero h1 { font-size: 36px; margin: 0; }
.client-tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow: auto; }
.client-tab {
  border: 0;
  background: none;
  padding: 13px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--subhead);
  white-space: nowrap;
  cursor: pointer;
}
.client-tab.active { color: var(--ink); border-bottom: 2px solid var(--green); font-weight: 600; }

.workspace-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; }
.goal-list { display: grid; gap: 10px; padding: 12px 18px 18px; }
.goal-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 15px; }
.goal-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.goal-card h3 { font-size: 20px; margin: 0 0 4px; }
.goal-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 10px; margin-top: 9px; font-weight: 500; }
.goal-progress { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.goal-progress .progress { flex: 1; margin: 0; height: 5px; }
.goal-progress strong {
  font-size: 16px;
  font-family: var(--subhead);
  font-weight: 700;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.ai-card {
  background: linear-gradient(135deg, #eef2e9, #f8f6ef);
  border: 1px solid #dde4d7;
  border-radius: 9px;
  padding: 17px;
  margin: 12px 18px;
}
.ai-card h3 { font-size: 21px; margin: 0; }
.ai-card p { font-size: 12px; line-height: 1.6; color: #4f574f; }
.suggestion { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid rgba(48, 74, 53, 0.12); }
.suggestion:first-of-type { border-top: 0; }
.suggestion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  color: var(--green);
  flex: 0 0 auto;
  font-weight: 600;
}
.suggestion strong { display: block; font-size: 12px; font-family: var(--subhead); font-weight: 600; }
.suggestion small { color: var(--muted); line-height: 1.5; font-family: var(--sans); }

.timeline { padding: 10px 20px 20px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; position: relative; padding: 8px 0 17px; }
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 24px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}
.timeline-dot { width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--pale); background: var(--green); z-index: 1; }
.timeline-item strong { font-size: 12px; font-family: var(--subhead); font-weight: 600; }
.timeline-item small { display: block; color: var(--muted); margin-top: 3px; font-family: var(--subhead); }

.attachment-box { border: 1px dashed #cfcac0; border-radius: 8px; padding: 24px; text-align: center; background: #fff; }
.attachment-box strong { font-family: var(--subhead); font-weight: 600; }
.attachment-box input { max-width: 100%; margin-top: 10px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.file-type { width: 32px; height: 32px; border-radius: 6px; background: var(--surface); display: grid; place-items: center; color: var(--green); font-weight: 600; }

.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.module-card { padding: 19px; border: 1px solid var(--line); background: white; border-radius: 9px; }
.module-card h3 { font-size: 22px; margin: 8px 0; }
.module-card p { font-size: 11px; color: var(--muted); line-height: 1.6; }
.upload-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }

/* Calendar */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.calendar-month { display: flex; align-items: center; gap: 12px; }
.calendar-month h2 { font-size: 29px; margin: 0; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  background: var(--line);
  gap: 1px;
}
.calendar-weekday {
  background: #f4f2ec;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 11px 12px;
}
.calendar-day {
  min-height: 136px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.calendar-day:not(.muted-day):hover {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--green2);
}
.calendar-day.muted-day { background: #faf9f5; }
.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.calendar-date-btn {
  border: 0;
  background: transparent;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.calendar-date-btn:hover {
  background: var(--surface);
  color: var(--green);
}
.calendar-date {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--subhead);
  font-weight: 600;
}
.calendar-date-btn .day-num {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--subhead);
  font-weight: 600;
}
.calendar-day.today .calendar-date-btn .day-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
}
.day-quick-add {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.35;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}
.calendar-day:hover .day-quick-add {
  opacity: 1;
  background: var(--surface);
  color: var(--green);
  border-color: var(--green2);
}
.calendar-day-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.calendar-task-pill {
  border: 1px solid var(--line);
  border-left: 3px solid #304a35;
  background: #fdfdfc;
  border-radius: 4px;
  padding: 5px 6px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  display: block;
  font-size: 10px;
  line-height: 1.3;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.calendar-task-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.calendar-task-pill.red { border-left-color: var(--red); background: #fdf8f7; }
.calendar-task-pill.amber { border-left-color: var(--amber); background: #fdfaf3; }
.calendar-task-pill.green { border-left-color: var(--green); background: #f5f8f3; }
.calendar-task-pill strong { font-family: var(--subhead); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-task-pill .cal-meta { display: block; color: var(--muted); font-size: 9px; margin-top: 1px; font-family: var(--subhead); }

.calendar-entry {
  border: 0;
  width: 100%;
  display: block;
  text-align: left;
  padding: 6px 7px;
  border-left: 3px solid var(--green);
  background: #edf1e8;
  border-radius: 4px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}
.calendar-entry:hover {
  background: #e1e9dc;
  transform: translateY(-1px);
}
.calendar-entry.video { border-left-color: #98724a; background: #f6eee2; }
.calendar-entry.copy { border-left-color: #63778c; background: #edf1f4; }
.calendar-entry strong { font-family: var(--subhead); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-entry .cal-meta { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; font-family: var(--subhead); }
.calendar-legend { display: flex; align-items: center; gap: 15px; font-size: 10px; color: var(--muted); font-weight: 600; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--green); margin-right: 5px; }
.legend-dot.video { background: #98724a; }
.legend-dot.copy { background: #63778c; }
.legend-dot.task { background: #171a17; }
.day-schedule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.day-schedule-card h4 {
  font-size: 14px;
  margin: 0 0 4px;
  font-family: var(--subhead);
  font-weight: 600;
}
.day-schedule-card p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.day-schedule-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.checkbox-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 3px 0; }
.person-check {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 8px;
  font-size: 11px;
  font-family: var(--subhead);
  cursor: pointer;
}
.person-check input { accent-color: var(--green); }
.campaign-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.campaign-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  border-color: #c5c2b9;
}
.campaign-card h3 { font-size: 24px; margin: 8px 0 4px; }
.campaign-card-client { font-size: 12px; font-weight: 600; color: var(--green); margin-bottom: 6px; }
.campaign-card p { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.campaign-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 6px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 11px;
}
.campaign-meta-item strong { display: block; color: var(--ink); font-size: 13px; }
.campaign-meta-item small { color: var(--muted); }
.campaign-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
  font-size: 11px;
  font-weight: 500;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.clickable-row:hover {
  background: rgba(48, 74, 53, 0.05);
}
.submission-link {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 10px;
  border-radius: 6px;
  word-break: break-all;
  color: var(--green);
  font-size: 11px;
  font-family: var(--subhead);
  font-weight: 600;
  text-decoration: none;
  margin-top: 6px;
}
.submission-link:hover { text-decoration: underline; background: var(--pale); }

/* ==========================================
   TEAM & WORKLOAD STYLES
   ========================================== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.team-member-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.team-member-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}
.team-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.team-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--subhead);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.team-card-info {
  flex: 1;
  min-width: 0;
}
.team-card-info h3 {
  margin: 0;
  font-size: 15px;
  font-family: var(--subhead);
  font-weight: 700;
}
.team-card-info p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.team-card-info a {
  color: var(--green);
  text-decoration: none;
  font-size: 11px;
  font-family: var(--subhead);
}
.team-card-info a:hover { text-decoration: underline; }
.team-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.team-card-title-row .badge { flex-shrink: 0; font-size: 9.5px; }
.team-card-meta,
.team-card-details {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 3px;
}
.team-card-meta a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-card-details {
  margin-top: 5px;
  font-size: 9.5px;
}
.team-card-details span + span {
  padding-left: 7px;
  border-left: 1px solid var(--line);
}
.team-workload-wrap {
  margin: 14px 0 10px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 0 0;
}
.team-workload-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--subhead);
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--muted);
}
.team-tasks-preview {
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 92px;
  overflow-y: auto;
}
.team-task-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 10px;
}
.team-task-mini strong {
  font-family: var(--subhead);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.team-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.team-card-actions .primary {
  font-size: 10.5px;
  padding: 6px 9px;
}
.team-card-actions .primary span {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  font-size: 9px;
}
.team-icon-actions { display: flex; gap: 4px; }
.team-icon-actions button {
  width: 27px;
  height: 27px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.team-icon-actions .text-button { color: var(--muted); }
.team-icon-actions .text-button:hover { color: var(--red); }

/* ==========================================
   SETTINGS HUB STYLES
   ========================================== */
.settings-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  margin-top: 16px;
}
@media(max-width: 850px){
  .settings-container { grid-template-columns: 1fr; }
}
.settings-menu {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-start;
}
.settings-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  font-family: var(--subhead);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.settings-tab-btn:hover { background: var(--surface); color: var(--green); }
.settings-tab-btn.active { background: var(--pale); color: var(--green); font-weight: 600; }
.settings-content-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.settings-group-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-family: var(--serif);
  font-weight: 500;
}
.settings-group-desc {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--muted);
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row-info h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-family: var(--subhead);
  font-weight: 600;
}
.settings-row-info p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.settings-input-control {
  min-width: 200px;
}
.settings-backup-box {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-top: 14px;
  text-align: center;
}

/* ==========================================
   OWNER EVALUATION RUBRIC & AI DESIGN QA
   ========================================== */
.eval-points-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.eval-point-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.eval-point-card:hover {
  border-color: #c5c2b9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.eval-point-info h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-family: var(--subhead);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eval-point-info p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.eval-point-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.eval-weight-badge {
  background: var(--pale);
  color: var(--green);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  font-family: var(--subhead);
}

.ai-eval-result-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-top: 14px;
}
.ai-eval-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.ai-eval-score-pill {
  font-size: 20px;
  font-family: var(--serif);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
}
.ai-eval-score-pill.passed { background: #eaf3ed; color: #285434; border: 1px solid #b7dfc3; }
.ai-eval-score-pill.warning { background: #fdf5ea; color: #9c6218; border: 1px solid #fae1be; }
.ai-eval-score-pill.failed { background: #fdf2f2; color: #9b2c2c; border: 1px solid #fecaca; }

.ai-eval-criteria-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.ai-eval-criterion-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
}
.ai-eval-criterion-row.pass { border-left: 4px solid var(--green); }
.ai-eval-criterion-row.warn { border-left: 4px solid #d97706; }
.ai-eval-criterion-row.fail { border-left: 4px solid var(--red); }

.ai-eval-criterion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-family: var(--subhead);
  font-weight: 600;
}
.ai-eval-criterion-feedback {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: #3b403a;
  line-height: 1.5;
}

/* ==========================================
   AI ASSISTANT COPILOT STYLES
   ========================================== */
.ai-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 24px;
  background: var(--green);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 36px rgba(26, 45, 30, 0.35);
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--subhead);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 60;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
}
.ai-fab:hover {
  transform: translateY(-2px) scale(1.02);
  background: #193120;
  box-shadow: 0 16px 42px rgba(26, 45, 30, 0.45);
}
.ai-fab-sparkle {
  font-size: 16px;
  color: #c9e88d;
  animation: sparkle-spin 6s linear infinite;
}
@keyframes sparkle-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  background: #fafaf7;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(18, 30, 20, 0.18);
  z-index: 65;
  display: flex;
  flex-direction: column;
  animation: drawerSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.ai-drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-drawer-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ai-drawer-title h3 {
  margin: 0;
  font-size: 18px;
  font-family: var(--serif);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-status-tag {
  font-size: 10px;
  font-family: var(--subhead);
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--pale);
  color: var(--green);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ai-status-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2cb658;
}

.ai-drawer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-msg {
  display: flex;
  gap: 12px;
  max-width: 94%;
  animation: up 0.2s ease;
}
.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ai-msg.assistant {
  align-self: flex-start;
}
.ai-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.ai-msg.user .ai-msg-avatar {
  background: #3e4a42;
}

.ai-msg-content {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.ai-msg.user .ai-msg-content {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  border-bottom-right-radius: 4px;
}
.ai-msg.assistant .ai-msg-content {
  border-bottom-left-radius: 4px;
}
.ai-msg-content p { margin: 0 0 10px; }
.ai-msg-content p:last-child { margin: 0; }
.ai-msg-content strong { font-weight: 600; }
.ai-msg-content ul, .ai-msg-content ol {
  margin: 8px 0;
  padding-left: 20px;
}
.ai-msg-content li { margin-bottom: 5px; }
.ai-msg-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
}
.ai-msg-content th, .ai-msg-content td {
  border: 1px solid var(--line);
  padding: 6px 9px;
  text-align: left;
}
.ai-msg-content th { background: var(--surface); font-weight: 600; }
.ai-msg-content pre {
  background: #202b23;
  color: #f1f5f2;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 11px;
  margin: 8px 0;
}

.ai-action-card {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--subhead);
}
.ai-action-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ai-action-card-head strong { font-size: 12px; }
.ai-action-card p { font-size: 11px; margin: 0 0 8px; color: var(--muted); }
.ai-action-card-btns {
  display: flex;
  gap: 6px;
}

.ai-voice-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: #eef5eb;
  border-top: 1px solid #d5e5cf;
  font-size: 11px;
  font-family: var(--subhead);
  color: var(--green);
  font-weight: 600;
}
.ai-voice-bar.active { display: flex; }
.ai-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-ring 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.8; }
}

.ai-input-wrap {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: rgba(250, 250, 247, 0.95);
  backdrop-filter: blur(10px);
}

.ai-composer-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-composer-box:focus-within {
  border-color: var(--green2);
  box-shadow: 0 4px 20px rgba(35, 59, 40, 0.12);
}

.ai-input-field {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
  resize: none;
  min-height: 40px;
  max-height: 240px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  overflow-y: auto;
}
.ai-input-field::placeholder {
  color: #98968e;
  font-size: 13px;
}

.ai-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f2f0eb;
}

.ai-composer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-composer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--subhead);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-composer-btn:hover {
  background: #eae8e1;
  border-color: #c5c2b9;
}
.ai-composer-btn.recording {
  background: #ffebe8;
  border-color: var(--red);
  color: var(--red);
  animation: pulse-mic 1s ease infinite alternate;
}

.ai-keyboard-hint {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--subhead);
}
.ai-keyboard-hint strong {
  color: var(--ink);
  font-weight: 600;
}

.ai-composer-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.ai-composer-send-btn:hover {
  background: #193120;
  transform: scale(1.05);
}
.ai-composer-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   NOTIFICATION CENTER & TEAM ACCESS STYLES
   ========================================== */
.notification-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 4px;
}
.notification-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.notification-card:hover {
  background: #fbfbf8;
  border-color: #c5c2b9;
}
.notification-card.unread {
  background: #f4f8f5;
  border-color: #bce0c8;
}
.notification-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.notification-card.unread .notification-icon-wrap {
  background: var(--pale);
  color: var(--green);
  border-color: var(--green2);
}
.notification-body {
  flex: 1;
  min-width: 0;
}
.notification-body strong {
  font-size: 12.5px;
  font-family: var(--subhead);
  display: block;
  color: var(--ink);
  line-height: 1.4;
}
.notification-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.notification-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
@media(max-width: 650px){
  .permission-grid { grid-template-columns: 1fr; }
}
.permission-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.permission-card:hover { border-color: var(--green); }
.permission-card input { accent-color: var(--green); margin-top: 2px; }
.permission-copy strong { display: block; font-size: 12px; font-family: var(--subhead); color: var(--ink); }
.permission-copy small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

.member-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  margin-top: 14px;
}
.member-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.member-task-row:hover {
  background: #fbfbf8;
  border-color: #c5c2b9;
}
/* ==========================================
   STUDIO DISCUSSIONS & CHAT (SLACK-LIKE)
   ========================================== */
.content:has(.chat-layout) {
  padding-bottom: 12px !important;
  overflow: hidden !important;
}

.content:has(.chat-layout) .page-head {
  margin-bottom: 12px;
  gap: 12px;
}
.content:has(.chat-layout) .page-head h1 {
  font-size: 26px;
  margin-bottom: 2px;
}
.content:has(.chat-layout) .page-head p {
  font-size: 12px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: calc(100vh - 190px);
  max-height: calc(100vh - 190px);
  min-height: 480px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.03);
}
@media(max-width: 850px) {
  .chat-layout { 
    grid-template-columns: 1fr; 
    height: calc(100vh - 150px);
    max-height: calc(100vh - 150px);
  }
  .chat-sidebar { 
    border-right: none; 
    border-bottom: 1px solid var(--line); 
    max-height: 120px; 
  }
}
.chat-sidebar {
  background: #f7f6f1;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}
.chat-sidebar-head {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-sidebar-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-family: var(--subhead);
  font-weight: 700;
  color: var(--green);
}
.chat-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 12px 16px 4px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-channel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 8px;
}
.chat-channel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}
.chat-channel-btn:hover {
  background: rgba(48, 74, 53, 0.07);
}
.chat-channel-btn.active {
  background: var(--green);
  color: var(--white);
  font-weight: 600;
}
.chat-channel-btn .channel-hash {
  font-weight: 600;
  color: var(--muted);
}
.chat-channel-btn.active .channel-hash {
  color: rgba(255, 255, 255, 0.8);
}
.chat-channel-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--green2);
  color: white;
}
.chat-tag {
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: auto;
}
.chat-tag.client { background: #e3f2fd; color: #1565c0; }
.chat-tag.team { background: #e8f5e9; color: #2e7d32; }

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--white);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.chat-header {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafaf7;
  flex-shrink: 0;
}
.chat-header-info h2 {
  margin: 0;
  font-size: 16px;
  font-family: var(--subhead);
  font-weight: 700;
}
.chat-header-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.chat-messages-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.15s ease;
  padding: 4px 8px;
  border-radius: 8px;
}
.chat-msg-row:hover {
  background: #fafaf7;
}
.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--subhead);
  flex-shrink: 0;
}
.chat-msg-avatar.client-avatar {
  background: #2563eb;
}
.chat-msg-row {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.chat-msg-row:hover {
  background: rgba(0, 0, 0, 0.025);
}
.chat-msg-row.pinned-highlight {
  background: rgba(122, 138, 104, 0.08);
  border-left: 3px solid var(--green);
}
.chat-msg-body {
  flex: 1;
  min-width: 0;
}
.chat-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.chat-msg-author {
  font-weight: 700;
  font-size: 13px;
  font-family: var(--subhead);
  color: var(--ink);
}
.chat-msg-role {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
}
.chat-msg-time {
  font-size: 11px;
  color: #9ca3af;
  margin-left: auto;
}
.chat-msg-text {
  font-size: 13.5px;
  color: #242924;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Hover Action Bar */
.chat-msg-actions-hover {
  position: absolute;
  top: -12px;
  right: 14px;
  display: none;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: 2px 6px;
  align-items: center;
  gap: 2px;
  z-index: 5;
}
.chat-msg-row:hover .chat-msg-actions-hover {
  display: flex;
}
.chat-hover-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
  line-height: 1;
}
.chat-hover-btn:hover {
  background: var(--pale);
  transform: scale(1.2);
}

/* Interactive Emoji Reactions */
.chat-reactions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
  user-select: none;
}
.chat-reaction-pill:hover {
  border-color: var(--green);
  background: var(--pale);
}
.chat-reaction-pill.active {
  background: rgba(122, 138, 104, 0.15);
  border-color: var(--green);
  font-weight: 700;
}

/* Pinned Items Banner */
.chat-pinned-banner {
  background: #f7f6f2;
  border-bottom: 1px solid var(--line);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink);
}
.chat-pinned-banner strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}

/* Interactive Quick-Action Prompt Chips */
.chat-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick-actions::-webkit-scrollbar {
  display: none;
}
.chat-chip {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.chat-chip:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
  transform: translateY(-1px);
}

/* Rich Attachment Cards & Media Previews */
.chat-msg-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.chat-msg-img-thumb {
  max-width: 280px;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  object-fit: cover;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}
.chat-msg-img-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.chat-attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8faf6;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  max-width: 480px;
}
.chat-attachment-card.doc-type {
  border-left-color: #2e7d32;
  background: #f4f8f3;
}
.chat-attachment-card.video-type {
  border-left-color: #e65100;
  background: #fff8f2;
}
.chat-attachment-card.link-type {
  border-left-color: #1565c0;
  background: #f0f7ff;
}
.chat-attach-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.chat-attach-info {
  flex: 1;
  min-width: 0;
}
.chat-attach-info strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-attach-info small {
  color: var(--muted);
  font-size: 11px;
}

/* WhatsApp-Style Channel Info & Media Gallery Panel */
.chat-layout.with-info {
  grid-template-columns: 240px 1fr 310px;
}
@media(max-width: 1100px) {
  .chat-layout.with-info {
    grid-template-columns: 240px 1fr;
    position: relative;
  }
}
.chat-info-panel {
  border-left: 1px solid var(--line);
  background: #fafaf8;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
}
@media(max-width: 1100px) {
  .chat-info-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    z-index: 20;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
  }
}
.chat-info-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f4ee;
}
.chat-info-head h4 {
  margin: 0;
  font-size: 14px;
  font-family: var(--subhead);
  font-weight: 700;
  color: var(--green);
}
.chat-info-hero {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: white;
}
.chat-info-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 auto 8px;
}
.chat-info-hero h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: var(--subhead);
}
.chat-info-hero p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.chat-info-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: white;
}
.chat-info-tab-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.chat-info-tab-btn:hover {
  color: var(--green);
  background: var(--pale);
}
.chat-info-tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 700;
}
.chat-info-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* Gallery Grid & Doc Lists inside WhatsApp Media Panel */
.chat-media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.chat-media-gallery-item {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #eef2eb;
  position: relative;
}
.chat-media-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s ease;
}
.chat-media-gallery-item:hover img {
  transform: scale(1.08);
}
.chat-media-video-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.65);
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
}

.chat-doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
.chat-doc-icon {
  font-size: 20px;
}
.chat-doc-info {
  flex: 1;
  min-width: 0;
}
.chat-doc-info strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-doc-info small {
  color: var(--muted);
  font-size: 10.5px;
}

.chat-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-link-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
.chat-link-info {
  flex: 1;
  min-width: 0;
}
.chat-link-info strong {
  display: block;
  font-size: 12px;
  color: var(--ink);
}
.chat-link-info a {
  display: block;
  font-size: 11px;
  color: var(--green);
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Chat Mention Badges & Auto-Complete Bar */
.chat-mention-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(48, 74, 53, 0.12);
  color: var(--green);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(48, 74, 53, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  text-decoration: none;
  line-height: 1.3;
}
.chat-mention-pill:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.chat-mention-suggestions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f4f6f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-mention-suggestions-bar::-webkit-scrollbar {
  display: none;
}
.chat-mention-chip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.chat-mention-chip:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
  transform: translateY(-1px);
}

/* In-Chat Search Bar & Sidebar Search */
.chat-sidebar-search-wrap {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafaf7;
}
.chat-sidebar-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 11.5px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  font-family: var(--sans);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.chat-sidebar-search:focus {
  border-color: var(--green);
}

.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: #f7f9f5;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  animation: up 0.15s ease-out;
}
.chat-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  flex: 1;
  min-width: 220px;
}
.chat-search-input-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--ink);
  font-family: var(--sans);
  width: 100%;
}
.chat-search-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.chat-search-pill {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.chat-search-pill:hover {
  border-color: var(--green);
  color: var(--ink);
}
.chat-search-pill.active {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
}
.chat-search-highlight {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

/* WhatsApp-Style Minimal Icon Chat Composer & Responsive Layout */
.chat-composer-box {
  padding: 8px 18px 14px;
  background: #fbfbf9;
  border-top: 1px solid var(--line);
  position: relative;
}
.chat-composer-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 4px 6px 4px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  min-height: 42px;
}
.chat-composer-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 2px 14px rgba(48, 74, 53, 0.15);
}
.chat-icon-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  margin-bottom: 1px;
  transition: all 0.15s ease;
}
.chat-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--green);
  transform: scale(1.08);
}
.chat-icon-btn.ai-sparkle {
  color: var(--green);
  font-weight: 700;
  font-size: 16px;
}
.chat-icon-btn.ai-sparkle:hover {
  background: rgba(48, 74, 53, 0.1);
}
.chat-composer-textarea {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  resize: none;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  height: 24px;
  min-height: 24px;
  max-height: 160px;
  outline: none;
  padding: 7px 4px 5px;
  line-height: 1.45;
  box-sizing: border-box;
  overflow-y: hidden;
}
.chat-send-circle-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 1px;
  box-shadow: 0 2px 6px rgba(48, 74, 53, 0.35);
  transition: all 0.15s ease;
}
.chat-send-circle-btn:hover {
  background: #1e3323;
  transform: scale(1.06);
  box-shadow: 0 4px 10px rgba(48, 74, 53, 0.45);
}
.chat-send-circle-btn svg {
  margin-left: 2px;
}

body.page-discussions #aiFab {
  display: none !important;
}

.chat-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 18px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-quick-actions::-webkit-scrollbar {
  display: none;
}

/* WhatsApp-Grade Rich Emoji Popover */
.chat-emoji-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  width: 350px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: up 0.15s ease-out;
}
.chat-emoji-popup.hidden {
  display: none !important;
}
.chat-emoji-header {
  padding: 8px 10px 6px;
  background: #fafaf8;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.emoji-search-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  font-family: var(--sans);
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.emoji-search-input:focus {
  border-color: var(--green);
}
.chat-emoji-category-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-emoji-category-tabs::-webkit-scrollbar {
  display: none;
}
.emoji-cat-tab {
  background: transparent;
  border: none;
  font-size: 16px;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-cat-tab:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}
.emoji-cat-tab.active {
  opacity: 1;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.chat-emoji-scroll-area {
  max-height: 250px;
  overflow-y: auto;
  padding: 8px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emoji-category-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.emoji-cat-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0 4px;
}
.chat-emoji-popup-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}
.emoji-tile {
  background: transparent;
  border: none;
  font-size: 21px;
  cursor: pointer;
  padding: 4px 0;
  border-radius: 8px;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  user-select: none;
}
.emoji-tile:hover {
  background: #f0f4ec;
  transform: scale(1.22);
}
.emoji-tile:active {
  transform: scale(0.95);
}

@media(max-width: 640px) {
  .chat-composer-box {
    padding: 6px 10px 10px;
  }
  .chat-composer-input-wrap {
    padding: 3px 4px 3px 8px;
    gap: 4px;
  }
  .chat-icon-btn {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .chat-send-circle-btn {
    width: 32px;
    height: 32px;
  }
  .chat-emoji-popup {
    left: 4px;
    right: 4px;
    width: auto;
  }
  .chat-emoji-popup-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ==========================================
   COMMERCIALS: PROPOSALS, QUOTES, CONTRACTS
   ========================================== */
.commercial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.commercial-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.commercial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}
.commercial-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.doc-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}
.doc-type-badge.proposal { background: #ede7f6; color: #512da8; }
.doc-type-badge.quotation { background: #e0f2f1; color: #00796b; }
.doc-type-badge.contract { background: #e8eaf6; color: #283593; }
.doc-type-badge.invoice { background: #fff3e0; color: #e65100; }

/* ==========================================
   HOLIDAYS & CELEBRATIONS STYLES
   ========================================== */
.holiday-top-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.holiday-quarter-block {
  margin-top: 24px;
}
.holiday-quarter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--subhead);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.holiday-quarter-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.holiday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.holiday-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.holiday-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--green2);
}
.holiday-card.past-holiday {
  opacity: 0.65;
  background: #fafaf9;
}
.holiday-date-badge {
  width: 52px;
  height: 56px;
  border-radius: 10px;
  background: var(--pale);
  border: 1px solid var(--green2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.holiday-date-badge .month {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green);
}
.holiday-date-badge .day {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.holiday-info {
  flex: 1;
  min-width: 0;
}
.holiday-info h4 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-family: var(--subhead);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.holiday-info p {
  margin: 4px 0 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.holiday-long-weekend-pill {
  display: inline-flex;
  align-items: center;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
}
.holiday-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.announcement-banner {
  background: linear-gradient(135deg, #2d4533, #1c2e21);
  color: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(45, 69, 51, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.announcement-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.announcement-content h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: var(--subhead);
  font-weight: 700;
  color: #c9e88d;
}
.announcement-content p {
  margin: 0;
  font-size: 12.5px;
  color: #e5e9e2;
  line-height: 1.45;
}

.birthday-card {
  background: #fffcf5;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.birthday-icon {
  font-size: 22px;
  animation: bounce 2s infinite;
}

/* ==========================================
/* ==========================================
   OBLEEQ EXACT PDF DOCUMENT TEMPLATES & VIEWER
   ========================================== */
.pdf-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 16, 0.96);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-viewer-bar {
  height: 62px;
  background: #232c1e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  color: #fff;
  flex-shrink: 0;
  z-index: 100000;
}
.pdf-viewer-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pdf-viewer-title strong {
  font-size: 15px;
  color: #edf2e8;
  font-family: var(--subhead);
}
.pdf-viewer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pdf-viewer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 30px 16px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  background: #192016;
  width: 100%;
  box-sizing: border-box;
}

.doc-page-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 2250 / 3182; /* Exact 300DPI Ultra-High-Definition Master Ratio */
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  box-sizing: border-box;
  flex-shrink: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.doc-page-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #ffffff;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  transform: translateZ(0); /* Hardware accelerated rendering */
}

.doc-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.doc-overlay-item {
  position: absolute;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  cursor: text;
  pointer-events: auto;
  transition: outline 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: text;
  -webkit-user-select: text;
}

.doc-overlay-item:hover {
  outline: 1.5px dashed rgba(66, 133, 244, 0.75);
  outline-offset: 2px;
}

.doc-overlay-item:focus,
.doc-overlay-item[contenteditable="true"]:focus {
  outline: 2px solid #1a73e8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.25) !important;
  z-index: 100 !important;
}

.doc-page-toolbar {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.doc-page-container:hover .doc-page-toolbar {
  opacity: 1;
}

.doc-page-btn {
  background: rgba(30, 40, 25, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.doc-page-btn:hover {
  background: #2d3824;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.doc-page-btn.delete-page:hover {
  background: #d93025;
  border-color: #d93025;
}

.editor-banner-indicator {
  background: linear-gradient(90deg, #1e3a29, #2b4c35);
  color: #e2f1e5;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Specific dynamic overlay positions matching exact Obleeq PDF typography */
.ov-prop-cover-date {
  top: 7%;
  right: 8.2%;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #3b4632;
  background: transparent;
  padding: 1px 4px;
}
.ov-con-cover-date {
  top: 6.4%;
  right: 7.2%;
  font-size: 14px;
  font-weight: 600;
  color: #3b4632;
  background: #f7f6f2;
  padding: 0 4px;
}
.ov-prop-cover-client {
  top: 71.4%;
  left: 20%;
  width: 60%;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #2b3924;
  background: transparent;
  padding: 1px 4px;
  line-height: 1.2;
}
.ov-con-cover-client {
  top: 72.4%;
  left: 18%;
  width: 64%;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: #212c1a;
  background: #ffffff;
  padding: 2px 0;
}

.ov-con-deliv-client {
  top: 15.6%;
  left: 15.5%;
  font-size: 13.5px;
  font-weight: 600;
  color: #2e3a24;
  background: #f7f6f2;
  padding: 0 4px;
}
.ov-con-deliv-date {
  top: 18.2%;
  left: 15.2%;
  font-size: 13px;
  color: #3c4932;
  background: #f7f6f2;
  padding: 0 4px;
}
.ov-con-pricing-total {
  top: 30.2%;
  left: 11%;
  font-size: 13.5px;
  font-weight: 700;
  color: #24301c;
  background: #f7f6f2;
  padding: 0 4px;
}
.ov-con-accept-client {
  top: 24.2%;
  left: 24.8%;
  font-size: 13.5px;
  font-weight: 700;
  color: #242f1b;
  background: #f7f6f2;
  padding: 0 4px;
}

.ov-inv-id {
  top: 27.2%;
  right: 10.2%;
  font-size: 13.5px;
  font-weight: 600;
  color: #2e3a24;
  background: #ffffff;
  padding: 0 4px;
}
.ov-inv-date {
  top: 29.4%;
  right: 10.2%;
  font-size: 12.5px;
  color: #4f5b45;
  background: #ffffff;
  padding: 0 4px;
}
.ov-inv-client {
  top: 25.6%;
  left: 9.8%;
  font-size: 16px;
  font-weight: 600;
  color: #1f2819;
  background: #ffffff;
  padding: 0 6px;
}
.ov-inv-grand-total {
  top: 57.1%;
  right: 10.2%;
  font-size: 13.5px;
  font-weight: 700;
  color: #26331d;
  background: #e5e9de;
  padding: 2px 10px;
}

.ov-quo-id {
  top: 19.8%;
  right: 10.2%;
  font-size: 13.5px;
  font-weight: 600;
  color: #2e3a24;
  background: #ffffff;
  padding: 0 4px;
}
.ov-quo-date {
  top: 22.0%;
  right: 10.2%;
  font-size: 12.5px;
  color: #4f5b45;
  background: #ffffff;
  padding: 0 4px;
}
.ov-quo-client {
  top: 23.2%;
  left: 9.8%;
  font-size: 16px;
  font-weight: 600;
  color: #1f2819;
  background: #ffffff;
  padding: 0 6px;
}
.ov-quo-grand-total {
  top: 60.1%;
  right: 10.2%;
  font-size: 13.5px;
  font-weight: 700;
  color: #26331d;
  background: #e5e9de;
  padding: 2px 8px;
}

/* Print Rules for 100% Crisp Full-Page Output */
@media print {
  body * {
    visibility: hidden !important;
  }
  .pdf-viewer-body, .pdf-viewer-body * {
    visibility: visible !important;
  }
  .pdf-viewer-overlay {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  .pdf-viewer-body {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    gap: 0 !important;
  }
  .doc-page-container {
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .pdf-viewer-bar, .topbar, .sidebar, .overlay, #modal, #drawer, #aiFab, #toasts {
    display: none !important;
  }
  @page {
    size: A4 portrait;
    margin: 0;
  }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes up { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media(max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .client-hero { grid-template-columns: auto 1fr; }
  .client-hero .head-actions { grid-column: 1 / -1; }
}

@media(max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: 0.2s; }
  .sidebar.open { transform: none; }
  .mobile-menu { display: block; }
  .topbar { padding: 0 16px; }
  .search-trigger { width: auto; flex: 1; margin: 0 10px; }
  .search-trigger span:nth-child(2), .search-trigger kbd, .top-actions .compact { display: none; }
  .content { padding: 24px 16px; }
  .page-head { align-items: flex-start; gap: 18px; flex-direction: column; }
  .page-head h1 { font-size: 34px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(3) { border-right: 1px solid var(--line); }
  .metric:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .dashboard-grid, .split { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .task-stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .head-actions { display: none; }
  .calendar-grid { grid-template-columns: repeat(7, 138px); overflow-x: auto; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-day { min-height: 125px; }
}

@media(max-width: 600px) {
  .client-hero { grid-template-columns: 1fr; text-align: center; }
  .client-hero-logo { margin: auto; }
  .module-grid, .upload-pair { grid-template-columns: 1fr; }
  .client-tabs { gap: 18px; }
  .page-head h1 { font-size: 32px; }
}

@media(prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Responsive app shell: desktop, tablet and installable mobile app */
@media (max-width: 1100px) {
  .content { padding: 28px; }
  .topbar { padding: 0 28px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-tabs { gap: 20px; }
}

@media (max-width: 760px) {
  html, body { min-height: 100dvh; overflow-x: hidden; }
  .app-shell { min-height: 100dvh; }
  .sidebar {
    width: min(282px, 84vw);
    padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
    z-index: 45;
    box-shadow: 14px 0 34px rgba(20,30,20,.14);
  }
  .brand-logo-img { max-width: 180px; transform: scale(1.18); }
  .topbar {
    height: calc(60px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    gap: 7px;
  }
  .top-actions { gap: 5px; }
  .top-actions #helpButton { display: none; }
  .icon-button { width: 34px; height: 34px; }
  .search-trigger { height: 34px; min-width: 0; margin: 0 2px; padding: 0 10px; }
  .content { padding: 20px 14px calc(86px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 20px; gap: 12px; }
  .page-head h1 { font-size: clamp(27px, 8vw, 34px); }
  .page-head p { font-size: 12px; line-height: 1.45; }
  .metric-grid { margin-bottom: 18px; }
  .metric { min-width: 0; padding: 13px; }
  .metric strong { font-size: 20px; margin-top: 5px; }
  .metric small, .metric em { font-size: 9px; }
  .panel-head { padding: 13px 14px; }
  .panel-body { padding: 14px; }
  .panel-head h2 { font-size: 18px; }
  .cards, .team-grid, .module-grid, .workspace-grid, .dashboard-grid, .split { grid-template-columns: 1fr; }
  .team-grid { gap: 10px; }
  .client-hero { padding: 16px; gap: 12px; margin-bottom: 12px; }
  .client-hero h1 { font-size: 30px; }
  .client-tabs { gap: 16px; margin: 0 -14px 14px; padding: 0 14px; }
  .client-tab { padding: 10px 1px; font-size: 11px; }
  .head-actions { display: none; }
  .filters { gap: 6px; overflow-x: auto; padding-bottom: 3px; flex-wrap: nowrap; scrollbar-width: none; }
  .filters .filter { flex: 0 0 auto; font-size: 10px; padding: 7px 9px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 680px; }
  .calendar-toolbar { gap: 9px; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(104px, 1fr)); }
  .calendar-day { min-height: 106px; }
  .modal {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    top: auto;
    width: auto;
    max-height: min(84dvh, 720px);
    transform: none;
    border-radius: 14px;
  }
  .modal-head { padding: 14px 16px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 15px 16px; }
  .modal-foot { padding: 11px 16px; }
  .modal-foot .primary, .modal-foot .secondary { flex: 1; justify-content: center; }
  .drawer { width: 100%; max-width: 100%; }
  .ai-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .ai-fab span:last-child { display: none; }
  .ai-fab { width: 48px; height: 48px; border-radius: 50%; padding: 0; justify-content: center; }
  .notification-actions { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .metric-grid, .task-stats { grid-template-columns: 1fr 1fr; }
  .metric { padding: 11px; }
  .team-card-actions { align-items: flex-start; }
  .team-icon-actions { flex-wrap: wrap; justify-content: flex-end; }
  .push-status-actions { flex-wrap: wrap; }
  .chat-sidebar { width: min(290px, 88vw); }
}

/* Push Notification & PWA Status Card */
.push-status-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}
.push-status-card.active {
  background: rgba(122, 138, 104, 0.12);
  border-color: rgba(122, 138, 104, 0.4);
}
.push-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.push-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.push-status-left strong {
  display: block;
  font-size: 12.5px;
  color: var(--fg);
  font-family: var(--subhead);
}
.push-status-left p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.push-status-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
@media(max-width: 640px) {
  .push-status-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .push-status-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Chat Dynamic Mention Auto-Suggest Popup */
.chat-mention-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  width: 290px;
  max-height: 250px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  overflow-y: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}
.chat-mention-popup.hidden {
  display: none !important;
}
.chat-mention-popup-head {
  padding: 8px 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.chat-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.chat-mention-item:hover, .chat-mention-item.selected {
  background: #f4f6f0;
}
.chat-mention-item:last-child {
  border-bottom: none;
}

/* Workload Chip Badge */
.workload-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.cal-select {
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.cal-select:hover, .cal-select:focus {
  border-color: var(--green) !important;
}

/* Password Input Show/Hide Toggle */
.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-field-wrap input {
  width: 100%;
  padding-right: 42px !important;
}
.password-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  user-select: none;
}
.password-toggle-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}
.password-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Keep every permitted page action accessible on small screens. */
@media (max-width: 768px) {
  .head-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; min-width: 0; }
  .head-actions > * { max-width: 100%; white-space: normal; }
  .topbar { flex-wrap: wrap; height: auto; min-height: 60px; padding: 10px; }
  .top-actions { flex-wrap: wrap; max-width: 100%; }
  .top-actions .compact, .top-actions #helpButton { display: inline-flex; }
  .metric-grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-grid.cols-4 > .metric { border-bottom: 0; border-right: 1px solid var(--line); }
  .metric-grid.cols-4 > .metric:nth-child(2n) { border-right: 0; }
  .metric-grid.cols-4 > .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
.auth-screen-main { grid-column: auto; max-width: 100%; }
.auth-card .brand { justify-content: center; text-align: center; }
.auth-card .field, .auth-card .password-field-wrap { min-width: 0; width: 100%; }
#googleSignInContainer { max-width: 100%; overflow: hidden; }
/* Mobile and authentication layout is bundled here for reliable deployment. */
.metric-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid.cols-4 > .metric { border-bottom: 0; border-right: 1px solid var(--line); }
.metric-grid.cols-4 > .metric:last-child { border-right: 0; }
.auth-screen-main {
  box-sizing: border-box; width: 100%; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; margin: 0; background: var(--bg);
}
.auth-card {
  box-sizing: border-box; width: 100%; max-width: 400px; min-width: 0; margin: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; box-shadow: 0 18px 50px rgba(23,26,23,.08); overflow-wrap: anywhere;
}
.auth-card input, .auth-card button, .auth-card form { min-width: 0; max-width: 100%; }
.client-access-member-grid {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr) auto;
  gap: 6px; align-items: center;
}
.client-access-member-grid > * { min-width: 0; }
@media (max-width: 768px) {
  .metric-grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-grid.cols-4 > .metric:nth-child(2n) { border-right: 0; }
  .metric-grid.cols-4 > .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar .search-trigger { min-width: 0; flex: 1; margin: 0; }
  .top-actions { flex-shrink: 0; gap: 4px; }
  .team-card-actions, .team-icon-actions { flex-wrap: wrap; min-width: 0; gap: 6px; }
  .team-card-info, .team-card-title-row { min-width: 0; }
  .team-card-title-row { flex-wrap: wrap; }
  .team-card-info h3, .team-card-info a, .team-card-meta a { overflow-wrap: anywhere; }
  .client-access-member-grid { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .metric-grid.cols-4 > .metric { padding: 12px; }
  .metric-grid.cols-4 strong { font-size: 20px; line-height: 1.25; }
  .metric-grid.cols-4 small { font-size: 10px; letter-spacing: .02em; }
  .metric-grid.cols-4 em { display: block; margin-top: 4px; }
  .auth-card { padding: 24px 18px; }
  .auth-card input, .auth-card select { font-size: 16px; }
}
