:root {
  --navy: #0f1e3c;
  --navy-mid: #1a2f5a;
  --navy-light: #243d73;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --gold-pale: #f5e9c8;
  --cream: #faf8f3;
  --white: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e2d9c5;
  --success: #166534;
  --success-bg: #dcfce7;
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --pending: #1e40af;
  --pending-bg: #dbeafe;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

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;
}

.form-group { margin-bottom: 18px; }
.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;
}

.portal-body .form-group label { color: var(--muted); }

.form-group input,
.form-group textarea,
.form-group select {
  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;
}

.portal-body .form-group input,
.portal-body .form-group textarea,
.portal-body .form-group select {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--gold);
}

.btn-login,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  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 { width: 100%; }
.btn-login:hover, .btn-primary: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-success {
  color: #dcfce7;
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  display: none;
}
.login-success.show { display: block; }

#login-screen .login-confirm {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 4px;
  background: rgba(22, 101, 52, 0.28);
  border: 1px solid rgba(134, 239, 172, 0.4);
  color: #ecfdf5;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#login-screen .login-confirm.show {
  display: flex;
}
#login-screen .login-confirm.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
}
#login-screen .login-confirm-icon {
  color: #86efac;
  font-size: 18px;
  line-height: 1.2;
  flex: 0 0 auto;
  margin-top: 1px;
}
#login-screen .login-confirm-text {
  color: #ecfdf5;
}

.login-forgot-hint {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
}
.login-forgot-hint .link-btn {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 500;
}
.login-forgot-hint .link-btn:hover {
  color: var(--gold);
}

.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; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}
.auth-tab {
  padding: 11px 14px;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.auth-tab:hover { border-color: rgba(201,168,76,0.45); color: var(--white); }
.auth-tab.active {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.login-card-wide { max-width: 620px; }

.login-sub {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: -18px 0 22px;
  line-height: 1.5;
}

.password-field {
  position: relative;
}
.password-field input {
  padding-right: 46px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  padding: 6px;
  font-size: 15px;
  line-height: 1;
  z-index: 1;
}
.password-toggle:hover { color: var(--gold-light); }

#login-screen .form-group input:-webkit-autofill,
#login-screen .form-group input:-webkit-autofill:hover,
#login-screen .form-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  caret-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px rgba(15, 30, 60, 0.92) inset;
  box-shadow: 0 0 0 1000px rgba(15, 30, 60, 0.92) inset;
  transition: background-color 9999s ease-out 0s;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--gold);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-switch-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}

.auth-panel[hidden] { display: none !important; }

/* Signup wizard */
.signup-console {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 4px;
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
}
.signup-console::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gold);
}
.signup-console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.signup-step-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
.signup-stepper { display: flex; gap: 6px; }
.signup-stepper i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.signup-stepper i.on { background: var(--gold); }
.signup-stepper i.done { background: rgba(201,168,76,0.45); }

.signup-panel-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--white);
  font-weight: 600;
  margin-bottom: 6px;
}
.signup-panel-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 18px;
  line-height: 1.5;
}
.signup-panel-sub strong { color: var(--gold); font-weight: 600; }

