/* ==============================================================
   VISION TECH CRM — Design tokens & base styles
   ============================================================== */
:root {
  /* Brand */
  --brand-red:      #E2382C;
  --brand-red-dark: #C22A20;
  --brand-navy:     #34328C;
  --brand-green:    #17A558;

  /* Sidebar / chrome */
  --sidebar-bg:    #1A5D8A;
  --sidebar-bg-alt: #003366;
  --topbar-bg:      #1A5D8A;
  --sidebar-text:   #f8fbfd;
  --sidebar-text-active: #FFFFFF;
  --nav-active-1:   #CC0000;
  --nav-active-2:   #d11616;

  /* Stat card palette (matches dashboard concept) */
  --card-teal:    #086866;
  --card-green:   #2b9453;
  --card-yellow:  #faa508;
  --card-pink:    #E0398A;
  --card-mint:    #19805f;
  --card-crimson: #790a1b;
  --card-blue:    #0a2550;
  --card-orange:  #9b4202;
  --card-purple:  #2b0d72;
  --card-gold:    #F5A623;

  /* Surfaces */
  --bg-app:     #F3F5F9;
  --bg-card:    #FFFFFF;
  --border:     #E7EAF1;
  --text-dark:  #232B3D;
  --text-muted: #abb3c4;
  --text-soft:  #ABB3C0;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 10px rgba(28, 35, 49, 0.06);
  --shadow-pop: 0 12px 32px rgba(28, 35, 49, 0.18);

  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg-app);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .brand-font {
  font-family: var(--font-display);
  margin: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C9CFDA; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==============================================================
   APP SHELL
   ============================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  transition: width .2s ease, left .25s ease;
  z-index: 40;
}

.sidebar-close-btn {
  display: none;
  margin-left: auto;
  background: none; border: none; color: #fff; opacity: .8;
  font-size: 22px; line-height: 1; padding: 4px 6px; flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(10, 12, 20, 0.55);
  z-index: 30; opacity: 0; transition: opacity .2s ease;
}
.sidebar-backdrop.show { display: block; opacity: 1; }

.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .search-box,
.sidebar.collapsed .profile-name,
.sidebar.collapsed .profile-role,
.sidebar.collapsed .chev { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff; letter-spacing: .3px; }
.brand-text span { color: var(--brand-red); }

.search-box { padding: 16px 18px 6px; flex-shrink: 0; }
.search-box .field {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.search-box input {
  background: transparent; border: none; outline: none;
  color: #fff; font-size: 13px; width: 100%;
}
.search-box input::placeholder { color: var(--text-soft); }
.search-box svg { flex-shrink: 0; opacity: .6; }

.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 12px; }

.nav-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #f8fbfd; padding: 18px 18px 8px;
  font-weight: 600;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 10px; padding: 10px 10px; font-size: 14px; color: var(--sidebar-text);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, var(--nav-active-1), var(--nav-active-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
}
.nav-item.active svg { opacity: 1; }

.nav-group-toggle { justify-content: space-between; }
.nav-group-toggle .chev { transition: transform .15s ease; margin-left: auto; opacity: .6; flex-shrink: 0; width: 14px; height: 14px; }
.nav-group.open .nav-group-toggle .chev { transform: rotate(90deg); }
.nav-subitems { display: none; }
.nav-group.open .nav-subitems { display: block; }
.nav-subitems .nav-item { padding-left: 44px; font-size: 13.5px; }

.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.profile-name { font-size: 13px; font-weight: 600; color: #fff; }
.profile-role { font-size: 11.5px; color: var(--text-soft); }

/* ---------- Topbar ---------- */
.topbar {
  height: 62px;
  background: var(--topbar-bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 15;
  color: #fff;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left .toggle-btn { background: none; border: none; color: #fff; opacity: .8; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2FAE60; box-shadow: 0 0 0 rgba(47,174,96,0.5); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,174,96,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(47,174,96,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,174,96,0); }
}
.topbar-left .clock { font-size: 14px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); color: #fff; position: relative;
}
.topbar-icon .badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--brand-red); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}

/* ---------- Birthday reminder card (topbar center) ---------- */
.topbar-center {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  min-width: 0;
  overflow: hidden;
}

/* Outer card — dark rounded box matching the screenshot */
.bday-card {
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 7px 16px 7px 9px;
  width: 100%;
  max-width: 700px;
  min-width: 0;
  cursor: default;
  transition: background .2s ease;
}

.bday-card:hover {
  background: rgba(0, 0, 0, 0.38);
}

/* Cake icon box */
.bday-card-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

