/* ── Variables ──────────────────────────────────────────────── */
:root {
  --navy:   #1A3A6B;
  --blue:   #2563EB;
  --blue2:  #1D4ED8;
  --gold:   #C9A84C;
  --gold2:  #A8862E;
  --green:  #059669;
  --red:    #DC2626;
  --light:  #EBF0FA;
  --light2: #F5F8FF;
  --ink:    #1E293B;
  --muted:  #64748B;
  --border: #CBD5E1;
  --white:  #FFFFFF;
  --bg:     #F0F4FB;
  --card:   #FFFFFF;
  --radius: 12px;
  --rsm:    8px;
  --sh:     0 4px 24px rgba(26,58,107,.10);
}

/* ── Global smoothness ──────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* GPU-accelerated transitions on frequently-animated elements */
.btn, .act-btn, .nav-links a, .nav-profile-btn,
.sb-card, .stat-card, .feature-card,
.svc-tag, .ref-tag, .prio-badge, .status-badge,
.email-sent-badge, .export-range-btn,
.proposals-table tbody tr, .user-row-click,
.il-modal-box, .modal-box {
  will-change: auto;
  transition: background .15s ease, color .15s ease,
              border-color .15s ease, transform .15s ease,
              box-shadow .15s ease, opacity .15s ease;
}

