:root {
  --navy:#061a31;
  --navy-2:#0b2748;
  --navy-3:#12395f;
  --gold:#d8aa4c;
  --gold-2:#f0c46f;
  --bg:#eef3f8;
  --panel:#ffffff;
  --panel-2:#f8fafc;
  --line:#d8e1ec;
  --line-2:#edf1f6;
  --text:#0f1c2e;
  --muted:#4f5d70;
  --danger:#b4232d;
  --ok:#11845b;
  --warning:#926200;
  --shadow:0 14px 34px rgba(15, 35, 65, .08);
}

* { box-sizing:border-box; }
html { font-size:14px; }
body {
  margin:0;
  color:var(--text);
  background:
    radial-gradient(circle at 84% 0%, rgba(216,170,76,.16), transparent 25rem),
    linear-gradient(180deg,#f6f8fb 0%, var(--bg) 28rem);
  font-family:Arial, Helvetica, sans-serif;
  font-size:.86rem;
  line-height:1.45;
}
a { color:inherit; text-decoration:none; }
button,input,select,textarea { font:inherit; }

.portal-shell {
  min-height:100vh;
  display:grid;
  grid-template-columns:232px minmax(0,1fr);
}
.portal-sidebar {
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  padding:14px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.04),transparent 22rem),
    var(--navy);
  color:#fff;
  border-right:1px solid rgba(255,255,255,.08);
}
.portal-brand {
  min-height:48px;
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
  padding:0 8px;
  border-radius:8px;
}
.portal-brand span {
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:linear-gradient(180deg,var(--gold-2),var(--gold));
  color:var(--navy);
  font-weight:900;
  letter-spacing:.02em;
}
.portal-brand strong {
  color:#fff;
  font-size:.95rem;
}
.portal-brand small {
  margin-left:auto;
  padding:2px 6px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  color:rgba(255,255,255,.62);
  font-size:.62rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.portal-nav {
  display:grid;
  gap:4px;
  padding-top:8px;
  border-top:1px solid rgba(255,255,255,.08);
}
.nav-group {
  margin:10px 10px 2px;
  color:rgba(255,255,255,.4);
  font-size:.62rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.12em;
}
.portal-nav a {
  min-height:36px;
  display:flex;
  align-items:center;
  gap:0;
  padding:0 12px;
  border-radius:8px;
  color:rgba(255,255,255,.92);
  font-size:.84rem;
  font-weight:700;
  position:relative;
}
.portal-nav a::before {
  content:"";
  width:6px;
  height:6px;
  margin-right:9px;
  border-radius:50%;
  background:rgba(255,255,255,.22);
}
.portal-nav a:hover {
  color:#fff;
  background:rgba(255,255,255,.08);
}
.portal-nav a.is-active {
  color:#fff;
  background:rgba(255,255,255,.13);
  box-shadow:inset 3px 0 0 var(--gold);
}
.portal-nav a.is-active::before { background:var(--gold); }
.nav-label {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.portal-nav em {
  min-width:22px;
  height:22px;
  display:grid;
  place-items:center;
  margin-left:auto;
  border-radius:999px;
  background:var(--gold);
  color:var(--navy);
  font-size:.68rem;
  font-style:normal;
  font-weight:900;
}

.portal-main { min-width:0; }
.portal-topbar {
  position:sticky;
  top:0;
  z-index:10;
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 20px;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.portal-topbar p {
  margin:0 0 1px;
  color:var(--muted);
  font-size:.66rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.12em;
}
.portal-topbar h1 {
  margin:0;
  color:var(--navy);
  font-size:1.25rem;
  line-height:1.1;
}
.portal-user {
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--navy);
  font-size:.82rem;
  white-space:nowrap;
}
.portal-user span {
  font-weight:800;
}
.portal-user small {
  color:var(--muted);
  font-weight:700;
}
.portal-user small::before {
  content:"";
  display:inline-block;
  width:1px;
  height:12px;
  margin:0 8px -2px 0;
  background:var(--line);
}
.portal-content {
  width:100%;
  padding:16px 20px 28px;
}

.modal-open {
  overflow:hidden;
}

.portal-panel {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:var(--shadow);
  padding:14px 16px;
}
.portal-panel + .portal-panel,
.stats-grid + .portal-panel {
  margin-top:14px;
}

.lead-workspace {
  display:grid;
  gap:12px;
}
.lead-tabs {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.lead-tabs a {
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  box-shadow:0 8px 22px rgba(15,35,65,.05);
  transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.lead-tabs a:hover {
  transform:translateY(-1px);
  border-color:#ead7aa;
  box-shadow:0 12px 28px rgba(15,35,65,.08);
}
.lead-tabs a.is-active {
  border-color:#e4c57d;
  background:linear-gradient(135deg,#fff 0%,#fff 58%,#fff5dc 100%);
  box-shadow:inset 3px 0 0 var(--gold), 0 12px 28px rgba(15,35,65,.08);
}
.lead-tabs span {
  color:var(--navy);
  font-size:.92rem;
  font-weight:900;
}
.lead-tabs strong {
  min-width:42px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--navy);
  color:#fff;
  font-size:1rem;
}
.module-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.module-card {
  min-height:108px;
  display:grid;
  align-content:start;
  gap:6px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:linear-gradient(135deg,#fff 0%,#fff 62%,#fff8e8 100%);
  box-shadow:0 8px 22px rgba(15,35,65,.05);
  transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.module-card:hover {
  transform:translateY(-1px);
  border-color:#ead7aa;
  box-shadow:0 12px 28px rgba(15,35,65,.08);
}
.module-card span {
  color:#9d711e;
  font-size:.66rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.1em;
}
.module-card strong {
  color:var(--navy);
  font-size:1rem;
}
.module-card small {
  color:var(--muted);
  white-space:normal;
}
.panel-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
  padding-bottom:10px;
  border-bottom:1px solid var(--line-2);
}
.panel-head h2,
.portal-panel h1,
.portal-panel h2 {
  margin:0;
  color:var(--navy);
  font-size:1rem;
  letter-spacing:-.01em;
}
.panel-head p,
.portal-panel p {
  margin:3px 0 0;
  color:var(--muted);
}

.stats-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.stat-card {
  min-height:96px;
  padding:15px;
  border:1px solid var(--line);
  border-radius:8px;
  background:
    linear-gradient(135deg,#fff 0%,#fff 62%,#fff8e8 100%);
  box-shadow:0 8px 22px rgba(15,35,65,.06);
}
.stat-card span {
  display:block;
  color:var(--muted);
  font-size:.68rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.stat-card strong {
  display:block;
  margin-top:8px;
  color:var(--navy);
  font-size:1.85rem;
  line-height:1;
}
.stat-card small {
  display:block;
  margin-top:7px;
  color:var(--muted);
  font-weight:800;
}

.filters,
.form-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.form-grid-compact {
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.field {
  display:grid;
  gap:4px;
  min-width:0;
}
.filter-actions {
  grid-template-columns:1fr auto auto;
  align-items:end;
}
.filter-actions label {
  grid-column:1/-1;
}
.field-full { grid-column:1/-1; }
.field-wide { grid-column:span 2; }
label,
.field span {
  color:var(--navy-2);
  font-size:.68rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
input,select,textarea {
  width:100%;
  min-height:34px;
  padding:7px 9px;
  border:1px solid #cfd8e5;
  border-radius:7px;
  background:#fff;
  color:var(--text);
  font-size:.84rem;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea {
  min-height:90px;
  resize:vertical;
}
.textarea-tall { min-height:176px; }
input:hover,select:hover,textarea:hover { border-color:#b9c6d6; }
input:focus,select:focus,textarea:focus {
  outline:0;
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(216,170,76,.18);
}
:focus-visible {
  outline:2px solid var(--gold);
  outline-offset:2px;
}
.field:has(input:required) label::after,
.field:has(select:required) label::after,
.field:has(textarea:required) label::after,
label:has(+ input:required)::after,
label:has(+ select:required)::after,
label:has(+ textarea:required)::after {
  content:" *";
  color:var(--danger);
}
input[type="file"] {
  padding:5px 8px;
}
input[type="checkbox"] {
  width:14px;
  min-height:14px;
  accent-color:var(--gold);
}

.btn,
.portal-user a {
  min-height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:0 12px;
  border:1px solid #cfd8e5;
  border-radius:7px;
  background:#fff;
  color:var(--navy);
  font-size:.82rem;
  font-weight:800;
  cursor:pointer;
  transition:transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.btn:hover,
.portal-user a:hover {
  transform:translateY(-1px);
  border-color:#b9c6d6;
  box-shadow:0 8px 18px rgba(15,35,65,.08);
}
.btn-primary {
  border-color:transparent;
  background:linear-gradient(180deg,var(--gold-2),var(--gold));
  color:var(--navy);
}
.btn-danger {
  border-color:#f1c2c7;
  color:var(--danger);
  background:#fff7f8;
}

.table-wrap {
  overflow:auto;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
table {
  width:100%;
  min-width:920px;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}
th,td {
  padding:8px 9px;
  border-bottom:1px solid var(--line-2);
  text-align:left;
  vertical-align:top;
  white-space:nowrap;
}
th {
  position:sticky;
  top:0;
  z-index:1;
  background:#f5f8fc;
  color:var(--navy);
  font-size:.66rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
}
td {
  color:#1f2a3d;
  font-size:.8rem;
}
tbody tr:hover td {
  background:#fbfdff;
}
tr:last-child td { border-bottom:0; }
small { color:var(--muted); }
th.wrap-text,
td.wrap-text {
  white-space:normal;
  min-width:220px;
  max-width:460px;
}
.table-empty {
  padding:30px 12px;
  white-space:normal;
  text-align:center;
  color:var(--muted);
  font-size:.82rem;
  font-weight:700;
}

.status {
  min-height:23px;
  display:inline-flex;
  align-items:center;
  padding:0 8px;
  border-radius:999px;
  background:#eef4fb;
  color:var(--navy);
  font-size:.68rem;
  font-weight:900;
}
.status.new-lead { background:#eaf2ff; color:#1556a7; }
.status.follow-up { background:#fff8df; color:var(--warning); }
.status.appointment-fixed { background:#fff1d2; color:#8a5b00; }
.status.converted,
.status.published,
.status.active,
.status.approved { background:#e7f6ee; color:var(--ok); }
.status.submitted { background:#eaf2ff; color:#1556a7; }
.status.rework-required,
.status.follow-up { background:#fff8df; color:var(--warning); }
.status.rejected,
.status.not-interested { background:#fdecee; color:var(--danger); }
.status.not-started { background:#eef4fb; color:var(--navy); }
.status.draft { background:#ecedf0; color:#454f5b; }
.source-pill {
  min-height:23px;
  display:inline-flex;
  align-items:center;
  padding:0 8px;
  border-radius:999px;
  font-size:.68rem;
  font-weight:900;
}
.source-pill.website {
  background:#eaf2ff;
  color:#1556a7;
}
.source-pill.team {
  background:#fff8e8;
  color:#875f17;
}
.source-pill.marketing {
  background:#f1eaff;
  color:#5b2fa8;
}

.actions {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.form-actions { margin-top:14px; }
.flash {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
  padding:9px 11px;
  border-radius:8px;
  font-size:.82rem;
  font-weight:800;
}
.flash-success { background:#e7f6ee; color:var(--ok); }
.flash-error { background:#fdecee; color:var(--danger); }
.flash-close {
  flex:0 0 auto;
  border:0;
  background:transparent;
  color:inherit;
  font-size:1rem;
  line-height:1;
  cursor:pointer;
  opacity:.6;
}
.flash-close:hover { opacity:1; }

.permission-grid { display:grid; gap:9px; }
.permission-row {
  display:grid;
  grid-template-columns:180px repeat(6,minmax(72px,1fr));
  gap:6px;
  align-items:center;
  padding:8px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.permission-row strong { color:var(--navy); }
.check-cell {
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  text-transform:none;
  letter-spacing:0;
}

.detail-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.detail-item {
  padding:11px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.detail-item span {
  display:block;
  color:var(--muted);
  font-size:.66rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.detail-item strong {
  display:block;
  margin-top:4px;
  color:var(--navy);
}
.detail-link {
  transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.detail-link:hover {
  transform:translateY(-1px);
  border-color:#ead7aa;
  box-shadow:0 10px 22px rgba(15,35,65,.08);
}
.activity-list { display:grid; gap:8px; }
.activity-item {
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.inner-panel {
  box-shadow:none;
  margin:14px 0;
}
.review-form {
  margin-top:14px;
}

.media-preview {
  width:132px;
  height:82px;
  object-fit:cover;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f7f9fc;
}
.table-thumb {
  width:42px;
  height:42px;
  object-fit:cover;
  border:1px solid var(--line);
  border-radius:8px;
  flex:0 0 auto;
}
.member-cell {
  display:flex;
  align-items:flex-start;
  gap:9px;
}
.tag-list {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.tag-list span {
  min-height:22px;
  display:inline-flex;
  align-items:center;
  padding:0 7px;
  border:1px solid #ead7aa;
  border-radius:999px;
  color:#875f17;
  background:#fff8e8;
  font-size:.68rem;
  font-weight:800;
}
.helper-note {
  margin-top:12px;
  color:var(--muted);
  font-weight:800;
}

.modal-backdrop {
  position:fixed;
  inset:0;
  z-index:50;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(3,16,31,.58);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.modal-backdrop.is-open {
  opacity:1;
  pointer-events:auto;
}
.modal-card {
  width:min(980px,100%);
  max-height:min(86vh,780px);
  overflow:auto;
  padding:16px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:10px;
  background:#fff;
  box-shadow:0 30px 90px rgba(0,0,0,.34);
  transform:translateY(14px) scale(.98);
  transition:transform .18s ease;
}
.modal-backdrop.is-open .modal-card {
  transform:translateY(0) scale(1);
  animation:modalIn .22s ease both;
}
.modal-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line-2);
}
.modal-head span {
  display:block;
  color:#9d711e;
  font-size:.66rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.1em;
}
.modal-head h2 {
  margin:2px 0 0;
  color:var(--navy);
  font-size:1.12rem;
}
.modal-close {
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:var(--navy);
  font-size:1.3rem;
  line-height:1;
  cursor:pointer;
}
.modal-close:hover {
  border-color:#ead7aa;
  background:#fff8e8;
}
@keyframes modalIn {
  from { opacity:.88; transform:translateY(18px) scale(.985); }
  to { opacity:1; transform:translateY(0) scale(1); }
}

.login-page {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(216,170,76,.22), transparent 22rem),
    linear-gradient(135deg,var(--navy),#102f55);
}
.login-card {
  width:min(420px,100%);
  padding:24px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:8px;
  background:#fff;
  box-shadow:0 26px 70px rgba(0,0,0,.25);
}
.login-card h1 {
  margin:0 0 4px;
  color:var(--navy);
  font-size:1.55rem;
}
.login-card p {
  margin:0 0 18px;
  color:var(--muted);
}

@media (max-width:1180px) {
  .portal-shell { grid-template-columns:200px minmax(0,1fr); }
  .filters,
  .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .lead-tabs { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:780px) {
  .portal-shell { grid-template-columns:1fr; }
  .portal-sidebar {
    position:static;
    height:auto;
  }
  .portal-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .portal-topbar {
    position:static;
    align-items:flex-start;
    flex-direction:column;
  }
  .portal-user {
    width:100%;
    flex-wrap:wrap;
  }
  .portal-content { padding:14px; }
  .filters,
  .form-grid,
  .module-grid,
  .stats-grid,
  .detail-grid { grid-template-columns:1fr; }
  .filter-actions {
    grid-template-columns:1fr 1fr;
  }
  .field-wide,
  .field-full { grid-column:1/-1; }
  .permission-row { grid-template-columns:1fr 1fr; }
  .nav-toggle { display:inline-flex; }
  .portal-sidebar {
    position:fixed;
    z-index:60;
    left:0;
    top:0;
    width:240px;
    transform:translateX(-100%);
    transition:transform .2s ease;
    box-shadow:0 0 0 100vmax rgba(3,16,31,0);
  }
  body.nav-open .portal-sidebar {
    transform:translateX(0);
    box-shadow:30px 0 60px rgba(3,16,31,.3);
  }
  body.nav-open { overflow:hidden; }
  .nav-backdrop {
    display:none;
    position:fixed;
    inset:0;
    z-index:55;
    background:rgba(3,16,31,.5);
  }
  body.nav-open .nav-backdrop { display:block; }
}
@media (min-width:781px) {
  .nav-toggle { display:none; }
}
.nav-toggle {
  display:none;
  width:36px;
  height:36px;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
  color:var(--navy);
  font-size:1.1rem;
  cursor:pointer;
}

/* Performance dashboard: meters, status tiles, compliance calendar.
   Colors reuse the existing --ok/--warning/--danger tokens and the same
   pill backgrounds as .status.* so this reads as one system, not a
   bolted-on chart library. */
.meter {
  height:8px;
  border-radius:99px;
  background:var(--line-2);
  overflow:hidden;
  margin:8px 0 6px;
}
.meter-fill { height:100%; border-radius:99px; }
.meter-fill.meter-good { background:var(--ok); }
.meter-fill.meter-warn { background:var(--warning); }
.meter-fill.meter-bad { background:var(--danger); }

.status-tile-row {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:12px;
}
.status-tile {
  border:1px solid var(--line);
  border-left:4px solid var(--line);
  border-radius:8px;
  padding:12px 14px;
  background:#fff;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.status-tile strong { font-size:1.5rem; color:var(--navy); }
.status-tile span { font-size:.78rem; color:var(--muted); }
.status-tile-good { border-left-color:var(--ok); }
.status-tile-warn { border-left-color:var(--warning); }
.status-tile-bad { border-left-color:var(--danger); }
.status-tile-info { border-left-color:#1556a7; }
.status-tile-neutral { border-left-color:#9aa4b2; }

.compliance-calendar {
  display:grid;
  grid-template-columns:repeat(10,1fr);
  gap:4px;
  max-width:420px;
}
@media (min-width:600px) {
  .compliance-calendar { grid-template-columns:repeat(15,1fr); }
}
.cal-cell {
  aspect-ratio:1;
  border-radius:3px;
  min-width:16px;
}
.cal-cell.cal-na, i.cal-na { background:var(--line-2); }
.cal-cell.cal-pending, i.cal-pending { background:#dbe4f0; }
.cal-cell.cal-good, i.cal-good { background:var(--ok); }
.cal-cell.cal-warning, i.cal-warning { background:var(--warning); }
.cal-cell.cal-critical, i.cal-critical { background:var(--danger); }

.compliance-legend {
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin-top:12px;
  font-size:.78rem;
  color:var(--muted);
}
.compliance-legend span { display:inline-flex; align-items:center; gap:6px; }
.compliance-legend i { width:12px; height:12px; border-radius:3px; display:inline-block; }

.eyebrow {
  display:block;
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--gold);
  margin-bottom:4px;
}
.assigned-task-box {
  background:var(--panel-2);
  border:1px solid var(--line);
  border-left:4px solid var(--gold);
  border-radius:8px;
  padding:14px 16px;
  margin:14px 0;
}
.assigned-task-box p { margin:0; color:var(--text); }

/* Portal Assistant: floating chat widget (Ollama-backed, see includes/assistant.php). */
.assistant-widget { position:fixed; right:20px; bottom:20px; z-index:60; }
.assistant-toggle {
  display:flex; align-items:center; gap:8px;
  background:var(--navy); color:#fff; border:1px solid var(--navy-3);
  border-radius:999px; padding:12px 18px; box-shadow:var(--shadow);
  cursor:pointer; font-weight:600; font-size:.92rem;
}
.assistant-toggle span[aria-hidden] {
  display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; border-radius:50%;
  background:var(--gold); color:var(--navy); font-weight:700; font-size:.8rem;
}
.assistant-toggle:hover { background:var(--navy-2); }
.assistant-panel {
  position:absolute; right:0; bottom:calc(100% + 12px);
  width:340px; max-width:calc(100vw - 40px); max-height:70vh;
  background:var(--panel); border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow); display:flex; flex-direction:column; overflow:hidden;
}
.assistant-panel[hidden] { display:none; }
.assistant-panel-header {
  display:flex; align-items:center; justify-content:space-between;
  background:var(--navy); color:#fff; padding:12px 14px;
}
.assistant-close { background:none; border:0; color:#fff; font-size:1.2rem; cursor:pointer; line-height:1; }
.assistant-messages {
  flex:1; overflow-y:auto; padding:12px 14px;
  display:flex; flex-direction:column; gap:8px; min-height:160px;
}
.assistant-msg { max-width:88%; padding:8px 11px; border-radius:10px; font-size:.9rem; line-height:1.4; white-space:pre-wrap; }
.assistant-msg-bot { align-self:flex-start; background:var(--panel-2); border:1px solid var(--line); color:var(--text); }
.assistant-msg-user { align-self:flex-end; background:var(--navy); color:#fff; }
.assistant-msg-error { align-self:flex-start; background:#fdecec; border:1px solid var(--danger); color:var(--danger); }
.assistant-msg-pending { opacity:.7; font-style:italic; }
.assistant-form { display:flex; gap:8px; padding:10px; border-top:1px solid var(--line); }
.assistant-form textarea {
  flex:1; resize:none; border:1px solid var(--line); border-radius:8px;
  padding:8px 10px; font:inherit; max-height:80px;
}
.assistant-form button {
  background:var(--gold); color:var(--navy); border:0; border-radius:8px;
  padding:0 16px; font-weight:700; cursor:pointer;
}
@media (max-width:780px) {
  .assistant-widget { right:12px; bottom:12px; }
  .assistant-panel { position:fixed; left:12px; right:12px; bottom:76px; width:auto; }
}