.signup-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.signup-field { margin-bottom: 18px; }
.signup-field label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 7px;
  font-weight: 600;
}
.signup-field .label-optional {
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}
.signup-field input,
.signup-field select,
.signup-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  color: var(--white);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.signup-field input:focus,
.signup-field select:focus,
.signup-field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.14);
}
.signup-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23c9a84c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.signup-field select option { color: var(--text); background: var(--white); }
.signup-field textarea { resize: vertical; min-height: 86px; }
.signup-field input[type="file"] {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}
.signup-field input[type="date"] { cursor: pointer; }
.signup-hint { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 6px; }
.signup-err { display: none; font-size: 12px; color: #fca5a5; margin-top: 6px; }
.signup-field.invalid .signup-err { display: block; }
.signup-field.invalid input,
.signup-field.invalid select { border-color: #fca5a5; }
.signup-field.invalid input[type="file"] { border-color: #fca5a5; }
.pkg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pkg-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.3;
}
.pkg-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.pkg-tag-remove:hover {
  background: #fca5a5;
  color: #1a1a2e;
}

.signup-qline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: var(--white);
}
.signup-qline.muted { color: rgba(255,255,255,0.55); }
.signup-qdesc small { display: block; font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.signup-qval { font-weight: 600; white-space: nowrap; color: var(--gold); }
.signup-qnote {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin: 0 0 16px;
}

.signup-request-box {
  text-align: center;
  padding: 24px 16px;
}

.signup-request-seal {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 20px;
}

.signup-qtotal {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 4px;
  font-size: 14px;
  color: var(--white);
  font-weight: 600;
}
.signup-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.signup-btn-row .btn-login { flex: 1; min-width: 140px; }
.btn-signup-line {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: rgba(255,255,255,0.7);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-signup-line:hover { border-color: var(--gold); color: var(--gold); }

.signup-paytabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.signup-paytabs[hidden] { display: none; }
.signup-paytab {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.signup-paytab.active {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.signup-till {
  text-align: center;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 4px;
  background: rgba(15,30,60,0.55);
  border: 1px solid rgba(201,168,76,0.2);
}
.signup-till-cap {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.signup-till-no {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin: 6px 0;
}
.signup-till-meta { font-size: 12px; color: rgba(255,255,255,0.65); }
.signup-till-meta strong { color: var(--white); }

.signup-pay-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin: 12px 0;
  border-radius: 4px;
  background: rgba(30,64,175,0.2);
  color: #93c5fd;
  font-size: 12px;
}
.signup-pay-status[hidden] { display: none !important; }
.signup-manual {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 12px;
  line-height: 1.6;
}
.signup-manual strong { color: var(--white); }

.signup-bankbox {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 4px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}
.signup-bankbox div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
}
.signup-bankbox div:last-child { border-bottom: none; }
.signup-bankbox strong { color: var(--white); text-align: right; }

.signup-await {
  margin-top: 14px;
  padding: 14px;
  border-radius: 4px;
  background: rgba(254,243,199,0.08);
  border: 1px solid rgba(252,211,77,0.35);
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  line-height: 1.5;
}
.signup-await[hidden] { display: none !important; }

.signup-invoice-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.signup-inv-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.signup-inv-row:last-child { border-bottom: none; }
.signup-inv-row strong { color: var(--white); }

.signup-portal-ready {
  padding: 16px;
  border-radius: 4px;
  background: rgba(22,101,52,0.15);
  border: 1px solid rgba(134,239,172,0.35);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  line-height: 1.6;
}
.signup-portal-ready[hidden] { display: none !important; }
.signup-portal-ready h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: #86efac;
  margin-bottom: 8px;
}
.signup-portal-ready ul { margin: 10px 0 14px 18px; }

.signup-ref-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,30,60,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.signup-ref-modal[hidden] { display: none !important; }
.signup-ref-card {
  width: 100%;
  max-width: 400px;
  background: var(--navy-mid);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 4px;
  padding: 24px;
}
.signup-ref-card h3 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--white);
  font-size: 20px;
  margin-bottom: 8px;
}
.signup-ref-card p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
  line-height: 1.5;
}

.signup-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-mid);
  border: 1px solid var(--gold);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 200;
  max-width: min(90vw, 420px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.signup-toast[hidden] { display: none !important; }

.label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
}

@media (max-width: 560px) {
  .signup-row2 { grid-template-columns: 1fr; }
  .login-card-wide { max-width: 100%; }
}

.portal-body { background: var(--cream); }

.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; }

body.sidebar-open {
  overflow: hidden;
  touch-action: none;
}