/* Text block */
.bday-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.bday-card-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.50);
  white-space: nowrap;
}

/* Scrolling message when there are multiple employees */
.bday-card-track {
  overflow: hidden;
  min-width: 0;
}

.bday-card-inner {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  /* animation injected by JS when > 1 reminder */
}

.bday-card-inner.paused {
  animation-play-state: paused !important;
}

.bday-card-msg {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.bday-card-msg .bday-emoji {
  font-size: 14px;
}

@keyframes bdayScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 1024px) {
  .bday-card { max-width: 560px; }
}

@media (max-width: 900px) {
  .topbar-center { padding: 0 8px; }
  .bday-card { max-width: 420px; }
}

@media (max-width: 640px) {
  .topbar-center { display: none; }
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.content {
  padding: 24px;
  flex: 1;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.page-header .crumbs { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.footer-note {
  text-align: center; font-size: 12.5px; color: var(--text-muted);
  padding: 16px 24px; border-top: 1px solid var(--border);
}
.footer-note b { color: var(--brand-red); }

/* ==============================================================
   STAT CARDS
   ============================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: white;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card);
  min-width: 20px;
  min-height: 85px;
}
.stat-card .icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(206, 204, 204, 0.308);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card .label { font-size: 12.5px; opacity: .92; font-weight: 500; }
.stat-card .value { font-size: 20px; font-weight: 700; margin-top: 2px; }

.stat-card.c-teal    { background: linear-gradient(135deg, var(--card-teal), #129490); }
.stat-card.c-green   { background: linear-gradient(135deg, var(--card-green), #248f4d); }
.stat-card.c-yellow  { background: linear-gradient(135deg, var(--card-yellow), #d99420); }
.stat-card.c-pink    { background: linear-gradient(135deg, var(--card-pink), #c22b74); }
.stat-card.c-mint    { background: linear-gradient(135deg, var(--card-mint), #248f6e); }
.stat-card.c-crimson { background: linear-gradient(135deg, var(--card-crimson), #b82942); }
.stat-card.c-blue    { background: linear-gradient(135deg, var(--card-blue), #2563EB); }
.stat-card.c-orange  { background: linear-gradient(135deg, var(--card-orange), #EA580C); }
.stat-card.c-purple  { background: linear-gradient(135deg, var(--card-purple), #7C3AED); }
.stat-card.c-gold    { background: linear-gradient(135deg, var(--card-gold), #D68910); }

.stat-card .sub { font-size: 11px; opacity: .85; margin-top: 2px; }

.stat-card-clickable {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.stat-card-clickable:active { transform: translateY(0); }

/* ---------- Dashboard greeting header ---------- */
.dash-greeting h1 { font-size: 23px; font-weight: 700; }
.dash-greeting .date { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.btn-refresh { display: inline-flex; align-items: center; gap: 8px; }
.btn-refresh svg { transition: transform .4s ease; }
.btn-refresh.spinning svg { transform: rotate(360deg); }

.panel-collapse { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }

/* ---------- Team activity / expiry tables ---------- */
.table-panel-link { font-size: 12.5px; font-weight: 600; color: var(--brand-navy); display: inline-flex; align-items: center; gap: 4px; }
.days-pill { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.days-pill.urgent { background: #FDEAEA; color: var(--brand-red-dark); }
.days-pill.ok { background: #E4F7EA; color: #1D9950; }
.pill-count { background: #EEF0FF; color: var(--brand-navy); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* ==============================================================
   PANELS / CARDS
   ============================================================== */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 18px; }
.panel-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 900px) { .panel-grid-2 { grid-template-columns: 1fr; } }

.date-input {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 12.5px; color: var(--text-dark);
  background: #fff;
}

/* Fixed-size box for doughnut charts. Chart.js's responsive resize needs a parent
   with real, non-flexing dimensions — inside a flex row it can otherwise spiral
   into a tall, narrow oval instead of a circle. maintainAspectRatio:false in the
   chart options (dashboard.html) makes the canvas fill exactly this box. */
.donut-wrap { position: relative; width: 190px; height: 190px; flex-shrink: 0; }
.donut-wrap canvas { width: 100% !important; height: 100% !important; }

.chart-legend { list-style: none; margin: 14px 0 0; padding: 0; font-size: 12.5px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--text-muted); }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ==============================================================
   BUTTONS
   ============================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  transition: filter .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-red); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text-dark); }
.btn-outline:hover { border-color: var(--brand-red); color: var(--brand-red); }
.btn-navy { background: var(--brand-navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: #fff; color: var(--text-muted);
  flex-shrink: 0; cursor: pointer;
}
.btn-icon.edit:hover { color: var(--brand-green); border-color: var(--brand-green); }
.btn-icon.del:hover { color: var(--brand-red); border-color: var(--brand-red); }
.btn-icon.enquiry { color: #1A5D8A; }
.btn-icon.enquiry:hover { background: #eaf2f8; border-color: #1A5D8A; }
.btn-icon.lock { color: var(--brand-green); border-color: rgba(23,165,88,0.3); }
.btn-icon.lock:hover { filter: brightness(0.9); }
.btn-icon.lock.is-locked { background: rgba(23,165,88,0.08); }

/* ---------- Export / generic dropdown ---------- */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    cursor: pointer;
}

.export-menu {
    display: none;
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    min-width: 215px;

    background: #ffffff;
    border: 1px solid #e2e6ef;
    border-radius: 9px;

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.15);

    padding: 6px;

    z-index: 99999;
}

.export-menu.show {
    display: block;
}

.export-menu button {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 11px;

    border: none;
    background: transparent;

    padding: 10px 11px;

    border-radius: 7px;

    font-family: Inter, sans-serif;
    font-size: 13px;
    color: #26344d;

    text-align: left;
    cursor: pointer;

    transition: background 0.15s ease;
}

.export-menu button:hover {
    background: #f3f5f9;
}

.export-icon {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    font-size: 10px;
    font-weight: 700;

    flex-shrink: 0;
}

.excel-icon {
    background: #e8f7ee;
    color: #16834b;
}

.pdf-icon {
    background: #fdeaea;
    color: #d52b2b;
}

.print-icon {
    background: #eef2f7;
    color: #526174;
    font-size: 15px;
}
/* ==============================================================
   TABLES
   ============================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  table-layout: auto; min-width: 900px;
}
table.data-table th {
  text-align: left; background: #1A5D8A; color:white;
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table td {
  padding: 4px 10px; border-bottom: 1px solid var(--border); color: var(--text-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.25; font-size: 12.5px;
}
table.data-table tbody tr:hover { background: #FAFBFD; }
table.data-table .actions { display: flex; gap: 4px; align-items: center; }

/* Customer table responsive column widths */
#custTable th:nth-child(1),  #custTable td:nth-child(1)  { width: 48px;  min-width: 48px;  text-align: center; }  /* S.No */
#custTable th:nth-child(2),  #custTable td:nth-child(2)  { min-width: 140px; }                                     /* Company Name */
#custTable th:nth-child(3),  #custTable td:nth-child(3)  { min-width: 80px;  }                                     /* City */
#custTable th:nth-child(4),  #custTable td:nth-child(4)  { min-width: 100px; }                                     /* Phone */
#custTable th:nth-child(5),  #custTable td:nth-child(5)  { min-width: 120px; }                                     /* Email */
#custTable th:nth-child(6),  #custTable td:nth-child(6)  { min-width: 100px; }                                     /* Tally S.No */
#custTable th:nth-child(7),  #custTable td:nth-child(7)  { min-width: 110px; }                                     /* Accountant */
#custTable th:nth-child(8),  #custTable td:nth-child(8)  { min-width: 100px; }                                     /* Acct. Cell */
#custTable th:nth-child(9),  #custTable td:nth-child(9)  { min-width: 110px; }                                     /* Auditor */
#custTable th:nth-child(10), #custTable td:nth-child(10) { min-width: 100px; }                                     /* Aud. Cell */
#custTable th:nth-child(11), #custTable td:nth-child(11) { min-width: 100px; }                                     /* Assistant */
#custTable th:nth-child(12), #custTable td:nth-child(12) { min-width: 100px; }                                     /* Asst. Cell */
#custTable th:nth-child(13), #custTable td:nth-child(13) { min-width: 110px; }                                     /* Hardware */
#custTable th:nth-child(14), #custTable td:nth-child(14) { min-width: 100px; }                                     /* HW Cell */
#custTable th:nth-child(15), #custTable td:nth-child(15) { min-width: 90px;  }                                     /* Outstanding */
/* =========================================================
   CUSTOMER TABLE — FIXED ACTION COLUMN
   Action column always remains visible while scrolling
   ========================================================= */

/* Action column header */
#custTable th:last-child {
    position: sticky;
    right: 0;
    z-index: 20;
    min-width: 190px;
    width: 190px;
    max-width: 190px;

    background: #1A5D8A !important;
    color: #ffffff !important;

    text-align: center;
    white-space: nowrap;

    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.08);
}

/* Action column body cells */
#custTable td:last-child {
    position: sticky;
    right: 0;
    z-index: 10;

    min-width: 190px;
    width: 190px;
    max-width: 190px;

    background: #ffffff;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;

    text-align: center;

    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.06);
}