/* Smooth focus ring on all focusable elements */
*:focus-visible {
  outline: 2px solid rgba(201,168,76,.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── S.No column ────────────────────────────────────────────── */
.proposals-table col.col-sno { width: 36px; }
.sno-cell {
  text-align: center;
  color: var(--muted);
  font-size: .68rem;
  font-family: 'DM Mono', monospace;
  user-select: none;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  padding: .45rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.nav-brand { font-size: 1.1rem; font-weight: 700; letter-spacing: -.5px; flex-shrink: 0; }
.logo-in, .logo-link { color: #fff; }
.logo-vestor { color: var(--gold); }

.nav-links { list-style: none; display: flex; gap: .15rem; }
.nav-links a, .nav-links .nav-add-user {
  font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.65);
  padding: .38rem .75rem; border-radius: var(--rsm); transition: all .2s;
  background: none; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  display: inline-block;
}
.nav-links a:hover, .nav-links a.active,
.nav-links .nav-add-user:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav-links .nav-add-user { color: var(--gold); }
.nav-links .nav-add-user:hover { background: rgba(201,168,76,.15); color: var(--gold); }

.nav-user-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.nav-tag {
  font-size: .65rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--gold); background: rgba(201,168,76,.15);
  border: 1px solid rgba(201,168,76,.3); padding: .22rem .65rem; border-radius: 100px;
  flex-shrink: 0;
}

/* Profile button */
.nav-profile { position: relative; }
.nav-profile-btn {
  display: flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--rsm); padding: .35rem .7rem .35rem .45rem;
  cursor: pointer; transition: all .2s; color: #fff; font-family: 'DM Sans', sans-serif;
}
.nav-profile-btn:hover { background: rgba(255,255,255,.14); }

.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.nav-user-name { font-size: .8rem; font-weight: 600; color: #fff; }
.nav-user-role {
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.nav-user-role.admin { color: var(--gold); }
.nav-user-role.user  { color: rgba(255,255,255,.5); }
.nav-caret { font-size: .6rem; color: rgba(255,255,255,.5); }

/* Profile dropdown menu */
.nav-profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  min-width: 220px; z-index: 200;
  animation: dropDown .15s ease;
}
@keyframes dropDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.npm-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem;
}
.npm-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.npm-name  { font-size: .88rem; font-weight: 600; color: var(--navy); }
.npm-email { font-size: .72rem; color: var(--muted); }
.npm-divider { height: 1px; background: var(--border); }
.npm-item {
  width: 100%; text-align: left; padding: .65rem 1rem;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: .84rem; color: var(--ink);
  transition: background .15s; display: block;
}
.npm-item:hover { background: var(--light2); }
.npm-logout { color: var(--red); }
.npm-logout:hover { background: #FEF2F2; }

/* ── il-modal (shared small modals) ─────────────────────────── */
.il-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.il-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
}
.il-modal-box {
  position: relative; background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  width: 100%; display: flex; flex-direction: column;
  animation: fadeUp .25s ease; overflow: hidden;
  max-height: 90vh;
}
.il-modal-header {
  background: var(--navy); color: #fff;
  padding: .85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.il-modal-header h3 { font-size: .95rem; font-weight: 600; }
.il-modal-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: .95rem; cursor: pointer; padding: .25rem .4rem;
  border-radius: 4px; transition: all .2s;
}
.il-modal-close:hover { color: #fff; background: rgba(255,255,255,.12); }

.il-modal-body { padding: 1.4rem; overflow-y: auto; }
.il-field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.il-field label { font-size: .78rem; font-weight: 600; color: var(--navy); }
.il-input {
  width: 100%; padding: .65rem .85rem;
  border: 1.5px solid var(--border); border-radius: var(--rsm);
  font-family: 'DM Sans', sans-serif; font-size: .875rem; color: var(--ink);
  background: var(--white); outline: none; transition: border-color .2s;
}
.il-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.il-modal-actions {
  display: flex; gap: .75rem; justify-content: flex-end;
  margin-top: 1.2rem;
}
.il-msg {
  padding: .65rem 1rem; border-radius: var(--rsm);
  font-size: .84rem; margin-bottom: 1rem;
}
.il-msg.success { background: #ECFDF5; border: 1px solid #6EE7B7; color: #065F46; }
.il-msg.error   { background: #FEF2F2; border: 1px solid #FECACA; color: var(--red); }

/* ── Main content ───────────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy); color: rgba(255,255,255,.45);
  font-size: .75rem; padding: .75rem 2rem;
  display: flex; justify-content: space-between; gap: 1rem;
}
.site-footer strong { color: rgba(255,255,255,.75); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: 'DM Sans', sans-serif; font-size: .85rem; font-weight: 600;
  padding: .65rem 1.4rem; border-radius: var(--rsm); border: none;
  cursor: pointer; transition: all .22s; letter-spacing: .02em;
  text-decoration: none; white-space: nowrap;
}
.btn-gold   { background: var(--gold); color: var(--navy); box-shadow: 0 4px 14px rgba(201,168,76,.3); }
.btn-gold:hover { background: var(--gold2); transform: translateY(-1px); }
.btn-blue   { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.3); }
.btn-blue:hover { background: var(--blue2); transform: translateY(-1px); }
.btn-navy   { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #152f57; transform: translateY(-1px); }
.btn-outline { background: none; border: 1.5px solid var(--border); color: var(--muted); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: .42rem .9rem; font-size: .8rem; }
.req { color: var(--red); }

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.6rem 2rem .9rem; flex-wrap: wrap;
}
.page-title { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--navy); margin-bottom: .2rem; }
.page-sub { font-size: .83rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.header-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #22408a 60%, #2563EB 100%);
  padding: 3.5rem 2rem 3rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,168,76,.12) 0%, transparent 60%);
}
.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(201,168,76,.15); border: 1px solid rgba(201,168,76,.35);
  color: var(--gold); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .9rem; border-radius: 100px; margin-bottom: 1.2rem;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #fff; line-height: 1.2; margin-bottom: .7rem;
}
.hero-sub {
  font-size: .9rem; color: rgba(255,255,255,.65); line-height: 1.65;
  max-width: 500px; margin-inline: auto; margin-bottom: 1.8rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 600px; margin: 0 auto; }
.stat-card {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--rsm); padding: 1rem; text-align: center; backdrop-filter: blur(6px);
  transition: background .2s;
}
.stat-card:hover { background: rgba(255,255,255,.18); }
.stat-card.accent { background: rgba(201,168,76,.2); border-color: rgba(201,168,76,.4); }
.stat-num { font-size: 1.6rem; font-weight: 700; color: #fff; font-family: 'DM Mono', monospace; }
.stat-lbl { font-size: .72rem; color: rgba(255,255,255,.55); margin-top: .15rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Feature cards ──────────────────────────────────────────── */
.features { padding: 3rem 2rem; max-width: 1000px; margin: 0 auto; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.feature-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--sh);
  border: 1px solid rgba(203,213,225,.6); padding: 1.5rem; transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(26,58,107,.15); }
.fc-icon { font-size: 1.8rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: .95rem; color: var(--navy); margin-bottom: .4rem; }
.feature-card p { font-size: .82rem; color: var(--muted); line-height: 1.55; }

/* ── Dashboard stats bar ────────────────────────────────────── */
.stats-bar { display: flex; gap: .5rem; padding: .5rem 1.25rem; flex-wrap: wrap; }
.sb-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--rsm);
  padding: .45rem .9rem; display: flex; align-items: center; gap: .45rem; box-shadow: var(--sh);
}
.sb-card.blue  { border-color: #93C5FD; background: #EFF6FF; }
.sb-card.gold  { border-color: #FDE68A; background: #FFFBEB; }
.sb-card.green { border-color: #6EE7B7; background: #ECFDF5; }
.sb-card.orange{ border-color: #FED7AA; background: #FFF7ED; }
.sb-card.teal  { border-color: #99F6E4; background: #F0FDFA; }
.sb-num { font-size: 1rem; font-weight: 700; font-family: 'DM Mono', monospace; color: var(--navy); }
.sb-lbl { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar { display: flex; gap: .5rem; padding: .4rem 1.25rem .75rem; flex-wrap: wrap; }
.search-input, .filter-select {
  padding: .38rem .7rem; border: 1.5px solid var(--border); border-radius: var(--rsm);
  font-family: 'DM Sans', sans-serif; font-size: .78rem; color: var(--ink);
  background: var(--white); outline: none; transition: border-color .2s;
}
.search-input { flex: 1; min-width: 160px; }
.search-input:focus, .filter-select:focus { border-color: var(--blue); }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; padding: 0 1.25rem 1.25rem; }
.proposals-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--sh); border: 1px solid rgba(203,213,225,.6);
  table-layout: fixed;
}
.proposals-table th {
  background: var(--navy); color: rgba(255,255,255,.85);
  padding: .5rem .65rem; font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proposals-table td {
  padding: .45rem .65rem; font-size: .78rem;
  border-bottom: 1px solid var(--light); vertical-align: middle !important;
  overflow: hidden; text-overflow: ellipsis;
}
.proposals-table tr:last-child td { border-bottom: none; }

.proposals-table col.col-sno      { width: 36px;  }
.proposals-table col.col-ref      { width: 122px; }
.proposals-table col.col-client   { width: 145px; }
.proposals-table col.col-mobile   { width: 105px; }
.proposals-table col.col-city     { width: 65px;  }
.proposals-table col.col-services { width: 162px; }
.proposals-table col.col-date     { width: 78px;  }
.proposals-table col.col-priority { width: 68px;  }
.proposals-table col.col-status   { width: 88px;  }
.proposals-table col.col-cost     { width: 68px;  }
.proposals-table col.col-email    { width: 80px;  }
.proposals-table col.col-actions  { width: 96px;  }

.ref-tag {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  background: var(--light); color: var(--navy);
  padding: .15rem .45rem; border-radius: 4px; white-space: nowrap;
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.name-cell { font-weight: 600; color: var(--navy); }
.empty-row { text-align: center; color: var(--muted); padding: 2rem; }
.empty-row a { color: var(--blue); }

.prio-badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: .15rem .5rem; border-radius: 100px;
  white-space: nowrap;
}
.prio-normal { background: var(--light); color: var(--navy); }
.prio-urgent { background: #FEF3C7; color: #92400E; }
.prio-vip    { background: rgba(201,168,76,.2); color: #7C5A1E; }

.status-badge { font-size: .65rem; font-weight: 600; padding: .15rem .5rem; border-radius: 100px; }
.status-draft    { background: var(--light); color: var(--navy); }
.status-sent     { background: #DBEAFE; color: #1D4ED8; }
.status-accepted { background: #DCFCE7; color: #065F46; }
.status-done     { background: #F3E8FF; color: #6B21A8; }

.status-sel {
  font-family: 'DM Sans', sans-serif; font-size: .72rem; font-weight: 600;
  padding: .18rem .38rem; border-radius: var(--rsm);
  border: 1.5px solid var(--border); outline: none; cursor: pointer;
  width: 100%;
}

td.actions-cell {
  white-space: nowrap;
  vertical-align: middle !important;
}
.act-btn {
  background: none;
  border: none;
  border-radius: var(--rsm);
  padding: 2px;
  cursor: pointer;
  margin: 0;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), filter .18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  vertical-align: middle;
  line-height: 1;
}
/* View — blue */
.act-btn.act-view:hover {
  border: none !important;
  background: none !important;
  transform: scale(1.22) translateY(-1px);
  filter: drop-shadow(0 3px 6px rgba(26,127,196,.45));
}
/* PDF download — green */
.act-btn.act-pdf:hover  { border: none !important; background: none !important; }
/* Send email — gold */
.act-btn.act-email:hover { border: none !important; background: none !important; }
/* Legacy */
.act-btn.act-ai:hover   { border-color: var(--gold); background: #FFFBEB; }
.act-btn.danger:hover   { border-color: var(--red);  background: #FEF2F2; }

.svc-cell { max-width: 170px; }
.svc-tag {
  display: inline-block; font-size: .62rem; font-weight: 500;
  background: #EFF6FF; color: #1D4ED8;
  border: 1px solid #BFDBFE; border-radius: 100px;
  padding: .1rem .42rem; margin: 1px 2px 1px 0;
  white-space: nowrap; max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; vertical-align: middle;
}
.cost-cell { font-size: .78rem; white-space: nowrap; color: var(--ink); }

/* ── Email sent badge ───────────────────────────────────────── */
.email-sent-cell { white-space: nowrap; }
.email-sent-badge {
  display: inline-flex; align-items: center; gap: .28rem;
  font-size: .68rem; font-weight: 600; padding: .22rem .6rem;
  border-radius: 100px; white-space: nowrap;
  letter-spacing: .02em;
}
.email-sent {
  background: #ECFDF5; color: #065F46;
  border: 1px solid #6EE7B7;
}
.email-not-sent {
  background: #F8FAFC; color: #94A3B8;
  border: 1px solid #E2E8F0;
}
.email-dot { font-size: .75rem; }
.email-sent-date {
  font-weight: 400; opacity: .75; font-size: .64rem;
  border-left: 1px solid rgba(6,95,70,.25); padding-left: .3rem; margin-left: .1rem;
}

/* ══════════════════════════════════════════════════════════════
   PALE-YELLOW HIGHLIGHT HOVER
   Rule: highlight ONLY inline text elements (spans, links, badges,
   buttons). Never apply background to <td> or row containers.
   ══════════════════════════════════════════════════════════════ */
:root {
  --hl: rgba(201,168,76,.13);
  --hl-strong: rgba(201,168,76,.2);
}

/* ── Ref tag ── */
.ref-tag { transition: background .15s, color .15s; }
.ref-tag:hover {
  background: rgba(201,168,76,.22) !important;
  color: #7C5A1E !important;
}

/* ── Client name link ── */
.proposals-table .name-cell a:hover,
.user-row-click td a:hover {
  background: var(--hl);
  border-radius: 3px;
  padding: 1px 3px;
  margin: -1px -3px;
}

/* ── Service tags ── */
.svc-tag { transition: background .15s, border-color .15s, color .15s; cursor: default; }
.svc-tag:hover {
  background: rgba(201,168,76,.18) !important;
  border-color: rgba(201,168,76,.5) !important;
  color: #7C5A1E !important;
}

/* ── Priority badge ── */
.prio-badge { transition: background .15s, color .15s; }
.prio-badge:hover {
  background: rgba(201,168,76,.25) !important;
  color: #7C5A1E !important;
}

/* ── Status dropdown — border tint only, no background on cell ── */
.status-sel { transition: border-color .15s; }
.status-sel:hover { border-color: rgba(201,168,76,.7) !important; }

/* ── Email badges ── */
.email-sent-badge { transition: background .15s, border-color .15s, color .15s; }
.email-sent-badge:hover {
  background: rgba(201,168,76,.2) !important;
  border-color: rgba(201,168,76,.5) !important;
  color: #7C5A1E !important;
}

/* ── Action icon buttons ── */
.act-btn { transition: background .15s, border-color .15s; }
.act-btn:hover {
  background: rgba(201,168,76,.12) !important;
  border-color: rgba(201,168,76,.55) !important;
}

/* ── Nav links ── */
.nav-links a, .nav-links .nav-add-user { transition: all .18s; }
.nav-links a:hover, .nav-links .nav-add-user:hover {
  color: #fff;
  background: rgba(201,168,76,.18) !important;
}

/* ── Nav profile button ── */
.nav-profile-btn:hover { background: rgba(201,168,76,.15) !important; }

/* ── Stat bar — only text colour changes, card stays still ── */
.sb-card.clickable:hover .sb-num { color: #7C5A1E; }
.sb-card.clickable:hover .sb-lbl { color: rgba(201,168,76,.9); }
.sb-card.clickable:hover { transform: none !important; box-shadow: var(--sh) !important; }

/* ── Sortable header text underline only — NO background on th ── */
.proposals-table th.sortable { cursor: pointer; }
.proposals-table th.sortable:hover { background: var(--navy) !important; }
.proposals-table th.sortable:hover > *:not(.sort-arrow) {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(201,168,76,.7);
}

/* ── Buttons ── */
.btn { transition: all .2s; }
.btn-outline:hover {
  border-color: rgba(201,168,76,.7) !important;
  color: #7C5A1E !important;
  background: rgba(201,168,76,.08) !important;
}
.btn-gold:hover  { background: #b8943e !important; }
.btn-navy:hover  { background: #152f57 !important; }
.btn-blue:hover  { background: var(--blue2) !important; }

/* ── Filter selects ── */
.filter-select { transition: border-color .15s; }
.filter-select:hover { border-color: rgba(201,168,76,.6) !important; }

/* ── Search input focus ring ── */
.search-input:focus {
  border-color: rgba(201,168,76,.7) !important;
  box-shadow: 0 0 0 2px rgba(201,168,76,.15) !important;
}

/* ── Export range buttons ── */
.export-range-btn:hover {
  background: rgba(201,168,76,.12) !important;
  border-color: rgba(201,168,76,.5) !important;
  color: #7C5A1E !important;
}
.export-range-btn.active {
  background: #1a2d5a !important;
  color: #fff !important;
  border-color: #1a2d5a !important;
}

/* ── Password eye button ── */
.pwd-eye { transition: background .15s; }
.pwd-eye:hover { background: rgba(201,168,76,.15) !important; border-radius: 4px; }

/* ── Session badges ── */
.sess-badge { transition: background .15s, color .15s; cursor: default; }
.sess-badge.online:hover { background: rgba(201,168,76,.2) !important; color: #7C5A1E !important; }

/* ── User table — only the name strong text, not the cell ── */
.user-row-click .u-avatar:hover { opacity: .85; }

/* ── Role badge ── */
.role-admin-badge { transition: background .15s; }
.role-admin-badge:hover { background: rgba(201,168,76,.3) !important; }

/* ── Feature cards ── */
.feature-card:hover h3 { color: #7C5A1E; }
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(26,58,107,.12); }

/* ── Table row hover: keep the existing light blue row highlight, nothing else ── */
.proposals-table tbody tr:hover { background: rgba(201,168,76,.05) !important; }
.user-row-click:hover { background: rgba(201,168,76,.05) !important; }

/* ── Proposal / Detail view ─────────────────────────────────── */
.view-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem; padding: .5rem 2rem 3rem;
}
.view-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--sh); border: 1px solid rgba(203,213,225,.6); overflow: hidden;
}
.view-card.full-width { grid-column: 1 / -1; }
.vc-head {
  background: linear-gradient(135deg, var(--navy), #1e4080);
  color: #fff; font-size: .85rem; font-weight: 600; padding: .75rem 1.2rem;
}
.vc-table { width: 100%; border-collapse: collapse; }
.vc-table td { padding: .6rem 1.2rem; font-size: .83rem; border-bottom: 1px solid var(--light); }
.vc-table td:first-child { font-weight: 600; color: var(--navy); width: 38%; }
.vc-table tr:last-child td { border-bottom: none; }
.svc-list { list-style: none; padding: 1rem 1.2rem; }
.svc-list li { font-size: .84rem; padding: .45rem 0; border-bottom: 1px solid var(--light); }
.svc-list li:last-child { border-bottom: none; }
.svc-list li::before { content: '✓ '; color: var(--green); font-weight: 700; }
.svc-list .empty { color: var(--muted); font-style: italic; }
.svc-list .empty::before { content: ''; }
.vc-notes { padding: .75rem 1.2rem; font-size: .83rem; color: var(--muted); line-height: 1.55; }

/* ── Modal (AI proposal) ────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: stretch; justify-content: center; padding: 1.5rem;
}
.modal[style*="flex"] { display: flex !important; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.7); backdrop-filter: blur(6px);
}
.modal-box {
  position: relative; background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  width: 100%; display: flex; flex-direction: column;
  animation: fadeUp .3s ease; overflow: hidden;
}
.modal-xl { max-width: 1100px; height: 90vh; }
.modal-header {
  background: var(--navy); color: #fff;
  padding: .9rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; gap: 1rem;
}
.modal-header-left { display: flex; align-items: center; gap: .75rem; }
.modal-header-left h3 { font-size: .95rem; font-weight: 600; }
.modal-ref-tag {
  font-family: 'DM Mono', monospace; font-size: .72rem;
  background: rgba(201,168,76,.25); color: var(--gold);
  padding: .2rem .65rem; border-radius: 100px;
}
.modal-header-actions { display: flex; align-items: center; gap: .75rem; }
.modal-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 1rem; cursor: pointer; padding: .25rem .5rem;
  border-radius: 4px; transition: all .2s; line-height: 1;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.modal-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.25rem; padding: 3rem 2rem; flex: 1;
}
.loading-spinner {
  width: 52px; height: 52px;
  border: 4px solid var(--light); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.loading-sub { font-size: .82rem; color: var(--muted); text-align: center; max-width: 380px; }
.loading-steps {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--light2); border-radius: var(--rsm);
  padding: 1rem 1.5rem; width: 100%; max-width: 380px;
}
.lstep { font-size: .82rem; color: var(--muted); padding: .3rem .5rem; border-radius: 4px; transition: all .3s; }
.lstep.active { color: var(--blue); font-weight: 600; background: rgba(37,99,235,.08); }
.lstep.done { color: var(--green); }
.lstep.done::before { content: '✅ '; }

.modal-error {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .75rem; padding: 3rem 2rem; flex: 1; text-align: center;
}
.error-icon { font-size: 2.5rem; }
.error-title { font-size: 1.1rem; font-weight: 700; color: var(--red); }
.error-msg { font-size: .85rem; color: var(--muted); max-width: 420px; line-height: 1.5; }

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

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff;
  padding: .75rem 1.75rem; border-radius: 100px;
  font-size: .85rem; font-weight: 500; opacity: 0;
  pointer-events: none; transition: all .3s; z-index: 9999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .navbar { padding: .6rem 1rem; }
  .page-header, .filter-bar, .stats-bar, .table-wrap { padding-left: 1rem; padding-right: 1rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .view-grid { grid-template-columns: 1fr; padding: .5rem 1rem 2rem; }
  .view-card.full-width { grid-column: 1; }
  .modal { padding: .5rem; }
  .modal-xl { height: 95vh; }
  .nav-user-info { display: none; }
  .nav-links { display: none; }
}


/* ── Sortable th — no white box ever ────────────────────────── */
.proposals-table th {
  background: var(--navy);    /* always navy, never let browser override */
  -webkit-tap-highlight-color: transparent;
}
.proposals-table th.sortable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* Prevent ANY browser default focus/active highlight */
  background: var(--navy);
}
.proposals-table th.sortable:hover,
.proposals-table th.sortable:focus,
.proposals-table th.sortable:active {
  outline: none;
  background: var(--navy);
}
/* Sort arrows on dark header */
.proposals-table thead .sort-arrow       { color: rgba(255,255,255,.3); display:inline-block; width:10px; font-size:.6rem; margin-left:2px; }
.proposals-table thead .sort-arrow.asc::after  { content:'▲'; color:#93C5FD; }
.proposals-table thead .sort-arrow.desc::after { content:'▼'; color:#93C5FD; }

/* ── User table avatar / badges ──────────────────────────────── */
.u-avatar {
  width:30px; height:30px; border-radius:50%;
  background:var(--light); color:var(--muted);
  font-size:.8rem; font-weight:700;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.u-avatar-admin { background:var(--gold); color:var(--navy); }
.role-admin-badge {
  font-size:.6rem; background:rgba(201,168,76,.25); color:#7C5A1E;
  padding:.1rem .4rem; border-radius:4px; font-weight:700; vertical-align:middle;
}

/* ── Session status badges ──────────────────────────────────── */
.sess-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  border-radius: 100px; padding: .2rem .7rem;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
}
.sess-badge.online  { background:#DCFCE7; color:#065F46; border:1px solid #6EE7B7; }
.sess-badge.offline { background:#FEF2F2; color:#991B1B; border:1px solid #FECACA; }
.sess-cell { white-space: nowrap; }

/* ── User row hover ─────────────────────────────────────────── */
.user-row-click { cursor: pointer; transition: background .12s; }
.user-row-click:hover { background: rgba(201,168,76,.05) !important; }

/* ── Password cell ──────────────────────────────────────────── */
.pwd-cell { display:flex; align-items:center; gap:.3rem; font-family:'DM Mono',monospace; font-size:.78rem; color:var(--muted); }
.pwd-eye  { background:none; border:none; cursor:pointer; font-size:.8rem; padding:.1rem .2rem; color:var(--muted); transition:color .15s; }
.pwd-eye:hover { color:var(--navy); }

/* ── Global: prevent ANY browser highlight on clickable th ──── */
th[onclick] {
  -webkit-tap-highlight-color: transparent;
  background: var(--navy);
  outline: none;
}
th[onclick]:hover,
th[onclick]:focus,
th[onclick]:active { outline: none; background: var(--navy); }
/* ── 3D SVG icon action buttons — all three ── */
.act-btn.act-view svg {
  width: 22px;
  height: 22px;
  display: block;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), filter .18s;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
}
/* ── 3D SVG icon action buttons (mail + pdf) ── */
.act-btn.act-pdf,
.act-btn.act-email {
  border: none;
  background: none;
  padding: .16rem .18rem;
  box-shadow: none;
}
.act-btn.act-pdf svg,
.act-btn.act-email svg {
  width: 22px;
  height: 22px;
  display: block;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), filter .18s;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
}
.act-btn.act-pdf:hover,
.act-btn.act-email:hover {
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}
.act-btn.act-pdf:hover svg {
  transform: scale(1.22) translateY(-1px);
  filter: drop-shadow(0 3px 6px rgba(26,122,70,.4));
}
.act-btn.act-email:hover svg {
  transform: scale(1.22) translateY(-1px);
  filter: drop-shadow(0 3px 6px rgba(26,127,196,.4));
}