.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 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.sidebar-logo {
  width: 100%;
  text-align: left;
}
.sidebar-logo .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
}
.sidebar-logo-link {
  display: block;
  line-height: 0;
}
.sidebar-site-logo {
  display: block;
  height: 108px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.sidebar-logo .sub {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 10px;
  font-weight: 600;
  text-align: left;
}

.client-badge {
  margin: 16px 16px 0;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 4px;
  padding: 12px;
}
.client-badge .rank {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.client-badge .name { font-size: 13px; color: var(--white); font-weight: 500; margin-top: 2px; }
.client-badge .ref { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 2px; }

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

.nav-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding: 0 24px;
  margin-bottom: 8px;
  margin-top: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  color: #ffffff;
  font-size: 15px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #ffffff; }
.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: 20px; text-align: center; font-size: 17px; }
.nav-item .icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.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;
}

.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;
}

.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; }

.engagement-switcher-form { margin: 0; }

.engagement-switcher {
  position: relative;
  flex-shrink: 1;
  min-width: 0;
}

.engagement-switcher-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 180px;
  max-width: 280px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.engagement-switcher-trigger:hover,
.engagement-switcher-trigger[aria-expanded="true"] {
  border-color: rgba(15, 30, 60, 0.25);
  box-shadow: 0 2px 8px rgba(15, 30, 60, 0.06);
}

.engagement-switcher-current {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.engagement-switcher-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engagement-switcher-meta {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engagement-switcher-chevron {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s;
}

.engagement-switcher-trigger[aria-expanded="true"] .engagement-switcher-chevron {
  transform: rotate(180deg);
}

.engagement-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 100%;
  width: max(100%, 280px);
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 30, 60, 0.12);
}

.engagement-switcher-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.engagement-switcher-option:hover {
  background: rgba(201, 168, 76, 0.08);
}

.engagement-switcher-option.is-active {
  background: rgba(15, 30, 60, 0.06);
}

.engagement-switcher-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.engagement-switcher-check {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--gold);
}

.topbar-engagement {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 240px;
}

.topbar-engagement-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-engagement-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

/* Profile menu (Google-inspired) */
.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;
}

.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 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.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;
}

.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;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

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

.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-footer {
  padding: 10px 0 8px;
}

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

.profile-dropdown-signout {
  color: var(--danger);
}

.profile-dropdown-signout i { color: var(--danger); }

/* Account settings */
.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; }

.btn-text-danger {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.btn-text-danger:hover { text-decoration: underline; }

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.alert-info { background: var(--pending-bg); color: var(--pending); border: 1px solid #93c5fd; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  margin-right: 4px;
}

.content { padding: 24px; max-width: 1400px; }

.dashboard-welcome {
  margin-bottom: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: 4px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-welcome-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  color: var(--white);
  margin: 0;
  line-height: 1.25;
}

.dashboard-welcome-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.3px;
}

.dashboard-welcome-sub strong {
  color: var(--gold);
  font-weight: 500;
}

.dashboard-packages-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 4px;
  color: var(--gold-pale);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.dashboard-packages-link:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ─── COMPONENTS ────────────────────────────────── */