/* Keep alternating row colours working */
#custTable tbody tr:nth-child(even) td:last-child {
    background: #F0F7FC;
}

#custTable tbody tr:nth-child(odd) td:last-child {
    background: #ffffff;
}

/* Keep hover effect on the frozen Action column */
#custTable tbody tr:hover td:last-child {
    background: #D6EAF5 !important;
}

/* Keep rating/status row colours */
#custTable tr.row-good td:last-child {
    background: #F0FDF4 !important;
}

#custTable tr.row-average td:last-child {
    background: #FFFBEB !important;
}

#custTable tr.row-bad td:last-child {
    background: #FEF2F2 !important;
}

#custTable tr.row-locked td:last-child {
    background: #F1F5F9 !important;
}

/* Action buttons stay in one line */
#custTable td:last-child .actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Make sure sticky column works properly on smaller screens */
@media (max-width: 768px) {
    #custTable th:last-child,
    #custTable td:last-child {
        min-width: 190px;
        width: 190px;
        max-width: 190px;
    }
}

/* Fixed column widths so the Employees grid always fits without horizontal scrolling.
   ID / Gender / Status / Action get small fixed pixel widths (their content is short and
   predictable); Name / Phone / Email / Department / Designation share the remaining space. */
#employeesTable th:nth-child(1), #employeesTable td:nth-child(1) { width: 78px;}   /* ID */
#employeesTable th:nth-child(3), #employeesTable td:nth-child(3) { width: 78px; }   /* Gender */
#employeesTable th:nth-child(8), #employeesTable td:nth-child(8) { width: 92px; }   /* Status */
#employeesTable th:nth-child(9), #employeesTable td:nth-child(9) { width: 124px; }  /* Action */

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: #FFF3DC; color: #B4790E; }
.badge-closed  { background: #E4F7EA; color: #1D9950; }
.badge-active  { background: #E4F7EA; color: #1D9950; }
.badge-inactive{ background: #FDEAEA; color: #C22A20; }
.badge-postponed { background: #FDEDD3; color: #C4720A; }

/* ==============================================================
   REQUEST MODAL — customer autocomplete + history side panel
   ============================================================== */
.request-modal-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
@media (max-width: 800px) { .request-modal-grid { grid-template-columns: 1fr; } }

.request-form-col { display: flex; flex-direction: column; gap: 14px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dark); }

.autocomplete-wrap { position: relative; }
.autocomplete-list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); max-height: 220px; overflow-y: auto; z-index: 30;
}
.autocomplete-list.show { display: block; }
.autocomplete-item { padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #F7F8FB; }

.request-history-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 94%;
  justify-self: end;
}
.history-header {
  background: var(--card-teal); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 10px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.history-header-info { flex: 1; min-width: 0; }
.history-header-amc {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.history-header-amc.show { display: inline-flex; }
.history-table-wrap { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.history-table-wrap .mini-table th { position: sticky; top: 0; z-index: 1; }


.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }
.pagination .pages { display: flex; gap: 6px; }
.pagination .pages button {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text-dark); font-size: 12.5px;
}
.pagination .pages button.active { background: var(--brand-navy); color: #fff; border-color: var(--brand-navy); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.input-search {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; min-width: 220px; background: #fff;
}
.select-input {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13px; background: #fff; color: var(--text-dark);
}

/* ==============================================================
   GENERIC CONFIRM POPUP ("Are you sure?")
   ============================================================== */
.confirm-overlay {
  display: none;
  position: fixed; z-index: 9999; inset: 0;
  background: rgba(0, 0, 0, .45);
  align-items: center; justify-content: center;
}
.confirm-overlay.show { display: flex; }
.confirm-card {
  background: #fff; border-radius: 16px; padding: 36px 40px 28px;
  min-width: 340px; max-width: 420px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}
.confirm-icon {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid #f59e0b; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; color: #f59e0b; font-size: 28px; font-weight: 700;
}
.confirm-card h3 { font-size: 20px; font-weight: 700; color: #111827; margin: 0 0 8px; }
.confirm-card p { font-size: 14px; color: #6b7280; margin: 0 0 24px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
.confirm-btns .btn-confirm-do {
  background: #dc2626; color: #fff; border: none;
  border-radius: 8px; padding: 9px 28px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.confirm-btns .btn-confirm-do:hover { background: #b91c1c; }
.confirm-btns .btn-confirm-cancel {
  background: #4b5563; color: #fff; border: none;
  border-radius: 8px; padding: 9px 28px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.confirm-btns .btn-confirm-cancel:hover { background: #374151; }

/* ==============================================================
   MODAL
   ============================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 33, 0.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 760px;
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.modal-header {
  background: linear-gradient(135deg, #1A5D8A, #0f4e77);
  color: #fff; padding: 22px 26px; display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 22px; font-weight: 700; }
.modal-header .close-btn { background: rgba(255,255,255,0.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 16px; }
.modal-body { padding: 24px 26px; max-height: 65vh; overflow-y: auto; }
.modal-footer { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
/* Below 860px, .form-grid collapses to a single column via the
   !important rule in the RESPONSIVE section further down — that
   rule supersedes any narrower breakpoint here. */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.span-2 { grid-column: span 2; }
.form-field.span-3 { grid-column: span 3; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--text-dark); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 13.5px; font-family: var(--font-body); color: var(--text-dark);
  background: #fff;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgba(52,50,140,0.12);
}
.upload-box {
  width: 96px; height: 96px; border: 1.5px dashed var(--border); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; color: var(--text-soft);
  font-size: 11px; text-align: center; cursor: pointer; overflow: hidden;
}
.upload-box img { width: 100%; height: 100%; object-fit: cover; }

.mini-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.mini-table th { background: #F7F8FB; padding: 8px 10px; text-align: left; font-size: 11.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.mini-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.mini-table input { width: 100%; border: none; background: transparent; font-size: 13px; padding: 4px; }
.mini-table input:focus { outline: 1px solid var(--brand-navy); border-radius: 4px; }

/* ==============================================================
   LOGIN PAGE
   ============================================================== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #262f42, #12161f 70%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: 38px 34px 30px;
  text-align: center;
}
.login-card img.logo { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; }
.login-card h1 { font-size: 21px; font-weight: 700; }
.login-card p.sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 24px; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 16px; }
.login-form .form-field input { padding: 11px 12px; }
.login-form .btn-primary { width: 100%; justify-content: center; padding: 11px; font-size: 14.5px; margin-top: 6px; }
.login-error {
  background: #FDEAEA; color: var(--brand-red-dark); font-size: 12.5px;
  padding: 9px 12px; border-radius: var(--radius-sm); display: none;
}
.login-error.show { display: block; }
.login-hint { font-size: 11.5px; color: var(--text-soft); margin-top: 18px; }

/* ==============================================================
   UTIL
   ============================================================== */
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13.5px; }

/* ==============================================================
   RESPONSIVE — tablet down to small phones. Every layout piece
   (sidebar, topbar, stat cards, tables, modals, forms) degrades
   gracefully instead of overflowing the viewport.
   ============================================================== */

/* ---- Tablet: sidebar collapses to icon rail automatically ---- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* ---- Small tablet / large phone: sidebar becomes an off-canvas drawer ---- */
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 260px !important;
    max-width: 82vw;
    box-shadow: none;
  }
  .sidebar.mobile-open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,0.35); }
  .sidebar.collapsed { width: 260px; }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-section-title,
  .sidebar.collapsed .search-box,
  .sidebar.collapsed .profile-name,
  .sidebar.collapsed .profile-role,
  .sidebar.collapsed .chev { display: initial; }
  .sidebar-close-btn { display: block; }

  .main { width: 100%; }
  .content { padding: 16px; }

  .topbar { padding: 0 14px; }
  .topbar-left { gap: 8px; }
  .topbar-left .clock { display: none; }
  .topbar-right { gap: 10px; }
  .topbar-icon, .topbar-avatar { width: 32px; height: 32px; }

  .page-header h1 { font-size: 18px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 14px; min-height: auto; gap: 10px; }
  .stat-card .icon-wrap { width: 32px; height: 32px; }
  .stat-card .value { font-size: 16px; }
  .stat-card .label { font-size: 11px; }
  .stat-card .sub { font-size: 10px; }

  .panel-grid-2 { grid-template-columns: 1fr; }
  .panel-header { padding: 12px 14px; }
  .panel-body { padding: 14px; }

  .donut-wrap { width: 150px; height: 150px; }

  /* Any inline or class-based grid columns collapse to one on phones —
     !important because several pages set grid-template-columns inline. */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-field.span-2, .form-field.span-3 { grid-column: span 1 !important; }

  .modal-overlay { padding: 0; align-items: stretch; }
  .modal { max-width: 100% !important; width: 100%; height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; }

  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 4px 10px; }

  .toolbar { width: 100%; }
  .input-search { min-width: 0; width: 100%; }
}

/* ---- Phones ---- */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .panel-header .toolbar { flex-wrap: wrap; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .login-card { padding: 28px 20px 22px; }
  .donut-wrap { width: 130px; height: 130px; }
  table.data-table { min-width: 560px; } /* keeps columns legible; .table-wrap scrolls it */
}

        .sidebar::before {

            content: "";

            position: absolute;

            width: 210px;
            height: 210px;

            right: -105px;
            top: -75px;

            border-radius: 50%;

            border:
                2px solid rgba(23, 165, 136, .14);

            background:
                radial-gradient(
                    circle at 35% 35%,
                    rgba(23, 165, 136, .12),
                    transparent 68%
                );

            pointer-events: none;

            animation:
                sidebarBubbleOne 10s ease-in-out infinite;

            z-index: 0;
        }


        .sidebar::after {

            content: "";

            position: absolute;

            width: 150px;
            height: 150px;

            left: -85px;
            bottom: 100px;

            border-radius: 50%;

            border:
                1px solid rgba(108, 92, 231, .14);

            background:
                rgba(108, 92, 231, .05);

            pointer-events: none;

            animation:
                sidebarBubbleTwo 12s ease-in-out infinite;

            z-index: 0;
        }


        .sidebar > * {

            position: relative;

            z-index: 2;
        }


        @keyframes sidebarBubbleOne {

            0% {
                transform:
                    translate(0, 0)
                    rotate(0deg);
            }

            50% {
                transform:
                    translate(-18px, 25px)
                    rotate(8deg);
            }

            100% {
                transform:
                    translate(0, 0)
                    rotate(0deg);
            }
        }


        @keyframes sidebarBubbleTwo {

            0% {
                transform:
                    translate(0, 0)
                    scale(1);
            }

            50% {
                transform:
                    translate(20px, -18px)
                    scale(1.08);
            }

            100% {
                transform:
                    translate(0, 0)
                    scale(1);
            }
        }


        /* =====================================================
           SIDEBAR NAVIGATION
           ===================================================== */

        .nav-item {

            border-radius: 11px;

            transition:
                transform .22s ease,
                background .22s ease,
                box-shadow .22s ease;
        }


        .nav-item:hover {

            transform:
                translateX(3px);

            background:
                rgba(255,255,255,.075);

            box-shadow:
                0 5px 15px rgba(0,0,0,.08);
        }


        .nav-item.active {

            background:#d61b1b;
            box-shadow:
                0 8px 22px rgb(71, 3, 3);
        }


        .search-box .field {

            border-radius: 11px;

            background:
                rgba(255,255,255,.075);

            border:
                1px solid rgba(255,255,255,.09);

            transition:
                background .2s ease,
                border-color .2s ease,
                box-shadow .2s ease;
        }


        .search-box .field:focus-within {

            background:
                rgba(255,255,255,.11);

            border-color:
                rgba(108,92,231,.65);

            box-shadow:
                0 0 0 3px rgba(108,92,231,.12);
        }


        /* =====================================================
           PAGE HEADER
           ===================================================== */

        .page-header {

            margin-bottom: 20px;

            animation:
                dashboardFadeDown .6s ease both;
        }


        .dash-greeting h1 {

            font-size: 24px;

            font-weight: 800;

            letter-spacing:
                -.4px;

            color:
                #172033;
        }


        .dash-greeting .date {

            font-size: 13px;

            font-weight: 500;

            color:
                #8A94A6;

            margin-top: 4px;
        }


        .btn-refresh {

            min-height: 38px;

            border-radius: 9px;

            font-weight: 600;

            box-shadow:
                0 3px 10px rgba(31,41,55,.06);

            transition:
                transform .2s ease,
                box-shadow .2s ease;
        }


        .btn-refresh:hover {

            transform:
                translateY(-2px);

            box-shadow:
                0 7px 16px rgba(31,41,55,.10);
        }


        /* =====================================================
           KPI STAT GRID
           ===================================================== */

        .stat-grid {

            display: grid;

            grid-template-columns:
                repeat(6, minmax(0, 1fr));

            gap: 13px;

            margin-bottom: 20px;
        }


        .stat-card {

            position: relative;

            overflow: hidden;

            isolation: isolate;

            min-width: 0;

            min-height: 86px;

            padding:
                13px 14px;

            border-radius: 15px;

            box-shadow:
                0 7px 18px rgba(31,41,55,.10);

            transition:
                transform .28s cubic-bezier(.2,.8,.2,1),
                box-shadow .28s ease,
                filter .28s ease;

            animation:
                statCardEnter .65s cubic-bezier(.2,.8,.2,1) both;
        }


        .stat-card:nth-child(1) {
            animation-delay: .05s;
        }

        .stat-card:nth-child(2) {
            animation-delay: .10s;
        }

        .stat-card:nth-child(3) {
            animation-delay: .15s;
        }

        .stat-card:nth-child(4) {
            animation-delay: .20s;
        }

        .stat-card:nth-child(5) {
            animation-delay: .25s;
        }

        .stat-card:nth-child(6) {
            animation-delay: .30s;
        }


        .stat-card:hover {

            transform:
                translateY(-5px)
                scale(1.015);

            box-shadow:
                0 15px 32px rgba(31,41,55,.17);

            filter:
                brightness(1.025);
        }


        @keyframes statCardEnter {

            from {

                opacity: 0;

                transform:
                    translateY(20px)
                    scale(.96);
            }

            to {

                opacity: 1;

                transform:
                    translateY(0)
                    scale(1);
            }
        }


        .stat-card > * {

            position:
                relative;

            z-index:
                2;
        }


        .stat-card .icon-wrap {

            width: 41px;
            height: 41px;

            flex-shrink: 0;

            border-radius: 12px;

            background:
                rgba(255,255,255,.18);

            border:
                1px solid rgba(255,255,255,.17);

            box-shadow:
                inset 0 1px 0 rgba(255,255,255,.20),
                0 5px 12px rgba(0,0,0,.08);

            backdrop-filter:
                blur(5px);

            transition:
                transform .3s ease,
                background .3s ease;
        }


        .stat-card:hover .icon-wrap {

            transform:
                rotate(-5deg)
                scale(1.08);

            background:
                rgba(255,255,255,.25);
        }


        .stat-card .label {

            font-size: 11px;

            font-weight: 600;

            opacity:
                .94;

            white-space:
                nowrap;

            overflow:
                hidden;

            text-overflow:
                ellipsis;
        }


        .stat-card .value {

            font-family:
                var(--font-display);

            font-size: 22px;

            font-weight: 800;

            line-height:
                1.1;

            letter-spacing:
                -.35px;

            margin-top: 3px;

            text-shadow:
                0 1px 2px rgba(0,0,0,.08);
        }


        .stat-card .sub {

            font-size: 9.5px;

            font-weight: 600;

            margin-top: 3px;

            opacity:
                .88;
        }


        /* =====================================================
           PANELS
           ===================================================== */

        .panel {

            border-radius: 14px;

            border:
                1px solid #E2E6EE;

            box-shadow:
                0 5px 18px rgba(31,41,55,.07);

            transition:
                box-shadow .25s ease,
                transform .25s ease;
        }


        .panel:hover {

            box-shadow:
                0 9px 25px rgba(31,41,55,.09);
        }


        .panel-header {

            min-height:
                64px;

            padding:
                14px 18px;

            background:
                rgba(255,255,255,.96);
        }


        .panel-header h3 {

            font-size:
                15px;

            font-weight:
                700;

            color:
                #172033;
        }


        .panel-body {

            padding:
                18px;
        }


        /* =====================================================
           DATE INPUT
           ===================================================== */

        .date-input {

            height:
                34px;

            min-width:
                125px;

            border:
                1px solid #D9DEE8;

            border-radius:
                8px;

            padding:
                6px 10px;

            font-family:
                var(--font-body);

            font-size:
                11.5px;

            font-weight:
                600;

            color:
                #344054;

            background:
                #fff;

            transition:
                border-color .2s ease,
                box-shadow .2s ease;
        }


        .date-input:hover {

            border-color:
                #B8C0CE;
        }


        .date-input:focus {

            outline:
                none;

            border-color:
                #5140B5;

            box-shadow:
                0 0 0 3px rgba(81,64,181,.10);
        }

/* ==============================================================
   MARKETING REFERENCE — IMAGE ICON IN ACTION COLUMN
   ============================================================== */

#refTable td.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 92px;
    white-space: nowrap;
    overflow: visible;
}

#refTable th:last-child,
#refTable td:last-child {
    text-align: center;
}

