:root {
  --navy: #0f1e3c;
  --navy-light: #243d73;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --cream: #faf8f3;
  --white: #ffffff;
  --text: #1a1a2e;
  --border: #e2d9c5;
  --muted: #6b7280;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; color: var(--text); }
a { color: inherit; text-decoration: none; }

/* ─── LOGIN ─────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--navy);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201,168,76,0.05) 0%, transparent 50%);
  position: relative;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255,255,255,0.015) 60px, rgba(255,255,255,0.015) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,0.015) 60px, rgba(255,255,255,0.015) 61px);
}

.login-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 4px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  backdrop-filter: blur(10px);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 4px;
  display: block;
}
.login-logo .tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--white);
  text-align: center;
  margin-bottom: 28px;
  font-weight: 600;
}

#login-screen .form-group { margin-bottom: 18px; }
#login-screen .form-group label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  font-weight: 500;
}
#login-screen .form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--white);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
  outline: none;
}
#login-screen .form-group input:focus { border-color: var(--gold); }

.password-field {
  position: relative;
}
.password-field input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-size: 15px;
  transition: color 0.2s;
}
.password-toggle:hover,
.password-toggle:focus {
  color: var(--gold);
  outline: none;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, transform 0.1s;
}
.btn-login:hover { background: var(--gold-light); transform: translateY(-1px); }

.login-error {
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  display: none;
}
.login-error.show { display: block; }

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.login-footer i { color: rgba(201,168,76,0.5); font-size: 12px; }

/* ─── ADMIN LAYOUT (matches client portal) ─────── */
.admin-body { background: var(--cream); min-height: 100vh; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,30,60,0.55);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-overlay.open { display: block; opacity: 1; }

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--navy);
  z-index: 200;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(201,168,76,0.15);
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 20px 0;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-logo .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
}
.sidebar-logo .sub {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav { padding: 20px 0 16px; flex: 1; overflow-y: auto; }

.nav-section {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 0 24px;
  margin-bottom: 6px;
  margin-top: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
.nav-item.active {
  background: rgba(201,168,76,0.08);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 500;
}
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; }

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}
.btn-logout:hover { color: rgba(255,255,255,0.75); }

.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 40px;
  height: 40px;
  color: var(--navy);
  cursor: pointer;
  font-size: 16px;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.topbar-meta { white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.topbar-cycle { white-space: nowrap; font-weight: 500; color: var(--navy); }
.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.profile-menu { position: relative; flex-shrink: 0; }

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 24px;
  transition: box-shadow 0.15s, background 0.15s;
  font-family: inherit;
}

.profile-trigger-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
  background: var(--cream);
  box-shadow: 0 0 0 1px var(--border);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.profile-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15, 30, 60, 0.14), 0 2px 8px rgba(15, 30, 60, 0.08);
  z-index: 200;
  overflow: hidden;
  animation: profileDropIn 0.15s ease-out;
}

.profile-dropdown[hidden] { display: none !important; }

@keyframes profileDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
}

.profile-dropdown-identity { min-width: 0; }

.profile-dropdown-rank {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-dropdown-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-email {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
}

.profile-dropdown-footer { padding: 10px 0 8px; }

.profile-dropdown-ref {
  font-size: 10px;
  color: var(--muted);
  padding: 0 20px 8px;
  letter-spacing: 0.3px;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text);
  transition: background 0.12s;
}