.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;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.gold::before { background: var(--gold); }
.stat-card.navy::before { background: var(--navy); }
.stat-card.green::before { background: #22c55e; }
.stat-card.blue::before { background: #3b82f6; }

.stat-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.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-xl { height: 8px; }
.progress-bar-sm { height: 5px; margin-top: 8px; }

.doc-workflow { margin-top: 8px; max-width: 320px; }
.doc-workflow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.doc-workflow-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.doc-item-workflow { align-items: flex-start; }

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 2px;
  transition: width 0.8s ease;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.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: 4px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.6;
}
.notice[hidden],
.upload-pay-warning[hidden] {
  display: none !important;
}
.notice i { color: var(--gold); margin-top: 2px; flex-shrink: 0; }
.notice-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}
.notice-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.notice-link:hover { color: var(--gold); }
.notice-action {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.35);
  border-left-color: var(--gold);
}
.notice-pending {
  background: rgba(254,243,199,0.35);
  border-color: rgba(252,211,77,0.45);
  border-left-color: #d97706;
}
.notice-pending i { color: #d97706; }
.notice-success {
  background: rgba(220,252,231,0.5);
  border-color: rgba(134,239,172,0.45);
  border-left-color: #16a34a;
}
.notice-success i { color: #16a34a; }
.notice-info {
  background: rgba(219,234,254,0.55);
  border-color: rgba(147,197,253,0.55);
  border-left-color: var(--pending);
}
.notice-info i { color: var(--pending); }

/* ─── PACKAGES ──────────────────────────────────── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-secondary:hover {
  background: var(--cream);
  border-color: rgba(15, 30, 60, 0.25);
}
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.packages-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  background:
    linear-gradient(135deg, rgba(15, 30, 60, 0.03), rgba(201, 168, 76, 0.08)),
    var(--white);
}
.packages-hero-copy { flex: 1; min-width: 0; }
.packages-current {
  flex: 0 0 auto;
  min-width: 220px;
  padding: 16px 18px;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 4px;
  background: rgba(201, 168, 76, 0.08);
}
.packages-current-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.packages-current-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}
.packages-current-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.packages-switcher-hint { margin-bottom: 20px; }

.packages-step-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 14px;
}
.packages-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.packages-type-card {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 20px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.packages-type-card:hover {
  border-color: rgba(201, 168, 76, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 30, 60, 0.06);
}
.packages-type-card.is-selected {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}
.packages-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 30, 60, 0.06);
  color: var(--navy);
  margin-bottom: 14px;
}
.packages-type-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 8px;
}
.packages-type-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 16px;
  min-height: 3.2em;
}
.packages-type-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold);
}
.packages-browse-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.packages-back-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.packages-back-btn:hover { color: var(--navy); }
.packages-browse-sub {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.package-card-alacarte-note {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.5;
}
.package-confirm-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.packages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.packages-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.packages-filter {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.packages-filter:hover {
  border-color: rgba(15, 30, 60, 0.25);
  color: var(--navy);
}
.packages-filter.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.packages-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 100%);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
}
.packages-search i { color: var(--muted); font-size: 12px; }
.packages-search input {
  border: 0;
  outline: none;
  width: 100%;
  padding: 11px 0;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
  color: var(--text);
}

.packages-group { margin-bottom: 28px; }
.packages-group-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 14px;
}
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.package-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.package-card:hover {
  border-color: rgba(201, 168, 76, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 30, 60, 0.06);
}
.package-card.is-current {
  border-color: rgba(201, 168, 76, 0.65);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.08), var(--white) 40%);
}
.package-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.package-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold-pale);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 999px;
  padding: 4px 8px;
  margin-top: 4px;
}
.package-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin: 0;
}
.package-card-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-mid);
  margin-bottom: 18px;
}
.package-card-actions { margin-top: auto; }
.package-card-actions .btn-primary,
.package-card-actions .btn-secondary {
  width: 100%;
}
.package-card-badge[hidden],
.package-card-price[hidden],
.package-card-alacarte-note[hidden],
.package-card-actions .btn-primary[hidden],
.package-card-actions .btn-secondary[hidden] {
  display: none !important;
}
.packages-empty-filter {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 28px 12px;
}

.package-confirm-dialog {
  border: none;
  border-radius: 6px;
  padding: 0;
  margin: auto;
  position: fixed;
  inset: 0;
  width: min(560px, calc(100vw - 24px));
  height: fit-content;
  max-height: calc(100vh - 32px);
  background: transparent;
  box-shadow: 0 24px 60px rgba(15, 30, 60, 0.28);
}
.package-confirm-dialog[open] {
  display: block;
}
.package-confirm-dialog::backdrop {
  background: rgba(15, 30, 60, 0.55);
  backdrop-filter: blur(2px);
}
.package-confirm-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}
.package-confirm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 12px;
}
.package-confirm-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
}
.package-confirm-header h2 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.15;
}
.package-confirm-close {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
.package-confirm-close:hover {
  background: var(--cream);
  color: var(--navy);
}
.package-confirm-summary {
  margin: 0 24px;
  padding: 16px 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(15, 30, 60, 0.04), rgba(201, 168, 76, 0.1));
  border: 1px solid rgba(201, 168, 76, 0.25);
  text-align: center;
}
.package-confirm-summary-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
}
.package-confirm-summary-meta {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.package-confirm-body {
  padding: 18px 24px 8px;
  overflow-y: auto;
}
.package-confirm-body .optional {
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.package-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-top: 4px;
}
.package-confirm-check input {
  margin-top: 2px;
  accent-color: var(--navy);
}
.package-confirm-hint { margin: 8px 0 0 28px; }
.package-confirm-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}
.package-confirm-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
  background: var(--cream);
}
.package-confirm-footer .btn-primary,
.package-confirm-footer .btn-secondary {
  min-width: 168px;
}
.btn-primary.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

@media (max-width: 768px) {
  .packages-hero { flex-direction: column; }
  .packages-current { width: 100%; min-width: 0; }
  .packages-search { min-width: 100%; }
  .packages-type-grid { grid-template-columns: 1fr; }
  .package-confirm-footer {
    flex-direction: column-reverse;
  }
  .package-confirm-footer .btn-primary,
  .package-confirm-footer .btn-secondary {
    width: 100%;
    min-width: 0;
  }
}

.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #86efac; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fca5a5; }

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

.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 4px;
  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: var(--warning); }
.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: 500; }
.deadline-sub { font-size: 11px; color: var(--muted); }
.deadline-date { font-size: 12px; font-weight: 600; color: var(--navy); white-space: nowrap; }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.milestone-package-toolbar {
  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; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-sm { font-size: 10px; padding: 2px 8px; }
.badge.done { background: var(--success-bg); color: var(--success); }
.badge.progress { background: var(--warning-bg); color: var(--warning); }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.upcoming { background: #f3f4f6; color: #6b7280; }

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(226,217,197,0.4);
  font-size: 13px;
}
.payment-row:last-child { border-bottom: none; }
.payment-right { text-align: right; }
.payment-desc { color: var(--text); }
.payment-date { color: var(--muted); font-size: 12px; }
.payment-amount { font-weight: 600; color: var(--navy); }
.text-success { font-weight: 600; color: var(--success); }
.text-warning { font-weight: 600; color: var(--warning); }
.text-navy { font-weight: 600; color: var(--navy); }

.payment-due-box {
  background: rgba(254,243,199,0.6);
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 16px;
}
.payment-due-title { font-size: 13px; font-weight: 500; color: var(--warning); }
.payment-due-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 700;
  color: var(--navy);
  margin: 8px 0 4px;
}
.payment-due-date { font-size: 12px; color: var(--muted); }
.payment-methods { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.7; }

.pay-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 16px;
}

.pay-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pay-tab:hover { border-color: var(--gold); color: var(--navy); }
.pay-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
}

.pay-panel { display: none; }
.pay-panel.active { display: block; }
.pay-panel-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.pay-till-row, .bank-details div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(226,217,197,0.5);
  font-size: 13px;
}
.pay-till-row span, .bank-details span { color: var(--muted); }
.pay-till-row strong, .bank-details strong { color: var(--navy); }

.bank-details {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 16px;
  margin-bottom: 16px;
}
.bank-details div:last-child { border-bottom: none; }

.btn-pay {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 20px;
  background: var(--navy);
  color: var(--gold);
  border: none;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.btn-pay:hover { background: var(--navy-light); }
.btn-pay:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-pay-outline {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-pay-outline:hover { background: var(--cream); }
.btn-pay-disabled, .btn-pay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--muted);
  color: var(--white);
}
.btn-pay-disabled:hover, .btn-pay:disabled:hover { background: var(--muted); }

.pay-phone-field {
  margin: 16px 0 4px;
}
.pay-phone-field label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.pay-phone-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.pay-phone-field input:focus {
  border-color: var(--gold);
}

.field-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.payment-bank-ref {
  margin-top: 8px;
  font-size: 12px;
  color: var(--navy);
}

.pay-mpesa-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}
.pay-mpesa-hint i { color: var(--gold); font-size: 13px; }

.pay-status[hidden],
.pay-success[hidden] {
  display: none !important;
}

.pay-status:not([hidden]),
.pay-success:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 13px;
}
.pay-status {
  background: var(--pending-bg);
  color: var(--pending);
  border: 1px solid #93c5fd;
}
.pay-status.ok { background: var(--success-bg); color: var(--success); border-color: #86efac; }
.pay-status.err { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }
.pay-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
}
.pay-success i { font-size: 22px; flex-shrink: 0; }
.pay-success strong { display: block; margin-bottom: 2px; }
.pay-success span { font-size: 12px; opacity: 0.9; }

.pay-pending[hidden] {
  display: none !important;
}

.pay-pending:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 13px;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fcd34d;
}
.pay-pending i { font-size: 22px; flex-shrink: 0; }
.pay-pending strong { display: block; margin-bottom: 2px; }
.pay-pending span { font-size: 12px; opacity: 0.95; }

.pay-pending-card .payment-pending-box {
  background: rgba(254,243,199,0.45);
  border-color: #fcd34d;
}
.pay-pending-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.pay-pending-note i { color: var(--gold); margin-top: 2px; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--navy);
  border-radius: 4px;
  margin-top: 16px;
}
.total-row .label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.total-row .amount { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 700; color: var(--gold); }

.completion-block { margin-top: 16px; }

/* Documents */
.upload-pay-warning { margin: 16px 0; }
.notice-pay-action {
  padding: 8px 14px;
  border-radius: 4px;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.35);
  text-decoration: none;
}
.notice-pay-action:hover {
  background: rgba(201,168,76,0.25);
  color: var(--navy);
}
.btn-primary:disabled,
.btn-primary.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.15);
}
.upload-form { margin-top: 8px; }
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.upload-files-group {
  grid-column: 1 / -1;
}
.file-accumulator-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fafafa;
}
.file-accumulator-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-accumulator-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.file-accumulator-add:hover {
  border-color: var(--gold);
  color: var(--navy);
}
.file-accumulator-empty {
  font-size: 13px;
}
.file-accumulator-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-accumulator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.file-accumulator-name {
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-accumulator-remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.file-accumulator-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.doc-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.doc-deliverable-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  overflow: hidden;
  min-width: 0;
}
.doc-deliverable-wrap .doc-item {
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.doc-deliverable-wrap .doc-item:hover {
  border-color: transparent;
  box-shadow: none;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.doc-item:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(15,30,60,0.06); }
.doc-item-locked { opacity: 0.6; cursor: default; }
.doc-item-locked:hover { border-color: var(--border); box-shadow: none; }

.doc-icon {
  width: 42px; height: 42px;
  background: var(--navy);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--gold);
  flex-shrink: 0;
}
.doc-icon-muted { background: var(--muted); color: var(--white); }

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 500; color: var(--text); }
.doc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.doc-action {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc-item-paywall { flex-wrap: wrap; align-items: flex-start; }
.doc-item-paywall .btn-doc-unlock,
.doc-item-paywall .badge { margin-left: auto; flex-shrink: 0; }
.doc-pay-amount {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
}
.btn-doc-unlock {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-doc-unlock:hover { background: rgba(201,168,76,0.12); }

.doc-pay-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  box-sizing: border-box;
  min-width: 0;
}
.doc-pay-panel .pay-tabs,
.doc-pay-panel .pay-panel,
.doc-pay-panel .btn-pay,
.doc-pay-panel input {
  max-width: 100%;
  box-sizing: border-box;
}
.doc-pay-pending-note {
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  background: var(--warning-bg);
  border-top: 1px solid #fcd34d;
  line-height: 1.5;
}
.pay-tabs-compact { margin: 0 0 12px; }
.pay-tabs-compact .pay-tab { font-size: 12px; padding: 10px 8px; }
.btn-pay-compact {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  font-size: 11px;
  letter-spacing: 0.3px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

.pay-till-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light, #1a3358) 100%);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 14px;
  color: var(--white);
  text-align: center;
}
.pay-till-cap {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}
.pay-till-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  line-height: 1.1;
}
.pay-till-meta {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}
.pay-till-meta strong { color: var(--white); }