/* Same bordered style as Edit/Delete */
#refTable .ref-image-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: #2F6FB0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease,
        transform .05s ease;
}

#refTable .ref-image-btn:hover {
    color: #2F6FB0;
    border-color: #2F6FB0;
    background: #F3F8FC;
}

#refTable .ref-image-btn:active {
    transform: translateY(1px);
}

#refTable .ref-image-btn svg {
    display: block;
    width: 14px;
    height: 16px;
}

#refTable .ref-image-btn.is-empty,
#refTable .ref-image-btn:disabled {
    color: #B8C0CC;
    border-color: var(--border);
    opacity: .75;
    cursor: default;
    background: #fff;
}

#refTable .ref-image-btn:disabled:hover {
    color: #B8C0CC;
    border-color: var(--border);
    background: #fff;
}


/* ==============================================================
   REFERENCE IMAGE PREVIEW MODAL
   ============================================================== */

.image-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 27, 40, 0.68);
    backdrop-filter: blur(2px);
}

.image-preview-overlay.show {
    display: flex;
}

.image-preview-modal {
    width: min(760px, 95vw);
    max-height: 92vh;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
}

.image-preview-header {
    min-height: 52px;
    padding: 10px 14px 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.image-preview-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.image-preview-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.image-preview-close:hover {
    color: var(--brand-red);
    border-color: var(--brand-red);
    background: #FFF7F6;
}

.image-preview-body {
    min-height: 300px;
    max-height: calc(92vh - 53px);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #F3F5F9;
}

.image-preview-body img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 105px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(28, 35, 49, 0.10);
}