.profile-dropdown-item i {
  width: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.profile-dropdown-item:hover { background: var(--cream); }

.profile-dropdown-signout { color: #991b1b; }
.profile-dropdown-signout i { color: #991b1b; }

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-manage-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  transition: background 0.15s, border-color 0.15s;
}
.profile-manage-link:hover {
  background: var(--cream);
  border-color: var(--gold);
}

.profile-dropdown-menu { padding: 8px 0; }

.content { padding: 24px; }

/* ─── SETTINGS & FORMS ─────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}
.card-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
.settings-nav { margin-bottom: 0; }
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 4px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}
.settings-nav-item:hover { background: var(--cream); color: var(--navy); }
.settings-nav-item.active {
  background: rgba(201, 168, 76, 0.12);
  color: var(--navy);
  font-weight: 500;
}
.settings-nav-item i { width: 16px; text-align: center; }
.settings-form { max-width: 420px; margin-top: 8px; }
.settings-photo-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.settings-photo-form { flex: 1; min-width: 220px; }
.settings-remove-photo { margin-top: 16px; }

.admin-body .form-group { margin-bottom: 16px; }
.admin-body .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}
.admin-body .form-group input,
.admin-body .form-group textarea,
.admin-body .form-group select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  background: var(--white);
  color: var(--text);
}
.admin-body .form-group input:focus,
.admin-body .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.btn-text-danger {
  background: none;
  border: none;
  color: #991b1b;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-family: inherit;
}
.btn-text-danger:hover { text-decoration: underline; }

.alert-info { background: #e0f2fe; color: #0369a1; }

/* ─── DOCUMENT UPLOAD ──────────────────────────── */
.doc-upload-panel { margin-bottom: 20px; }
.doc-upload-intro { margin-bottom: 20px; }
.doc-section-sub { margin-bottom: 16px; }
.doc-section-gap { margin-top: 20px; }
.doc-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.doc-file-group { grid-column: 1 / -1; }
.label-required { color: #b91c1c; }
.label-optional { font-weight: 400; color: var(--muted); font-size: 11px; }
.doc-upload-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
  font-size: 13px;
  color: var(--navy);
}
.doc-upload-confirm i { color: var(--gold); }
.doc-empty-schedule {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #faf8f3;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
}
.doc-empty-schedule i { color: var(--gold); margin-top: 2px; }
.doc-empty-schedule p { margin: 0; line-height: 1.5; }

.inquiry-action-form { margin: 0; }
.inquiry-action-select {
  min-width: 140px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.checkbox-row { margin-bottom: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.form-actions { margin-top: 20px; }

/* Inquiries table — uses shared .data-table styles */
.inquiries-table { min-width: 920px; }

.row-action-menu { position: relative; display: inline-block; }
.row-action-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #fff;
  color: #2563eb;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.row-action-trigger i { font-size: 10px; transition: transform .15s; }
.row-action-trigger[aria-expanded="true"] i { transform: rotate(180deg); }
.row-action-trigger:hover,
.row-action-trigger[aria-expanded="true"] {
  background: #eff6ff;
  border-color: #60a5fa;
}
.row-action-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 30, 60, 0.12);
  padding: 6px;
  z-index: 30;
}
.row-action-item-form { margin: 0; }
.row-action-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.row-action-item:hover { background: #faf8f3; }
.row-action-item i { width: 14px; color: var(--muted); font-size: 12px; }
.row-action-item.danger { color: #991b1b; }
.row-action-item.danger:hover { background: #fef2f2; }

.pill-muted { background: #f3f4f6; color: #4b5563; }
.doc-manage-table { min-width: 860px; }
.doc-row-actions-hidden { display: none; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.table-pagination-meta { margin: 0; font-size: 12px; color: var(--muted); }
.table-pagination-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn,
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  gap: 6px;
}
.page-btn:hover,
.page-num:hover { background: #faf8f3; border-color: #d8ccb0; }
.page-btn.disabled,
.page-num.active { pointer-events: none; }
.page-btn.disabled { opacity: 0.45; }
.page-num.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.doc-forms-grid { margin-bottom: 20px; }
.doc-manage-table { min-width: 720px; }
.doc-status-pill { text-transform: capitalize; }
.doc-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.doc-inline-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.doc-inline-file {
  max-width: 180px;
  font-size: 12px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.stat-box i { font-size: 22px; color: var(--gold); }
.stat-link {
  display: flex;
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  width: 100%;
}
.stat-link:hover strong { color: var(--gold); }
.stat-box strong { display: block; font-size: 24px; }
.stat-box span { font-size: 12px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.panel h2 { font-size: 16px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 480px; font-size: 13px; }
.data-table thead th {
  background: #faf8f3;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: left;
  vertical-align: middle;
}
.data-table tbody td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid #f3efe6;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #fffdf9; }
.data-table .col-action { width: 120px; text-align: right; white-space: nowrap; }
.panel-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-table-head h2 { margin-bottom: 4px; }
.panel-table-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #faf8f3;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.cell-date { white-space: nowrap; color: var(--muted); font-size: 12px; }
.cell-strong { color: var(--navy); font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; line-height: 1.45; }
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.muted { color: var(--muted); font-size: 13px; }
.brief-cell { max-width: 220px; }
.inline-form select { padding: 6px 8px; font-size: 12px; border-radius: 4px; border: 1px solid var(--border); }
.alert { padding: 12px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.stats-row-secondary { margin-bottom: 24px; }

/* ─── DASHBOARD ─────────────────────────────────── */
.dash-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-welcome-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.dash-welcome-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.dash-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.6;
}
.dash-notice i { color: var(--gold); margin-top: 2px; flex-shrink: 0; }
.dash-notice-warn {
  background: rgba(254, 243, 199, 0.45);
  border-color: rgba(245, 158, 11, 0.35);
  border-left-color: #f59e0b;
}
.dash-notice-muted { color: var(--muted); }

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.dash-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.dash-stat-card.gold::before { background: var(--gold); }
.dash-stat-card.navy::before { background: var(--navy); }
.dash-stat-card.green::before { background: #22c55e; }
.dash-stat-card.blue::before { background: #3b82f6; }
.dash-stat-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.dash-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.dash-stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.progress-bar-lg { height: 6px; margin-top: 8px; }
.progress-bar-sm { height: 4px; margin-top: 0; min-width: 72px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 2px;
}

.dash-ops-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.dash-ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dash-ops-chip:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(15, 30, 60, 0.06);
}
.dash-ops-chip i { color: var(--gold); font-size: 13px; }
.dash-ops-chip strong { font-size: 14px; color: var(--navy); }
.dash-ops-chip-alert {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(254, 243, 199, 0.35);
}

.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s;
}
.dash-tab:hover { color: var(--navy); background: rgba(255, 255, 255, 0.6); }
.dash-tab.active {
  color: var(--navy);
  background: var(--white);
  border-color: var(--border);
  border-bottom-color: var(--white);
  font-weight: 600;
}
.dash-tab i { font-size: 14px; }
.dash-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.dash-tab-badge-warn { background: #f59e0b; }
.dash-tab-badge-muted { background: #e5e7eb; color: var(--muted); }

.dash-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.dash-panel h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}
.dash-panel-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dash-two-col-spaced { margin-top: 20px; }

.workstream-list, .deadline-list { display: flex; flex-direction: column; gap: 14px; }
.deadline-list-full { gap: 12px; }
.workstream-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
}
.workstream-name { font-weight: 600; color: var(--navy); }
.workstream-pct { font-size: 12px; color: var(--muted); font-weight: 600; }
.workstream-client, .workstream-cycle {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.workstream-note { font-size: 11px; color: var(--muted); margin-top: 6px; }

.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--cream);
  border-left: 3px solid var(--navy);
}
.deadline-item.priority-urgent { background: rgba(254, 243, 199, 0.5); border-left-color: #f59e0b; }
.deadline-item.priority-urgent .deadline-date { color: #d97706; }
.deadline-item.priority-low { border-left-color: #d1d5db; }
.deadline-item.deadline-overdue {
  background: rgba(254, 226, 226, 0.45);
  border-left-color: #ef4444;
}
.deadline-info { flex: 1; min-width: 0; }
.deadline-title { font-size: 13px; font-weight: 600; color: var(--navy); }
.deadline-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.deadline-action-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.deadline-meta { text-align: right; flex-shrink: 0; }
.deadline-date { font-size: 12px; font-weight: 600; color: var(--navy); white-space: nowrap; }
.deadline-days { font-size: 11px; color: var(--muted); margin-top: 2px; }

.workstream-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.workstream-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream);
}
.workstream-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.dash-inline-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.dash-inline-progress span { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.dash-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.dash-empty i { font-size: 32px; color: var(--border); margin-bottom: 12px; display: block; }
.dash-text-warn { color: #d97706; font-weight: 600; }

.manage-row-form { margin-bottom: 8px; }
.manage-row-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.manage-row-wide { grid-column: 1 / -1; }
.manage-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.manage-delete-form { margin-bottom: 12px; }
.manage-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.manage-subheading {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin: 16px 0 12px;
}

.milestone-filter-form { margin-top: 12px; }
.milestone-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.milestone-field-wide { grid-column: span 2; }
.milestone-manage-card { margin-bottom: 16px; }
.milestone-admin-table { min-width: 960px; }

.milestone-report-panel { margin-bottom: 16px; }
.milestone-report-card { padding: 24px; }
.milestone-report-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.milestone-report-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.milestone-report-note {
  font-size: 12px;
  color: var(--muted);
  margin: 16px 0 20px;
}
.milestone-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.milestone-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.milestone-table td {
  padding: 14px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(226, 217, 197, 0.4);
  vertical-align: middle;
}
.milestone-table tr:hover td { background: rgba(201, 168, 76, 0.03); }
.m-id {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.m-name { font-weight: 500; }
.m-date, .m-deliverable { color: var(--muted); font-size: 12px; }
.m-amount { font-weight: 600; color: var(--navy); white-space: nowrap; }
.milestone-badge.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.milestone-badge.done { background: #dcfce7; color: #166534; }
.milestone-badge.progress { background: #fef3c7; color: #92400e; }
.milestone-badge.pending { background: #dbeafe; color: #1e40af; }
.milestone-badge.upcoming { background: #f3f4f6; color: #6b7280; }

.milestone-template-table { min-width: 980px; }
.milestone-template-table input {
  width: 100%;
  min-width: 88px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.template-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-approve, .btn-reject {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-approve { background: #dcfce7; color: #166534; }
.btn-approve:hover { background: #bbf7d0; }
.btn-reject { background: #fee2e2; color: #991b1b; }
.btn-reject:hover { background: #fecaca; }
.pill-done { background: #dcfce7; color: #166534; }
.pill-progress { background: #fef3c7; color: #92400e; }
.pill-pending { background: #dbeafe; color: #1e40af; }
.bank-ref-code {
  display: inline-block;
  padding: 3px 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.3px;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.btn-link:hover { color: var(--gold); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

.btn-sm { padding: 8px 14px; font-size: 12px; }

.hidden { display: none !important; }

.broadcast-panel { margin-bottom: 20px; }
.broadcast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.broadcast-header h2 { margin-bottom: 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.broadcast-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.broadcast-form textarea,
.chat-compose textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 72px;
  outline: none;
}
.broadcast-form textarea:focus,
.chat-compose textarea:focus { border-color: var(--gold); }
.broadcast-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.form-status { margin-top: 12px; font-size: 13px; padding: 10px 12px; border-radius: 6px; }
.form-status.success { background: #dcfce7; color: #166534; }
.form-status.error { background: #fee2e2; color: #991b1b; }

.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  min-height: 560px;
}
.client-picker { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.client-picker-head { padding: 16px; border-bottom: 1px solid var(--border); }
.client-picker-head h2 { font-size: 15px; margin-bottom: 12px; }
.client-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  margin-bottom: 10px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.client-select:focus { outline: none; border-color: var(--gold); }
.client-picker-head input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.client-list { overflow-y: auto; flex: 1; max-height: 520px; }
.client-list-empty { padding: 20px; }
.client-item {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid #f0ebe0;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.client-item:hover { background: #faf8f3; }
.client-item.active { background: rgba(201,168,76,.12); border-left: 3px solid var(--gold); }
.client-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; }
.client-item strong { font-size: 14px; }
.client-ref { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.client-preview { display: block; font-size: 12px; color: #4b5563; line-height: 1.4; }
.client-time { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-panel { display: flex; flex-direction: column; min-height: 560px; padding: 0; overflow: hidden; }
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  padding: 40px;
}
.chat-empty i { font-size: 40px; color: var(--gold); opacity: .6; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header strong { display: block; font-size: 15px; }
.chat-header .muted { font-size: 12px; }

.chat-menu-wrap { position: relative; flex-shrink: 0; }
.chat-menu-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color .15s, color .15s;
}
.chat-menu-btn:hover,
.chat-menu-btn[aria-expanded="true"] {
  border-color: var(--gold);
  color: var(--navy);
}
.chat-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,30,60,.12);
  padding: 6px;
  z-index: 20;
}
.chat-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.chat-menu-item:hover { background: #faf8f3; }
.chat-menu-item.danger { color: #991b1b; }
.chat-menu-item.danger:hover { background: #fee2e2; }
.chat-menu-item i { width: 16px; text-align: center; font-size: 13px; }
.chat-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.message-thread {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 420px;
  background: #faf8f3;
}
.chat-thread-empty { text-align: center; margin: auto; }
.chat-message { display: flex; gap: 10px; align-items: flex-start; }
.chat-message.outgoing { flex-direction: row-reverse; }
.chat-bubble-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-bubble-avatar.admin { background: var(--navy); color: var(--gold); }
.chat-bubble-avatar.client { background: var(--gold); color: var(--navy); }
.chat-bubble {
  max-width: min(70%, 480px);
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.chat-message.incoming .chat-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-top-left-radius: 0;
}
.chat-message.outgoing .chat-bubble {
  background: var(--navy);
  color: rgba(255,255,255,.92);
  border-top-right-radius: 0;
}
.chat-meta { font-size: 10px; color: var(--muted); margin-top: 4px; }
.chat-message.outgoing .chat-meta { text-align: right; }
.chat-compose {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-compose textarea { flex: 1; min-height: 44px; max-height: 120px; }
.chat-compose .btn-primary { width: auto; flex-shrink: 0; padding: 12px 18px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .menu-toggle { display: inline-flex; }
  .main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-two-col { grid-template-columns: 1fr; }
  .workstream-grid { grid-template-columns: 1fr; }
  .manage-row-grid { grid-template-columns: 1fr; }
  .milestone-form-grid { grid-template-columns: 1fr; }
  .milestone-field-wide { grid-column: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; }
  .client-list { max-height: 280px; }
  .topbar-cycle { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .doc-upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-meta { display: none; }
  .profile-trigger-name { display: none; }
  .profile-dropdown { right: -8px; }
}
@media (max-width: 560px) {
  .stats-row { grid-template-columns: 1fr; }
  .dash-stats-grid { grid-template-columns: 1fr; }
  .dash-tabs { gap: 4px; }
  .dash-tab { padding: 8px 12px; font-size: 12px; }
  .deadline-item { flex-direction: column; align-items: flex-start; }
  .deadline-meta { text-align: left; }
}