.pay-stk-block {
  padding: 14px 0 4px;
  border-top: 1px dashed var(--border);
}
.pay-stk-label {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}

.pay-manual-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}
.pay-manual-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--navy);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid var(--gold);
}
.pay-manual-link:hover { color: var(--gold); }

.pay-ref-box {
  margin-top: 12px;
  padding: 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.bank-details-compact { margin-bottom: 12px; font-size: 12px; }
.pay-status-inline,
.pay-feedback-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
}
.pay-feedback-inline {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
}
.pay-feedback-inline.pay-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fcd34d;
}
.pay-status-inline { background: var(--pending-bg); color: var(--pending); border: 1px solid #93c5fd; }
.pay-status-inline.err { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }

@media (max-width: 640px) {
  .doc-item-paywall { flex-direction: column; align-items: stretch; }
  .doc-item-paywall .btn-doc-unlock,
  .doc-item-paywall .badge { margin-left: 0; width: 100%; text-align: center; }
}

/* Messages */
.message-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 460px;
  overflow-y: auto;
  padding: 4px 0 20px;
  scrollbar-width: thin;
}

.message { display: flex; gap: 12px; align-items: flex-start; }
.message.outgoing { flex-direction: row-reverse; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar.writer { background: var(--navy); color: var(--gold); }
.avatar.client { background: var(--gold); color: var(--navy); }

.bubble {
  max-width: min(68%, 520px);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.message.incoming .bubble {
  background: var(--white);
  border: 1px solid var(--border);
  border-top-left-radius: 0;
}
.message.outgoing .bubble {
  background: var(--navy);
  color: rgba(255,255,255,0.92);
  border-top-right-radius: 0;
}

.bubble-meta { font-size: 10px; color: var(--muted); margin-top: 4px; }
.message.outgoing .bubble-meta { text-align: right; color: rgba(255,255,255,0.45); }

.compose-area {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.compose-area textarea {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  resize: vertical;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  color: var(--text);
  background: var(--white);
}
.compose-area textarea:focus { border-color: var(--gold); }

.btn-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--navy);
  color: var(--gold);
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.btn-send:hover { background: var(--navy-light); }
.btn-send:disabled { opacity: 0.6; cursor: not-allowed; }

.empty-state {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
}

.empty-placeholder {
  text-align: center;
  padding: 48px 32px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(250,248,243,0.6) 0%, var(--white) 100%);
}

.empty-placeholder-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(15,30,60,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--gold);
}

.empty-placeholder-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}

.empty-placeholder-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 420px;
  margin: 0 auto 20px;
}

.empty-placeholder-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--navy);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 20px;
  padding: 8px 16px;
}
.empty-placeholder-hint i { color: var(--gold); font-size: 11px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.content > * { animation: fadeIn 0.25s ease; }

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    top: 0;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main { margin-left: 0; }
  .two-col { grid-template-columns: 1fr; }
  .topbar-cycle { display: none; }
  .topbar-engagement { display: none; }
  .engagement-switcher-trigger {
    min-width: 160px;
    max-width: 220px;
  }
}

@media (max-width: 768px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .card { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .upload-grid { grid-template-columns: 1fr; }
  .payment-row { flex-direction: column; align-items: flex-start; }
  .payment-right { text-align: left; }
  .doc-item { flex-wrap: wrap; }
  .doc-action { width: 100%; margin-top: 4px; }
  .compose-area { flex-direction: column; align-items: stretch; }
  .btn-send { width: 100%; justify-content: center; }
  .bubble { max-width: 85%; }
  .topbar-meta { display: none; }
  .profile-trigger-name { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .profile-dropdown { right: -8px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
  .deadline-item { flex-direction: column; align-items: flex-start; }
}