@media (max-width: 640px) {
    .image-preview-overlay {
        padding: 12px;
    }

    .image-preview-modal {
        width: 100%;
        max-height: 94vh;
    }

    .image-preview-body {
        padding: 12px;
        max-height: calc(94vh - 53px);
    }

    .image-preview-body img {
        max-height: calc(94vh - 90px);
    }
}


/* ==============================================================
   SERVICE REQUEST — Export dropdown
   Added as page-safe overrides; existing global styles are unchanged.
   ============================================================== */
.request-page-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.request-page-actions .export-dropdown {
  position: relative;
  display: inline-block;
  z-index: 100;
}

.request-page-actions .export-btn {
  min-width: 120px;
  justify-content: center;
  background: #fff;
  color: #26344d;
  border: 1px solid #dfe4ec;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.request-page-actions .export-btn:hover {
  border-color: #c9d1de;
  color: #1A5D8A;
  background: #fff;
}

.request-page-actions .export-chevron {
  margin-left: 1px;
  transition: transform .15s ease;
}

.request-page-actions .export-btn[aria-expanded="true"] .export-chevron {
  transform: rotate(180deg);
}

.request-page-actions .export-menu {
  top: calc(100% + 7px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e6ef;
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .15);
  z-index: 99999;
}

.request-page-actions .export-menu button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  color: #26344d;
  text-align: left;
  cursor: pointer;
}

.request-page-actions .export-menu button:hover {
  background: #f3f5f9;
}

.request-page-actions .export-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex: 0 0 32px;
  font-size: 10px;
  font-weight: 700;
}

.request-page-actions .excel-icon { background: #e8f7ee; color: #16834b; }
.request-page-actions .pdf-icon { background: #fdeaea; color: #d52b2b; }
.request-page-actions .print-icon { background: #eef2f7; color: #526174; }

@media (max-width: 640px) {
  .request-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .request-page-actions .export-dropdown,
  .request-page-actions > .btn-primary {
    flex: 1 1 0;
  }

  .request-page-actions .export-btn,
  .request-page-actions > .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .request-page-actions .export-menu {
    left: 0;
    right: auto;
    width: min(220px, calc(100vw - 32px));
  }
}

@media (max-width: 400px) {
  .request-page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .request-page-actions .export-dropdown,
  .request-page-actions > .btn-primary {
    width: 100%;
    flex: none;
  }
}
/* ==============================================================
   LEADS PAGE — Export dropdown (screenshot matched)
   ============================================================== */
.export-wrap {
  position: relative;
  display: inline-block;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 120px;
  height: 40px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #dfe4ec;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #26344d;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.btn-export:hover {
  border-color: #cfd6e2;
  box-shadow: 0 3px 10px rgba(15,23,42,.08);
}

.btn-export .chevron { transition: transform .2s ease; }
.export-wrap.open .btn-export .chevron { transform: rotate(180deg); }

.export-wrap .export-menu {
  display: none;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 215px;
  min-width: 215px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e6ef;
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(15,23,42,.15);
  z-index: 99999;
}

.export-wrap.open .export-menu { display: block; }

.export-wrap .export-menu button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #26344d;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.export-wrap .export-menu button:hover { background: #f5f7fa; }
.export-wrap .export-menu button:active { background: #eef1f5; }

.export-wrap .export-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.export-wrap .excel-icon { background: #e8f7ee; color: #16834b; }
.export-wrap .pdf-icon { background: #fdeaea; color: #d52b2b; }
.export-wrap .print-icon { background: #eef2f7; color: #526174; font-size: 15px; }
