/* ============================================================
   WISE IT Support — CSS Design System
   Aligned with WISE HRMS visual identity
   Font: Inter (loaded via Google Fonts in layout.php)
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root,
[data-bs-theme=light] {
  /* Brand */
  --button-bg:        #2563eb;
  --primary:          #2563eb;
  --primary-dark:     #1d4ed8;
  --primary-light:    #eff6ff;
  --primary-ring:     rgba(37,99,235,.18);

  /* Page surfaces */
  --page-bg:          #f4f6f9;
  --surface:          #ffffff;
  --surface-raised:   #ffffff;

  /* Sidebar */
  --sidebar-bg:       #0f2744;
  --sidebar-active:   rgba(37,99,235,.22);
  --sidebar-hover:    rgba(255,255,255,.07);
  --sidebar-text:     #c8d8f0;
  --sidebar-active-text: #ffffff;
  --sidebar-width:    280px;

  /* Topbar */
  --topbar-bg:        #ffffff;
  --topbar-border:    #e2e8f0;

  /* Text */
  --text-primary:     #1e293b;
  --text-secondary:   #64748b;
  --text-heading:     #0f172a;
  --text-link:        #2563eb;

  /* Borders & shadows */
  --border:           #e2e8f0;
  --border-input:     #cbd5e1;
  --shadow-sm:        0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:        0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow-card:      0 1px 3px rgba(15,23,42,.06);
  --radius-sm:        6px;
  --radius-md:        8px;
  --radius-lg:        10px;

  /* HRMS component scale */
  --font-family:      Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs:            11px;
  --fs-sm:            12px;
  --fs-body:          13px;
  --fs-md:            14px;
  --fs-title:         15px;
  --fs-page:          16px;
  --fs-stat:          22px;
  --lh-body:          1.45;
  --header-height:    64px;
  --btn-height:       34px;
  --btn-height-sm:    28px;
  --input-height:     34px;
  --nav-height:       44px;
  --card-pad:         14px 16px;
  --page-pad:         16px 20px;
  --avatar-size:      36px;

  /* Status */
  --success:          #16a34a;
  --success-bg:       #f0fdf4;
  --success-border:   #bbf7d0;
  --warning:          #d97706;
  --warning-bg:       #fffbeb;
  --warning-border:   #fde68a;
  --danger:           #dc2626;
  --danger-bg:        #fef2f2;
  --danger-border:    #fecaca;
  --info:             #0284c7;
  --info-bg:          #f0f9ff;
  --info-border:      #bae6fd;

  /* Table */
  --table-head-bg:    #f8fafc;
  --table-head-text:  #475569;
  --table-border:     #e2e8f0;
  --table-hover:      #f8fafc;

  /* Inputs */
  --input-bg:         #ffffff;
  --input-border:     #cbd5e1;
  --input-text:       #1e293b;
  --input-placeholder:#94a3b8;
  --input-focus:      #2563eb;

  /* Chart */
  --chart-grid:       #e2e8f0;

  /* Misc */
  --muted-text:       #64748b;
  --app-bg:           #f0f4f8;
  --app-text:         #1e293b;
  --app-heading:      #0f172a;
  --card-bg:          #ffffff;
  --card-border:      #e2e8f0;
  --card-shadow:      0 1px 3px rgba(15,23,42,.06);
  --nav:              #0f2744;
  --blue:             #2563eb;

  /* Employee portal */
  --employee-ink:     #1e293b;
  --employee-muted:   #64748b;
  --employee-line:    #e2e8f0;
  --employee-soft:    #f8fafc;

  /* Login */
  --login-bg:         #f0f4f8;
  --login-card:       #ffffff;
  --login-input-border:#cbd5e1;
  --login-input-bg:   #ffffff;
  --login-text:       #1e293b;
  --login-muted:      #64748b;
  --login-border:     #e2e8f0;
  --login-overlay:    linear-gradient(rgba(255,255,255,.15),rgba(255,255,255,.15));

  /* Panel icon */
  --panel-icon-bg:    #eff6ff;

  /* Timeline */
  --timeline-line:    #e2e8f0;
  --alert-bg:         #ffffff;
}

[data-bs-theme=dark] {
  --button-bg:        #3b82f6;
  --primary:          #3b82f6;
  --primary-dark:     #2563eb;
  --primary-light:    rgba(59,130,246,.12);
  --primary-ring:     rgba(59,130,246,.25);

  --page-bg:          #0b1120;
  --surface:          #131c2e;
  --surface-raised:   #1a2540;

  --sidebar-bg:       #071628;
  --sidebar-active:   rgba(59,130,246,.22);
  --sidebar-hover:    rgba(255,255,255,.06);
  --sidebar-text:     #94afd4;
  --sidebar-active-text:#ffffff;

  --topbar-bg:        #0e1a2e;
  --topbar-border:    #1e2f4a;

  --text-primary:     #c8d8f0;
  --text-secondary:   #7a91b8;
  --text-heading:     #e2eeff;
  --text-link:        #60a5fa;

  --border:           #1e2f4a;
  --border-input:     #2a3c5e;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.3);
  --shadow-md:        0 4px 12px rgba(0,0,0,.4);
  --shadow-card:      0 1px 4px rgba(0,0,0,.35);

  --success:          #4ade80;
  --success-bg:       rgba(74,222,128,.08);
  --success-border:   rgba(74,222,128,.2);
  --warning:          #fbbf24;
  --warning-bg:       rgba(251,191,36,.08);
  --warning-border:   rgba(251,191,36,.2);
  --danger:           #f87171;
  --danger-bg:        rgba(248,113,113,.08);
  --danger-border:    rgba(248,113,113,.2);
  --info:             #38bdf8;
  --info-bg:          rgba(56,189,248,.08);
  --info-border:      rgba(56,189,248,.2);

  --table-head-bg:    #172034;
  --table-head-text:  #7a91b8;
  --table-border:     #1e2f4a;
  --table-hover:      rgba(59,130,246,.04);

  --input-bg:         #0d1625;
  --input-border:     #2a3c5e;
  --input-text:       #c8d8f0;
  --input-placeholder:#4a6080;
  --input-focus:      #3b82f6;

  --chart-grid:       #1e2f4a;
  --muted-text:       #7a91b8;
  --app-bg:           #0b1120;
  --app-text:         #c8d8f0;
  --app-heading:      #e2eeff;
  --card-bg:          #131c2e;
  --card-border:      #1e2f4a;
  --card-shadow:      0 1px 4px rgba(0,0,0,.35);
  --nav:              #071628;

  --employee-ink:     #e2eeff;
  --employee-muted:   #7a91b8;
  --employee-line:    #1e2f4a;
  --employee-soft:    #131c2e;

  --login-bg:         #0b1120;
  --login-card:       #0e1a2e;
  --login-input-border:#2a3c5e;
  --login-input-bg:   #0d1625;
  --login-text:       #c8d8f0;
  --login-muted:      #7a91b8;
  --login-border:     #1e2f4a;
  --login-overlay:    linear-gradient(rgba(7,14,30,.85),rgba(7,14,30,.85));
  --panel-icon-bg:    rgba(59,130,246,.12);
  --timeline-line:    #1e2f4a;
  --alert-bg:         #131c2e;

  --topbar-bg:        #0e1a2e;
  --table-head-bg:    #172034;
  --table-head-text:  #7a91b8;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--page-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 { color: var(--text-heading); font-weight: 600; line-height: 1.3; margin-bottom: .35rem; }
h1 { font-size: var(--fs-page); }
h2 { font-size: var(--fs-title); }
h3 { font-size: var(--fs-md); }
h4,h5,h6 { font-size: var(--fs-body); }

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Bootstrap overrides */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.card-header {
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--card-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-heading);
  font-size: var(--fs-body);
}
.text-muted { color: var(--text-secondary) !important; }
.topbar { background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border); }

/* Table */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  border-color: var(--table-border);
  font-size: var(--fs-body);
  margin-bottom: 0;
}
.table > thead {
  background: var(--table-head-bg);
  color: var(--table-head-text);
}
.table > thead th {
  padding: 8px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-color: var(--table-border);
  white-space: nowrap;
}
.table td {
  padding: 8px 12px;
  vertical-align: middle;
  border-color: var(--table-border);
  font-size: var(--fs-body);
}
.table-hover > tbody > tr:hover > td {
  background: var(--table-hover) !important;
}
#recentlyCreatedTable tbody tr.ticket-row-link > td,
#recentTicketsTable tbody tr.ticket-row-link > td,
#dashTicketTable tbody tr.ticket-row-link > td {
  cursor: pointer;
  transition: background-color .16s ease;
}
#recentlyCreatedTable tbody tr.ticket-row-link:hover > td,
#recentlyCreatedTable tbody tr.ticket-row-link:focus-visible > td,
#recentTicketsTable tbody tr.ticket-row-link:hover > td,
#recentTicketsTable tbody tr.ticket-row-link:focus-visible > td,
#dashTicketTable tbody tr.ticket-row-link:hover > td,
#dashTicketTable tbody tr.ticket-row-link:focus-visible > td {
  background: color-mix(in srgb, var(--primary) 16%, var(--card-bg));
}
#recentlyCreatedTable .assign-cell,
#recentlyCreatedTable .assign-cell select,
#recentlyCreatedTable .assign-cell .assign-status,
#recentTicketsTable .assign-cell,
#recentTicketsTable .assign-cell select,
#recentTicketsTable .assign-cell .assign-status,
#recentTicketsTable .ticket-select { cursor: default; }
#recentlyCreatedTable .assign-btn,
#recentlyCreatedTable a.btn,
#recentTicketsTable .assign-btn,
#recentTicketsTable a.btn { cursor: pointer; }

/* Form controls */
.form-control, .form-select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--input-text);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body);
  min-height: var(--input-height);
  height: var(--input-height);
  padding: 0 10px;
  line-height: 1.4;
}
textarea.form-control {
  height: auto;
  min-height: 76px;
  padding: 8px 10px;
}
.form-control::placeholder { color: var(--input-placeholder); }
.form-control:focus, .form-select:focus {
  background: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--primary-ring);
  outline: none;
}
.form-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.input-group-text {
  background: var(--table-head-bg);
  border-color: var(--input-border);
  color: var(--text-secondary);
  font-size: .82rem;
}

/* Buttons */
.btn {
  --bs-btn-font-size: var(--fs-body);
  --bs-btn-padding-y: 0;
  --bs-btn-padding-x: 12px;
  --bs-btn-border-radius: var(--radius-sm);
  --bs-btn-font-weight: 600;
  min-height: var(--btn-height);
  height: var(--btn-height);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary {
  background: var(--button-bg, var(--primary));
  border-color: var(--button-bg, var(--primary));
  font-weight: 600;
  font-size: var(--fs-body);
  border-radius: var(--radius-sm);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px var(--primary-ring);
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  font-size: var(--fs-body);
  border-radius: var(--radius-sm);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}
.btn-outline-secondary {
  --bs-btn-color: var(--text-secondary);
  --bs-btn-border-color: var(--border-input);
  --bs-btn-hover-bg: var(--table-head-bg);
  --bs-btn-hover-color: var(--text-heading);
  font-weight: 600;
  font-size: var(--fs-body);
  border-radius: var(--radius-sm);
}
.btn-sm {
  --bs-btn-font-size: var(--fs-sm);
  --bs-btn-padding-y: 0;
  --bs-btn-padding-x: 10px;
  font-size: var(--fs-sm);
  padding: 0 10px;
  min-height: var(--btn-height-sm);
  height: var(--btn-height-sm);
  border-radius: var(--radius-sm);
}
.btn-close { filter: none; }
[data-bs-theme=dark] .btn-close { filter: invert(1) brightness(200%); }

/* Alerts */
.alert {
  background: var(--alert-bg);
  border-radius: var(--radius-md);
  font-size: .84rem;
}
.alert-success  { background: var(--success-bg);  border-color: var(--success-border);  color: var(--success); }
.alert-danger   { background: var(--danger-bg);   border-color: var(--danger-border);   color: var(--danger); }
.alert-warning  { background: var(--warning-bg);  border-color: var(--warning-border);  color: var(--warning); }
.alert-info     { background: var(--info-bg);     border-color: var(--info-border);     color: var(--info); }
.alert-secondary{ background: var(--table-head-bg); border-color: var(--border); color: var(--text-secondary); }

/* Modals */
.modal-content {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.modal-header, .modal-footer { border-color: var(--card-border); padding: 12px 16px; }
.modal-title { font-size: var(--fs-title); font-weight: 600; }
.modal-body { font-size: var(--fs-body); padding: 14px 16px; }
.modal.fade .modal-dialog { transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .18s ease; }
.modal.show .modal-dialog { transform: none; }

/* Badges */
.badge { font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 1.4; }

/* Timeline */
.timeline { border-left: 2px solid var(--timeline-line); margin-left: .5rem; }
.timeline-item { position: relative; padding: 0 0 1rem 1.25rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  width: .65rem; height: .65rem;
  border-radius: 50%;
  left: -.4rem; top: .3rem;
  background: var(--primary);
}
.timeline-content b { font-size: .78rem; color: var(--text-heading); }
.timeline-content small { font-size: .66rem; display: block; margin-top: 2px; }

/* Chart */
.chart-box { position: relative; height: 300px; }
.chart-empty { display: grid; place-items: center; min-height: 220px; color: var(--text-secondary); font-size: .85rem; }

/* Metric border */
.metric { border-left: 3px solid var(--primary); }
.metric .number { font-size: var(--fs-stat); font-weight: 700; line-height: 1; color: var(--text-heading); }
.metric .small { font-size: var(--fs-sm); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-secondary); margin-bottom: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.card.stat-card { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.stat-card__icon { width: 36px; height: 36px; border-radius: 8px; flex: 0 0 36px; display: grid; place-items: center; }
.stat-card__icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-card__label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); margin-bottom: 2px; line-height: 1.2; }
.stat-card--total { border-left-color: #2563eb; color: #2563eb; }
.stat-card--new { border-left-color: #2457c5; color: #2457c5; }
.stat-card--progress { border-left-color: #d97706; color: #d97706; }
.stat-card--closed { border-left-color: #334155; color: #334155; }
.stat-card--reopened { border-left-color: #dc2626; color: #dc2626; }
.stat-card--critical { border-left-color: #dc2626; color: #dc2626; }
.stat-card .stat-card__icon { background: color-mix(in srgb, currentColor 14%, var(--card-bg)); color: inherit; }
.stat-card .stat-card__label, .stat-card .number { color: var(--text-heading); }
.stat-card .stat-card__label { color: var(--text-secondary); }
.readonly-badge {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 2px 8px; border-radius: 999px; position: relative; z-index: 2;
  border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning);
  font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.stat-card--total .stat-card__icon { color: #2563eb; }
.stat-card--new .stat-card__icon { color: #2457c5; }
.stat-card--progress .stat-card__icon { color: #d97706; }
.stat-card--closed .stat-card__icon { color: #334155; }
.stat-card--reopened .stat-card__icon { color: #dc2626; }
.stat-card--critical .stat-card__icon { color: #dc2626; }
button.stat-card { appearance: none; width: 100%; margin: 0; padding: 14px; text-align: left; font: inherit; color: inherit; background: var(--card-bg); cursor: pointer; transition: transform .2s ease-in-out, box-shadow .2s ease-in-out, background-color .2s ease-in-out; }
button.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(15, 23, 42, .16); }
button.stat-card:active { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15, 23, 42, .12); }
button.stat-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-portal button.dash-stat.stat-card { cursor: pointer; transition: transform .2s ease-in-out, box-shadow .2s ease-in-out, background-color .2s ease-in-out; }
.admin-portal button.dash-stat.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(15, 23, 42, .18); }
.admin-portal button.dash-stat.stat-card:active { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(15, 23, 42, .14); }
.admin-portal button.dash-stat.stat-card--total:hover { background: color-mix(in srgb, #2563eb 10%, var(--card-bg)); }
.admin-portal button.dash-stat.stat-card--new:hover { background: color-mix(in srgb, #2457c5 10%, var(--card-bg)); }
.admin-portal button.dash-stat.stat-card--progress:hover { background: color-mix(in srgb, #d97706 10%, var(--card-bg)); }
.admin-portal button.dash-stat.stat-card--closed:hover { background: color-mix(in srgb, #334155 10%, var(--card-bg)); }
.admin-portal button.dash-stat.stat-card--reopened:hover { background: color-mix(in srgb, #dc2626 10%, var(--card-bg)); }
.admin-portal button.dash-stat.stat-card--critical:hover { background: color-mix(in srgb, #dc2626 12%, var(--card-bg)); }
.dash-modal { position: fixed; inset: 0; z-index: 1080; }
.dash-modal[hidden] { display: none; }
.dash-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); }
.dash-modal__panel { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(1100px, calc(100% - 24px)); max-height: min(86vh, 820px); margin: 4vh auto; background: var(--card-bg); color: var(--text-heading); border: 1px solid var(--card-border); border-radius: var(--radius-md); box-shadow: 0 20px 50px rgba(0,0,0,.28); }
.dash-modal__head, .dash-modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.dash-modal__head { border-bottom: 1px solid var(--card-border); }
.dash-modal__head h4 { margin: 0; font-size: 1.05rem; }
.dash-modal__head p { margin: 2px 0 0; color: var(--text-secondary); font-size: .82rem; }
.dash-modal__x { border: 0; background: transparent; color: var(--text-heading); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.dash-modal__filters { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(120px, .7fr)); gap: 8px; padding: 12px 16px; }
.dash-modal__filters input, .dash-modal__filters select { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text-heading); padding: 7px 10px; font: inherit; font-size: .85rem; }
.dash-modal__body { overflow: auto; min-height: 160px; }
.dash-modal__foot { border-top: 1px solid var(--card-border); }
.dash-modal__foot[hidden] { display: none; }
.cat-move { display: block; margin-top: 8px; min-width: 220px; text-align: left; }
.cat-move[hidden] { display: none; }
@media (max-width: 760px) { .dash-modal__filters { grid-template-columns: 1fr 1fr; } .dash-modal__panel { margin: 12px auto; max-height: calc(100vh - 24px); } }

/* Theme switcher */
.theme-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  overflow: hidden;
}
.theme-option {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border: 0;
  background: transparent; color: var(--text-secondary);
  font-size: .8rem; font-weight: 600; cursor: pointer; transition: .18s;
}
.theme-option svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.theme-option--dark svg { fill: currentColor; stroke: none; }
.theme-option + .theme-option { border-left: 1px solid var(--border); }
.theme-option:hover { color: var(--text-heading); }
.theme-option.active, .theme-option.active:hover { background: var(--primary); color: #fff; }
.wise-loader {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(244, 246, 249, .88);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.wise-loader.is-on, html.wise-nav-loading .wise-loader { display: flex !important; opacity: 1; visibility: visible; }
[data-bs-theme=dark] .wise-loader { background: rgba(11, 17, 32, .88); }
.wise-loader__panel { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 92vw; text-align: center; }
.wise-loader__stage { perspective: 1000px; width: min(320px, 78vw); }
.wise-loader__logo { display: block; width: 100%; height: auto; transform-origin: center; transform-style: preserve-3d; backface-visibility: visible; animation: wise-spin-y 2.8s linear infinite; }
.wise-loader.is-still .wise-loader__logo { animation: none; }
.wise-loader__text { margin: 0; color: var(--text-heading); font-weight: 700; font-size: .95rem; }
.wise-loader__retry[hidden] { display: none; }
@keyframes wise-spin-y { from { transform: rotateY(0deg); } to { transform: rotateY(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .wise-loader__logo { animation: none; }
}
.theme-preview { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.theme-preview__bar { padding: 8px 12px; font-size: .75rem; font-weight: 700; }
.theme-preview__body { display: flex; min-height: 92px; }
.theme-preview__side { width: 88px; padding: 10px; font-size: .72rem; }
.theme-preview__main { flex: 1; margin: 8px; padding: 8px; border: 1px solid transparent; border-radius: 6px; }
.theme-preview__main p { margin: 4px 0 8px; font-size: .75rem; }
.theme-preview__btn { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: .72rem; font-weight: 700; }
.form-control-color { width: 42px; min-width: 42px; height: 34px; padding: 2px; }
.theme-option.active svg { stroke: #fff; }

/* ── App layout ────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  z-index: 100;
  flex-shrink: 0;
}

/* Brand / logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 6px;
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  padding: 3px;
  flex-shrink: 0;
}
.brand > span {
  color: #fff;
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--sidebar-text);
  font-weight: 500;
  text-transform: uppercase;
}

/* Sidebar user block */
.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  margin: 4px 10px 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.05);
  color: #fff;
}
.sidebar-user > span {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  font-size: var(--fs-sm); font-weight: 700; flex-shrink: 0;
}
.sidebar-user strong { display: block; font-size: var(--fs-body); font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.sidebar-user small  { display: block; font-size: 11px; color: var(--sidebar-text); margin-top: 1px; }

/* Nav links */
.sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--nav-height);
  padding: 0 14px;
  margin: 1px 10px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: var(--fs-md); font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
  transition: background .15s, color .15s;
  text-decoration: none;
  position: relative;
}
.sidebar .nav-link svg {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none; opacity: .8;
}
.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.sidebar .nav-link:hover svg { opacity: 1; }
.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.sidebar .nav-link.active svg { opacity: 1; }
.sidebar .nav-link.active::before {
  content: '';
  position: absolute; left: -8px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.sidebar .nav-link--logout { margin-top: auto; }
.sidebar .nav-link--logout:hover { background: rgba(220,38,38,.15); color: #fca5a5; }

/* Sidebar nav count badge */
.nav-count {
  margin-left: auto;
  display: grid; place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .55rem; font-weight: 800;
}

/* Employee-specific sidebar overrides */
.employee-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg) !important;
}
.employee-modern-nav { gap: 2px !important; padding: 0 0 8px; }
.employee-modern-nav .nav-link { font-size: .82rem; }

/* ── Content area ──────────────────────────────────────────── */
.content { flex: 1 1 0; min-width: 0; overflow: hidden; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px !important;
  position: relative;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  gap: 12px;
}
.topbar-start { display: flex; align-items: center; min-width: 0; }
.topbar-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; position: relative; z-index: 2; }
.topbar h2, .topbar h2.topbar-title {
  position: static; transform: none;
  margin: 0; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none; z-index: 1; text-align: left;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em;
  color: var(--text-heading); text-transform: uppercase;
}
@media (max-width: 767px) { .topbar h2.topbar-title { font-size: 14px; } }
.topbar-kicker { display: block; font-size: .6rem; font-weight: 600; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 1px; }
.topbar-action { padding: 7px 14px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: .78rem; font-weight: 600; text-decoration: none; }
.topbar-action:hover { background: var(--primary-dark); color: #fff; }

/* Employee topbar */
.employee-topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 20px !important;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.employee-page-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.employee-page-heading h1 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text-heading); letter-spacing: 0; }
.employee-page-heading p  { margin: 1px 0 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.employee-header-tools { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.employee-account { display: flex; align-items: center; gap: 8px; color: var(--text-primary); text-decoration: none; }
.employee-account strong, .employee-account small { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-account strong { font-size: var(--fs-body); font-weight: 600; color: var(--text-heading); }
.employee-account small  { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 1px; }
.employee-avatar {
  display: grid; place-items: center;
  width: var(--avatar-size); height: var(--avatar-size);
  border-radius: 50%;
  background: linear-gradient(135deg,#f0c398,#7e552f);
  color: #fff; font-size: var(--fs-sm); font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--border);
}
.employee-caret { width: 12px; height: 12px; stroke: currentColor; flex-shrink: 0; color: var(--text-secondary); }
.employee-menu { font-size: .72rem; }
.employee-theme { transform: scale(.95); transform-origin: right center; }
.employee-theme .theme-option { padding: 5px 8px; }

/* Notification button */
.notification-button {
  position: relative; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  color: var(--text-secondary); text-decoration: none; transition: background .15s;
}
.notification-button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; }
.notification-button > span {
  position: absolute; right: 1px; top: 1px;
  display: grid; place-items: center;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: .5rem; font-weight: 800;
  border: 1px solid var(--topbar-bg);
}
.notification-button:hover { background: var(--table-hover); color: var(--primary); }

/* ── Container / page wrapper ──────────────────────────────── */
.container-fluid.p-4    { padding: var(--page-pad) !important; }
.employee-content       { width: 100%; max-width: none; padding: var(--page-pad) !important; box-sizing: border-box; }
@media (min-width: 768px) {
  .dashboard-page .container-fluid.p-4,
  .dashboard-page .employee-content { padding-top: 6px !important; }
}

/* ── Responsive layout ─────────────────────────────────────── */
@media (max-width: 767px) {
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; min-height: 100vh; z-index: 200; }
  .sidebar.show { display: flex; }
  .content { width: 100%; }
  .container-fluid.p-4 { padding: 14px !important; }
  .employee-content { padding: 14px !important; }
  .employee-topbar { padding: 8px 14px; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print, .theme-switch { display: none !important; }
  .content { width: 100%; }
  .container-fluid { padding: 0 !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Login page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  margin: 0; padding: 24px;
  background: var(--login-overlay), url('../img/wise-pattern.png') center/cover no-repeat fixed;
  font-family: Inter, sans-serif; color: var(--login-text);
}
.form_container {
  width: min(100%,400px);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 40px 36px 28px;
  background: var(--login-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15,23,42,.12), 0 4px 16px rgba(15,23,42,.08);
  border: 1px solid var(--login-border);
}
.logo_container {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  background: var(--login-card);
  border: 1px solid var(--login-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.logo_container img { width: 60px; height: 60px; object-fit: contain; }
.title_container { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.title   { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--login-text); }
.subtitle{ margin: 0; max-width: 280px; font-size: .78rem; text-align: center; line-height: 1.4; color: var(--login-muted); }
.login_form { display: flex; flex-direction: column; width: 100%; gap: 14px; }
.input_container { width: 100%; position: relative; display: flex; flex-direction: column; gap: 5px; }
.icon { width: 18px; position: absolute; z-index: 1; left: 11px; bottom: 10px; color: var(--login-muted); pointer-events: none; }
.input_label { font-size: .72rem; font-weight: 600; color: var(--login-muted); }
.input_field {
  width: 100%; height: 40px; padding: 0 10px 0 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--login-input-border);
  background: var(--login-input-bg); color: var(--login-text);
  font-size: .85rem; outline: none; transition: border-color .18s, box-shadow .18s;
}
.input_field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input_field::placeholder { color: var(--input-placeholder); }
.sign-in_btn {
  width: 100%; height: 40px; border: 0;
  background: var(--primary); border-radius: var(--radius-sm);
  color: #fff; font-weight: 700; font-size: .875rem; cursor: pointer;
  transition: background .18s, transform .1s;
}
.sign-in_btn:hover { background: var(--primary-dark); }
.sign-in_btn:active { transform: translateY(1px); }
.login_alert { width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); font-size: .78rem; line-height: 1.3; background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.login_alert--warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.note { margin: 0; font-size: .72rem; color: var(--login-muted); text-align: center; }
.remember-me { display: flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--login-muted); cursor: pointer; user-select: none; }
.remember-me input { width: 15px; height: 15px; accent-color: var(--primary); }
@media (max-width: 480px) { .form_container { padding: 32px 22px 24px; } }

/* ── Priority badges ────────────────────────────────────────── */
.priority-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
}
.priority-low      { background: var(--success-bg);  color: var(--success); }
.priority-medium   { background: var(--warning-bg);  color: var(--warning); }
.priority-high     { background: rgba(234,88,12,.1);  color: #ea580c; }
.priority-critical { background: var(--danger-bg);   color: var(--danger); }

/* ── Ticket status pills ────────────────────────────────────── */
.ticket-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .66rem; font-weight: 700;
}
.ticket-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ticket-status--new          { background: #eff6ff; color: #1d4ed8; }
.ticket-status--in-progress  { background: #fffbeb; color: #b45309; }
.ticket-status--reopened     { background: var(--danger-bg);  color: var(--danger); }
.ticket-status--closed       { background: var(--table-head-bg); color: var(--text-secondary); }
.ticket-status--cancelled    { background: var(--table-head-bg); color: var(--text-secondary); }

[data-bs-theme=dark] .ticket-status--new          { background: rgba(29,78,216,.15); color: #60a5fa; }
[data-bs-theme=dark] .ticket-status--in-progress  { background: rgba(180,83,9,.12);  color: #fbbf24; }
[data-bs-theme=dark] .ticket-status--reopened     { background: rgba(220,38,38,.12); color: #f87171; }

/* ── Archived / deleted badges ──────────────────────────────── */
.archived-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--table-head-bg); color: var(--text-secondary);
  font-size: .66rem; font-weight: 700;
}
.archiving-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 7px;
  padding: 2px 7px; border-radius: 999px;
  border: 1px dashed var(--text-secondary); color: var(--text-secondary);
  font-size: .6rem; font-weight: 600;
}

/* Ticket tables use the normal row separators. Status stays on the badge. */
.ticket-table > tbody > tr > td { border-left: 0; border-right: 0; box-shadow: none; }
.ticket-table > tbody > tr:nth-child(even) > td { background: color-mix(in srgb, var(--table-head-bg) 65%, transparent); }
.ticket-table .ticket-subject { white-space: normal; overflow-wrap: anywhere; max-width: 28rem; }

/* ── Impersonation banner ───────────────────────────────────── */
.impersonation-banner {
  border-left: 4px solid var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #92400e;
  border-radius: var(--radius-md);
  font-size: .82rem;
  padding: 12px 16px !important;
}
[data-bs-theme=dark] .impersonation-banner { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.2); color: #fbbf24; }

/* ── Idle toast ─────────────────────────────────────────────── */
.idle-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 1090;
  display: flex; align-items: center; gap: 14px;
  max-width: 420px; padding: 14px 16px;
  background: var(--card-bg); border: 1px solid var(--warning-border);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.idle-toast-text { display: flex; flex-direction: column; gap: 2px; }
.idle-toast-text strong { color: var(--text-heading); font-size: .84rem; }
.idle-toast-text span   { color: var(--text-secondary); font-size: .74rem; }
.idle-toast-actions { display: flex; gap: 7px; flex-shrink: 0; }

/* ── Admin portal polish ─────────────────────────────────────── */
.admin-portal { background: var(--page-bg); }
.admin-portal #app { min-height: 100vh; }
.admin-portal .content { flex: 1 1 0; min-width: 0; overflow: hidden; }
.admin-portal .sidebar { width: var(--sidebar-width); min-width: var(--sidebar-width); }
.admin-portal .container-fluid.p-4 { width: 100%; max-width: none; box-sizing: border-box; }
.admin-portal h3 { font-size: var(--fs-page); font-weight: 600; letter-spacing: 0; }

/* Admin metric cards */
.admin-portal .metric {
  border-radius: var(--radius-md);
  padding: 12px 14px !important;
  min-height: 72px;
  border-top: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
}
.admin-portal .metric:hover { box-shadow: var(--shadow-sm); }

/* Admin table */
.admin-portal .table { font-size: .82rem; }
.admin-portal .table td a { color: var(--primary); font-weight: 600; }
.admin-portal .card-header { font-size: .875rem; }

/* Topbar title — equal side tracks keep the name on the viewport center */
.admin-portal .topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr);
  align-items: center;
  column-gap: 12px;
  padding: 0 20px !important;
}
@media (min-width: 768px) {
  .admin-portal .topbar {
    width: calc(100% + var(--sidebar-width));
    margin-left: calc(var(--sidebar-width) * -1);
    padding-right: 20px !important;
    padding-left: 20px !important;
  }
}
.admin-portal .topbar-start { grid-column: 1; justify-self: start; }
.admin-portal .topbar-tools { grid-column: 3; justify-self: end; margin-left: 0; }
.admin-portal .topbar h2.topbar-title {
  grid-column: 2;
  justify-self: center;
  flex: none;
  min-width: 0;
  margin: 0;
  max-width: 100%;
  text-align: center;
  font-size: var(--fs-page);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
}
@media (max-width: 767px) {
  .admin-portal .topbar {
    width: auto;
    margin-left: 0;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 8px;
    padding: 8px 12px !important;
  }
  .admin-portal .topbar-start { grid-column: 1; grid-row: 1; position: relative; z-index: 2; min-width: 0 !important; }
  .admin-portal .topbar h2.topbar-title {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: calc(100% - 4.5rem);
    font-size: 14px;
  }
  .admin-portal .topbar-tools {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    flex-wrap: wrap;
  }
}

/* Recently Created Tickets — more room to read, scoped to this card */
.tdv-recently-created .card-header { padding: 14px 18px; }
.tdv-recently-created .table > thead th { padding: 13px 16px; }
.tdv-recently-created .table td { padding: 14px 16px; }
.tdv-recently-created .recent-empty {
  height: 148px;
  padding: 24px 16px;
  text-align: center;
  vertical-align: middle;
  color: var(--text-secondary);
}

/* ── Employee portal ─────────────────────────────────────────── */
.employee-portal {
  background: var(--page-bg);
  --employee-blue:      var(--primary);
  --employee-blue-dark: var(--primary-dark);
  --employee-navy:      var(--sidebar-bg);
  --employee-ink:       var(--text-heading);
  --employee-muted:     var(--text-secondary);
  --employee-line:      var(--border);
  --employee-soft:      var(--table-head-bg);
}
.employee-portal #app    { min-height: 100vh; overflow: hidden; }
.employee-portal .content { flex: 1 1 0; min-width: 0; overflow: hidden; }

/* Employee sidebar */
.employee-portal .employee-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  padding: 0 !important;
  background: var(--sidebar-bg);
  box-shadow: none;
  z-index: 5;
}
.employee-portal .employee-sidebar .brand {
  gap: 10px; margin: 0; padding: 14px 16px 12px; margin-bottom: 6px;
  font-size: var(--fs-title); color: #fff;
}
.employee-portal .employee-sidebar .brand-logo {
  width: 30px; height: 30px; border: 0; border-radius: 50%; padding: 2px; background: #fff;
}
.employee-portal .employee-sidebar .brand small { font-size: 11px; letter-spacing: 1.2px; color: var(--sidebar-text); text-transform: uppercase; }
.employee-portal .employee-sidebar > .sidebar-user,
.employee-portal .employee-sidebar > .nav:not(.employee-modern-nav) { display: none !important; }
.employee-portal .employee-modern-nav { gap: 6px !important; padding: 4px 0 12px; }
.employee-portal .employee-modern-nav .nav-link {
  font-size: var(--fs-md); font-weight: 500; color: var(--sidebar-text); white-space: nowrap;
  margin: 0 12px; min-height: var(--nav-height); padding: 0 14px; border-radius: var(--radius-md);
}
.employee-portal .employee-modern-nav .nav-link svg {
  width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; fill: none; opacity: .8;
}
.employee-portal .employee-modern-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.employee-portal .employee-modern-nav .nav-link.active {
  background: var(--sidebar-active); color: #fff; font-weight: 600;
}
.employee-portal .employee-modern-nav .nav-link.active svg { opacity: 1; }

/* Employee topbar */
.employee-portal .employee-topbar {
  height: 74px; min-height: 74px; padding: 8px 20px !important;
  background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border);
}
.hris-return,
.employee-portal .hris-return {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--primary); border: 1px solid var(--primary); color: #fff;
  font-size: var(--fs-sm); font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
}
.hris-return svg,
.employee-portal .hris-return svg {
  width: 14px; height: 14px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none;
}
.hris-return:hover,
.employee-portal .hris-return:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.has-photo { position: relative; overflow: hidden; }
.has-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.tdv-person-avatar {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.admin-notif {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg);
  color: var(--text-heading); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.admin-notif:hover { color: var(--primary); border-color: var(--primary); }
.admin-notif__count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
}
@media (max-width: 900px) {
  .employee-portal .employee-topbar { height: auto; flex-wrap: wrap; row-gap: 8px; }
  .employee-portal .employee-header-tools { flex-wrap: wrap; justify-content: flex-end; }
}
.employee-portal .employee-page-heading h1 { font-size: 18px; font-weight: 600; color: var(--text-heading); margin: 0; }
.employee-portal .employee-page-heading p  { font-size: var(--fs-sm); color: var(--text-secondary); margin: 1px 0 0; }
.employee-portal .employee-account { gap: 8px; color: var(--text-primary); }
.employee-portal .employee-account strong { font-size: var(--fs-body); font-weight: 600; color: var(--text-heading); }
.employee-portal .employee-account small  { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 1px; }
.employee-portal .employee-avatar { width: var(--avatar-size); height: var(--avatar-size); font-size: var(--fs-sm); font-weight: 700; border: 2px solid var(--border); }
.employee-portal .employee-caret  { color: var(--text-secondary); }

/* Employee content */
.employee-portal .employee-content { width: 100%; max-width: none; padding: var(--page-pad) !important; box-sizing: border-box; }
.employee-portal .alert { font-size: .8rem; border-radius: var(--radius-md); }

/* ── Dashboard — user welcome hero ─────────────────────────── */
.user-welcome {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; overflow: hidden;
  margin-bottom: 12px; padding: 14px 16px; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: linear-gradient(105deg, var(--primary-light) 0%, #dbeafe 55%, #e0f2fe 100%);
  box-shadow: var(--shadow-sm);
}
[data-bs-theme=dark] .user-welcome { background: linear-gradient(105deg,rgba(37,99,235,.1) 0%, rgba(37,99,235,.07) 100%); border-color: rgba(37,99,235,.2); }
.user-welcome::after { content: ''; position: absolute; right: 38%; bottom: -40px; width: 160px; height: 80px; border-radius: 50%; border: 18px solid rgba(255,255,255,.3); pointer-events: none; }
.user-welcome__copy { z-index: 1; }
.user-welcome__greeting { font-size: var(--fs-page); font-weight: 600; letter-spacing: 0; color: var(--text-heading); margin: 0 0 2px; line-height: 1.2; }
.user-welcome__copy h2 { font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); margin: 0; }
.user-welcome__art { width: 170px; height: auto; z-index: 1; flex-shrink: 0; color: var(--primary); }
.user-welcome__art svg { display: block; width: 100%; height: auto; }

/* Stat grid */
.user-stat-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  margin-bottom: 14px;
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.user-stat {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 12px 14px; border-right: 1px solid var(--card-border);
}
.user-stat:last-child { border-right: 0; }
.user-stat__icon {
  display: grid; place-items: center;
  flex: 0 0 36px; width: 36px; height: 36px;
  border-radius: var(--radius-sm); color: #fff;
}
.user-stat__icon svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-stat--open     .user-stat__icon { background: var(--primary); }
.user-stat--pending  .user-stat__icon { background: var(--warning); }
.user-stat--progress .user-stat__icon { background: #6366f1; }
.user-stat--closed .user-stat__icon { background: #334155; }
.ticket-history-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ticket-history-tabs a { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; font-size: .78rem; font-weight: 700; background: var(--surface); }
.ticket-history-tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.user-stat strong { display: block; font-size: var(--fs-stat); line-height: 1; font-weight: 700; color: var(--text-heading); }
.user-stat div > span { display: block; margin-top: 4px; font-size: .68rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.user-stat small { display: block; margin-top: 2px; font-size: .6rem; color: var(--text-secondary); }
@media (max-width: 720px) {
  .user-stat-grid { grid-template-columns: 1fr; }
  .user-stat { border-right: 0; border-bottom: 1px solid var(--card-border); }
  .user-stat:last-child { border-bottom: 0; }
}

/* Create ticket CTA banner */
.create-ticket-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: var(--radius-md); margin: 0 0 16px;
  background: var(--primary);
  color: #fff; font-size: .82rem; font-weight: 700; text-decoration: none;
  box-shadow: 0 4px 14px var(--primary-ring); transition: filter .18s, transform .15s;
}
.create-ticket-banner:hover { filter: brightness(1.06); color: #fff; transform: translateY(-1px); text-decoration: none; }

/* User panel (recent tickets on employee dashboard) */
.user-panel {
  overflow: hidden; border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-card);
}
.user-panel__heading {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px 10px; border-bottom: 1px solid var(--card-border);
}
.user-panel__heading h2 { margin: 0; font-size: .88rem; font-weight: 700; color: var(--text-heading); }
.user-panel__heading a  { color: var(--primary); font-size: .68rem; font-weight: 600; text-decoration: none; }
.user-panel__heading a:hover { text-decoration: underline; }
.user-ticket-table { font-size: .76rem; }
.user-ticket-table > thead th { padding: 9px 14px; background: var(--table-head-bg); color: var(--table-head-text); font-size: .66rem; }
.user-ticket-table td { padding: 10px 14px; color: var(--text-primary); }
.user-ticket-table td:first-child a { color: var(--primary); font-weight: 700; text-decoration: none; }
.user-ticket-table tbody tr:hover { background: var(--table-hover); }
.user-empty-state { padding: 28px !important; text-align: center; color: var(--text-secondary); font-size: .8rem; }
.user-empty-state a { color: var(--primary); font-weight: 600; }

/* Ticket list (my tickets page) */
.ticket-filter-bar {
  display: flex; gap: 8px; margin: 0 0 14px; padding: 12px;
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-card);
}
.ticket-filter-bar select, .ticket-filter-bar input {
  height: 33px; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--input-text); font-size: .76rem; outline: 0;
}
.ticket-filter-bar select { min-width: 110px; padding: 0 24px 0 9px; }
.ticket-search { position: relative; flex: 1; min-width: 150px; }
.ticket-search svg { position: absolute; left: 9px; top: 9px; width: 13px; height: 13px; stroke: var(--text-secondary); stroke-width: 1.8; }
.ticket-search input { width: 100%; padding: 0 8px 0 28px; }
.ticket-filter-button { height: 33px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; border: 0; cursor: pointer; }
.ticket-filter-button:hover { background: var(--primary-dark); }
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-list-item {
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 14px;
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ticket-list-item:hover { border-color: var(--primary); box-shadow: 0 4px 14px var(--primary-ring); transform: translateY(-1px); }
.ticket-list-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); }
.ticket-list-icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; }
.ticket-list-main { min-width: 0; flex: 1; }
.ticket-list-id { display: inline-block; margin-bottom: 1px; color: var(--primary); font-size: .72rem; font-weight: 700; text-decoration: none; }
.ticket-list-main h2 { margin: 0; font-size: .8rem; font-weight: 700; color: var(--text-heading); overflow-wrap: anywhere; }
.ticket-list-main p  { display: flex; align-items: center; gap: 5px; margin: 3px 0 0; color: var(--text-secondary); font-size: .68rem; }
.ticket-list-status { display: flex; flex: 0 0 auto; flex-direction: column; gap: 5px; align-items: flex-end; }
.ticket-list-status small { color: var(--text-secondary); font-size: .6rem; }
.ticket-view-button { padding: 5px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-input); color: var(--primary); font-size: .68rem; font-weight: 600; text-decoration: none; transition: all .15s; }
.ticket-view-button:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.ticket-list-empty { border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--card-bg); }
.meta-dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--border-input); margin: 0 2px; vertical-align: middle; }

/* ── Create ticket page ─────────────────────────────────────── */
.create-ticket-page { max-width: none; }
.new-ticket-grid { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 18px; align-items: start; }
.new-ticket-main { padding: 2px 0; }
.new-ticket-field { margin-bottom: 14px; }
.new-ticket-field > label, .new-ticket-priority legend {
  display: block; margin: 0 0 4px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-heading);
}
.new-ticket-field b { color: var(--danger); }
.new-ticket-field em { margin-left: 3px; color: var(--text-secondary); font-size: .66rem; font-style: normal; }
.new-ticket-field select, .new-ticket-field input, .new-ticket-field textarea {
  width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--input-text); font-size: var(--fs-body); outline: 0;
  transition: border-color .18s, box-shadow .18s;
}
.new-ticket-field select, .new-ticket-field input { height: var(--input-height); padding: 0 10px; }
.new-ticket-field textarea { min-height: 108px; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.new-ticket-field select:focus, .new-ticket-field input:focus, .new-ticket-field textarea:focus {
  border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--primary-ring);
}
.new-ticket-field--description small { display: block; margin-top: 5px; text-align: right; color: var(--text-secondary); font-size: .66rem; }
.new-ticket-priority { margin: 0 0 14px; padding: 0; border: 0; }
.new-ticket-priority > div { display: flex; flex-wrap: wrap; gap: 12px; }
.new-ticket-priority label {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-heading); font-size: .84rem; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.new-ticket-priority label:hover {
  transform: scale(1.05);
  border-color: var(--text-secondary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
  z-index: 1;
}
.new-ticket-priority label:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.new-ticket-priority label:has(input:checked) { border-width: 2px; padding: 7px 13px; }
.new-ticket-priority label.pri-low:has(input:checked) { background: #dcfce7; border-color: #16a34a; color: #14532d; }
.new-ticket-priority label.pri-medium:has(input:checked) { background: #dbeafe; border-color: #2563eb; color: #1e3a8a; }
.new-ticket-priority label.pri-high:has(input:checked) { background: #fef3c7; border-color: #d97706; color: #78350f; }
.new-ticket-priority label.pri-critical:has(input:checked) { background: #fee2e2; border-color: #dc2626; color: #7f1d1d; }
[data-bs-theme=dark] .new-ticket-priority label.pri-low:has(input:checked) { background: #14532d; color: #dcfce7; }
[data-bs-theme=dark] .new-ticket-priority label.pri-medium:has(input:checked) { background: #1e3a8a; color: #dbeafe; }
[data-bs-theme=dark] .new-ticket-priority label.pri-high:has(input:checked) { background: #78350f; color: #fef3c7; }
[data-bs-theme=dark] .new-ticket-priority label.pri-critical:has(input:checked) { background: #7f1d1d; color: #fee2e2; }
.new-ticket-priority label:has(input:checked)::after { content: '✓'; font-size: .75rem; }
.new-ticket-priority input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.new-ticket-empty { margin: 0; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--surface); }
.pri-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.new-file-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 90px; padding: 14px; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--input-border); border-radius: var(--radius-md);
  background: var(--input-bg); color: var(--text-secondary);
  transition: border-color .18s, background .18s;
}
.new-file-drop:hover, .new-file-drop.is-drag-over { border-color: var(--primary); background: var(--primary-light); }
.new-file-drop svg { width: 24px; height: 24px; margin-bottom: 6px; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.new-file-drop strong { font-size: .8rem; color: var(--text-heading); font-weight: 600; }
.new-file-drop span   { font-size: .7rem; margin-top: 3px; }
.new-ticket-aside { display: flex; flex-direction: column; gap: 10px; }
.ticket-help-card { padding: 14px; border-radius: var(--radius-md); border: 1px solid transparent; }
.ticket-help-card h2 { display: flex; align-items: center; gap: 7px; margin: 0 0 9px; font-size: .78rem; font-weight: 700; }
.ticket-help-card h2 span { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: .6rem; font-weight: 800; }
.ticket-help-card p  { margin: 0; font-size: .72rem; line-height: 1.55; }
.ticket-help-card ul { display: flex; flex-direction: column; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; font-size: .7rem; }
.ticket-help-card li::before { display: inline-grid; place-items: center; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; background: var(--success); color: #fff; font-size: .5rem; content: '✓'; }
.ticket-help-card--info { background: var(--info-bg); border-color: var(--info-border); }
.ticket-help-card--info h2 { color: var(--info); }
.ticket-help-card--info h2 span { background: var(--info); color: #fff; }
.ticket-help-card--urgent { background: var(--danger-bg); border-color: var(--danger-border); }
.ticket-help-card--urgent h2 { color: var(--danger); }
.ticket-help-card--urgent h2 span { background: var(--danger); color: #fff; }
.ticket-help-card--urgent p { color: #9f1239; }
.ticket-help-card--urgent strong { color: var(--danger); }
.ticket-requester {
  display: flex; align-items: center; gap: 9px; padding: 11px;
  border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--card-bg);
}
.ticket-requester > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: .64rem; font-weight: 800; }
.ticket-requester strong, .ticket-requester small { display: block; }
.ticket-requester strong { color: var(--text-heading); font-size: .74rem; font-weight: 600; }
.ticket-requester small  { margin-top: 2px; color: var(--text-secondary); font-size: .64rem; }
.new-ticket-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.new-ticket-actions .btn { min-width: 80px; padding: 0 14px; border-radius: var(--radius-sm); font-size: var(--fs-body); font-weight: 600; }
.submit-ticket {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary); color: #fff; border: 0;
  border-radius: var(--radius-sm); font-size: .82rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 10px var(--primary-ring);
}
.submit-ticket:hover { background: var(--primary-dark); color: #fff; }
.submit-ticket svg { stroke: currentColor; width: 14px; height: 14px; }
@media (max-width: 900px) { .new-ticket-grid { grid-template-columns: 1fr; } .new-ticket-aside { display: grid; grid-template-columns: repeat(2,1fr); } .ticket-requester { grid-column: 1/-1; } }
@media (max-width: 767px) { .new-ticket-priority > div { gap: 10px; flex-wrap: wrap; } }

/* ── Attachment grid (ticket detail) ───────────────────────── */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 9px; }
.attach-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); text-decoration: none; color: var(--text-primary);
  transition: border-color .15s, background .15s;
}
.attach-item:hover { border-color: var(--primary); background: var(--primary-light); color: var(--text-heading); text-decoration: none; }
.attach-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); }
.attach-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.attach-info strong { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-info small  { font-size: .68rem; color: var(--text-secondary); }
.attach-item--image { width: 100%; text-align: left; cursor: zoom-in; }
.attach-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.attachment-lightbox-img { max-width: 100%; max-height: 75vh; object-fit: contain; }

/* File preview */
.file-preview { /* legacy single-file preview — kept for compatibility */ }

/* Multi-file list */
.ct-file-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ct-file-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  border: 1px solid var(--card-border); border-radius: var(--radius-sm);
  background: var(--card-bg); font-size: .8rem; min-width: 0;
}
.ct-file-icon { font-size: 1.05rem; flex-shrink: 0; }
.ct-file-info  { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ct-file-name  { font-weight: 600; color: var(--text-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-file-meta  { font-size: .68rem; color: var(--text-secondary); }
.ct-file-remove {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--text-secondary);
  cursor: pointer; font-size: .9rem; line-height: 1; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.ct-file-remove:hover { background: var(--danger-bg); color: var(--danger); }
.ct-file-error { margin: 5px 0 0; font-size: .76rem; color: var(--danger); min-height: 16px; }

/* ── Ticket view — tdv-* classes ────────────────────────────── */
.tdv-wrap { width: 100%; max-width: none; }

.tdv-page-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px solid var(--card-border); margin-bottom: 20px;
  flex-wrap: wrap;
}
.tdv-page-header__left { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.tdv-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: .78rem; font-weight: 600; text-decoration: none; transition: color .15s;
}
.tdv-back-link:hover { color: var(--primary); text-decoration: none; }
.tdv-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 3px; }
.tdv-ticket-no {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary); font-size: .72rem; font-weight: 700; letter-spacing: .03em;
}
.tdv-subject { font-size: 18px; font-weight: 600; color: var(--text-heading); letter-spacing: 0; line-height: 1.3; margin: 0; }
.tdv-badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.tdv-page-header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-top: 3px; }

.tdv-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.tdv-card:last-child { margin-bottom: 0; }
.tdv-section__title {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); font-weight: 600; color: var(--text-heading);
  margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--card-border);
}
.tdv-section__title svg { stroke: var(--primary); flex-shrink: 0; }
.tdv-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary); font-size: .6rem; font-weight: 800;
}

/* Ticket Details meta grid */
.tdv-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 0;
}
.tdv-meta-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--card-border);
}
.tdv-meta-item:nth-last-child(-n+2) { border-bottom: 0; }
.tdv-meta-item dt { font-size: .62rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.tdv-meta-item dd { font-size: .84rem; font-weight: 600; color: var(--text-primary); margin: 0; word-break: break-word; }
.tdv-asset-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--table-head-bg); color: var(--text-secondary); font-size: .72rem; font-weight: 600;
}

/* IT Management form */
.tdv-mgmt-form { display: flex; flex-direction: column; gap: 13px; }
.tdv-mgmt-row  { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.tdv-field     { display: flex; flex-direction: column; gap: 5px; }
.tdv-field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
.tdv-field-req  { color: var(--danger); }
.tdv-field-hint { font-size: .62rem; font-weight: 400; color: var(--text-secondary); text-transform: none; letter-spacing: 0; margin-left: 5px; font-style: italic; }
.tdv-field select, .tdv-field textarea {
  width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--input-text); font-size: .84rem; padding: 8px 10px;
  outline: 0; transition: border-color .18s, box-shadow .18s; font-family: inherit;
}
.tdv-field select { height: var(--input-height); padding: 0 10px; }
.tdv-field select:focus, .tdv-field textarea:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--primary-ring); }
.tdv-field textarea { resize: vertical; line-height: 1.5; min-height: 76px; }

.tdv-save-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--btn-height); padding: 0 14px; border-radius: var(--radius-sm); border: 0;
  background: var(--primary); color: #fff; font-size: var(--fs-body); font-weight: 600;
  box-shadow: none; cursor: pointer; transition: filter .18s;
}
.tdv-save-btn:hover { filter: brightness(1.06); box-shadow: 0 5px 14px var(--primary-ring); }
.tdv-save-btn svg  { stroke: currentColor; flex-shrink: 0; }
.tdv-mgmt-footer   { display: flex; justify-content: flex-end; padding-top: 2px; }

/* Unified submit button */
.tdv-unified-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--btn-height); padding: 0 16px; border-radius: var(--radius-sm); border: 0;
  background: var(--primary); color: #fff; font-size: var(--fs-body); font-weight: 600; letter-spacing: 0;
  box-shadow: none; cursor: pointer;
  transition: filter .18s, box-shadow .18s; margin-top: 12px;
}
.tdv-unified-btn:hover    { filter: brightness(1.06); box-shadow: 0 6px 18px var(--primary-ring); }
.tdv-unified-btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.tdv-unified-btn svg { stroke: currentColor; flex-shrink: 0; }

/* Description */
.tdv-description { font-size: .88rem; line-height: 1.78; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.tdv-attachments { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--card-border); }
.tdv-attachments__label { display: flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 9px; }

/* Resolution read-only box */
.tdv-resolution-box {
  margin-top: 18px; padding: 14px 16px;
  border-left: 3px solid var(--success); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--success-bg); border-top: 1px solid var(--success-border);
  border-right: 1px solid var(--success-border); border-bottom: 1px solid var(--success-border);
}
.tdv-resolution-box__title { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.tdv-resolution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.tdv-res-item { display: flex; flex-direction: column; gap: 3px; }
.tdv-res-item--full { grid-column: 1/-1; }
.tdv-res-item dt { font-size: .62rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.tdv-res-item dd { font-size: .84rem; line-height: 1.65; color: var(--text-primary); margin: 0; }

/* Comments */
.tdv-comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.tdv-empty    { font-size: .84rem; color: var(--text-secondary); margin-bottom: 14px; }
.tdv-comment  { display: flex; gap: 11px; align-items: flex-start; }
.tdv-comment__avatar {
  display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
  border-radius: 50%; font-size: .8rem; font-weight: 800; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg,var(--primary),#60a5fa);
}
.tdv-comment--admin .tdv-comment__avatar { background: linear-gradient(135deg,#f76707,#ff9249); }
.tdv-comment__body { flex: 1; min-width: 0; }
.tdv-comment__head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 5px; }
.tdv-comment__head strong { font-size: .84rem; font-weight: 700; color: var(--text-heading); }
.tdv-comment__time { font-size: .68rem; color: var(--text-secondary); margin-left: auto; }
.tdv-comment__role { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .6rem; font-weight: 700; }
.tdv-comment__role--admin    { background: var(--primary-light); color: var(--primary); }
.tdv-comment__role--employee { background: var(--table-head-bg); color: var(--text-secondary); }
.tdv-comment__text { font-size: .84rem; line-height: 1.7; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }

/* Reply form */
.tdv-reply-form { border-top: 1px solid var(--card-border); padding-top: 16px; margin-top: 4px; }
.tdv-reply-form__textarea {
  width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--input-text);
  font-size: .84rem; line-height: 1.6; padding: 10px 12px;
  resize: vertical; min-height: 88px; outline: 0; font-family: inherit;
  transition: border-color .18s, box-shadow .18s;
}
.tdv-reply-form__textarea:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--primary-ring); }
.tdv-reply-form__bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.tdv-attach-label {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text-secondary); font-size: .74rem; font-weight: 600; transition: .15s;
}
.tdv-attach-label:hover { border-color: var(--primary); color: var(--primary); }
.tdv-attach-label input { display: none; }
.tdv-attach-label svg { stroke: currentColor; }
.tdv-send-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm); border: 0;
  background: var(--primary); color: #fff; font-size: .82rem; font-weight: 700;
  box-shadow: 0 3px 10px var(--primary-ring); cursor: pointer; transition: filter .18s;
}
.tdv-send-btn:hover { filter: brightness(1.06); }
/* Timeline section */
.tdv-timeline-section .tdv-section__title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; cursor: pointer; }
.tdv-collapse-icon { transition: transform .2s; flex-shrink: 0; }
.tdv-section__title[aria-expanded=true] .tdv-collapse-icon { transform: rotate(180deg); }
.tdv-timeline { display: flex; flex-direction: column; padding: 14px 0 0 16px; border-left: 2px solid var(--timeline-line); margin-top: 12px; }
.tdv-tl-item  { position: relative; padding: 0 0 12px 13px; }
.tdv-tl-item:last-child { padding-bottom: 0; }
.tdv-tl-dot {
  position: absolute; left: -19px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--card-border);
}
.tdv-tl-body strong { display: block; font-size: .78rem; font-weight: 700; color: var(--text-heading); margin-bottom: 1px; }
.tdv-tl-change { font-size: .72rem; color: var(--text-secondary); display: block; margin-bottom: 2px; }
.tdv-tl-change b { color: var(--text-heading); }
.tdv-tl-body time { display: block; font-size: .66rem; color: var(--text-secondary); }
.tdv-tl-note { margin-top: 4px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--table-head-bg); font-size: .72rem; color: var(--text-primary); line-height: 1.5; }

/* Responsive tdv */
@media (max-width: 768px) {
  .tdv-mgmt-row { grid-template-columns: 1fr 1fr; }
  .tdv-meta-grid { grid-template-columns: 1fr 1fr; }
  .tdv-resolution-grid { grid-template-columns: 1fr; }
  .tdv-subject { font-size: 1.2rem; }
  .tdv-card { padding: 16px; }
  .tdv-unified-btn { justify-content: center; }
}
@media (max-width: 480px) {
  .tdv-mgmt-row { grid-template-columns: 1fr; }
  .tdv-meta-grid { grid-template-columns: 1fr; }
  .tdv-meta-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--card-border); }
  .tdv-meta-item:last-child { border-bottom: 0; }
  .tdv-reply-form__bar { flex-direction: column; align-items: stretch; }
  .tdv-send-btn { justify-content: center; }
}

/* ── Ticket archive/lifecycle pages ─────────────────────────── */
.life-page { max-width: none; }
.life-hero {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; padding: 20px 22px;
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-card);
}
.life-hero h1 { margin: 0; font-size: var(--fs-page); font-weight: 600; color: var(--text-heading); }
.life-hero p  { margin: 4px 0 0; font-size: var(--fs-body); color: var(--text-secondary); }
.life-stat {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  min-width: 110px; padding: 11px 15px; border-radius: var(--radius-md);
  background: var(--table-head-bg); border: 1px solid var(--card-border);
}
.life-stat strong { font-size: var(--fs-stat); line-height: 1; color: var(--text-heading); font-weight: 700; }
.life-stat span   { margin-top: 2px; font-size: .7rem; color: var(--text-secondary); }
.life-pipe { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.life-pipe__step { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: var(--table-head-bg); font-size: .76rem; }
.life-pipe__step.is-active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.life-pipe__dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--border); color: var(--text-secondary); font-size: .62rem; font-weight: 700; flex-shrink: 0; }
.life-pipe__step.is-active .life-pipe__dot { background: var(--primary); color: #fff; }
.life-pipe__arrow svg { stroke: var(--text-secondary); width: 14px; height: 14px; }
.life-btn         { padding: 5px 11px; border-radius: var(--radius-sm); font-size: .74rem; font-weight: 600; border: 1px solid var(--border-input); cursor: pointer; transition: .15s; background: var(--card-bg); color: var(--text-secondary); }
.life-btn:hover   { background: var(--primary); color: #fff; border-color: var(--primary); }
.life-btn--archive{ color: var(--warning); border-color: var(--warning-border); }
.life-btn--restore{ color: var(--success); border-color: var(--success-border); }
.life-btn--delete { color: var(--danger);  border-color: var(--danger-border); }
.archived-row td  { color: var(--text-secondary); }
.archived-notice  { background: var(--table-head-bg); border: 1px solid var(--card-border); border-radius: var(--radius-sm); color: var(--text-secondary); }
.archive-form     { display: inline-block; }

/* ── Profile page ───────────────────────────────────────────── */
.profile-page { width: 100%; max-width: none; }
.profile-card, .profile-summary {
  border: 1px solid var(--card-border); border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-card);
}
.profile-summary { display: flex; flex-direction: column; align-items: center; padding: 22px 14px; text-align: center; }
.profile-summary > span { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 9px; border-radius: 50%; background: linear-gradient(135deg,#f0c398,#815532); color: #fff; font-size: 1.1rem; font-weight: 800; }
.profile-summary h2 { margin: 0; font-size: .84rem; font-weight: 700; color: var(--text-heading); }
.profile-summary p  { margin: 3px 0 1px; font-size: .7rem; color: var(--text-secondary); }
.profile-summary small { color: var(--primary); font-size: .66rem; font-weight: 600; }
.profile-card    { padding: 16px; }
.profile-card h2 { margin: 0 0 12px; font-size: .84rem; font-weight: 700; color: var(--text-heading); }
.profile-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.profile-form-grid label { display: block; margin-bottom: 4px; font-size: .7rem; font-weight: 600; color: var(--text-heading); }
.profile-form-grid .form-control { min-height: 33px; padding: 5px 9px; font-size: .8rem; }
.profile-card .btn { margin-top: 12px; padding: 7px 14px; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; }
.profile-avatar-wrap { display: flex; justify-content: center; }
.profile-avatar-big {
  width: 70px; height: 70px; border-radius: 50%;
  background: linear-gradient(135deg,#f0c398,#e6a06d,#815532);
  color: #fff; font-size: 1.45rem; font-weight: 800;
  display: grid; place-items: center;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--border), 0 8px 20px rgba(129,85,50,.18);
}
.profile-info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 20px; margin: 0; }
.profile-info-grid > div { min-width: 0; }
.profile-info-grid dt { font-size: .62rem; font-weight: 700; color: var(--text-secondary); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 3px; }
.profile-info-grid dd { font-size: .84rem; font-weight: 600; color: var(--text-heading); margin: 0; word-break: break-word; }
.employee-portal .profile-card  { background: var(--card-bg); border-color: var(--card-border); }
.employee-portal .profile-page .card { border-radius: var(--radius-md); border-color: var(--card-border); background: var(--card-bg); box-shadow: var(--shadow-card); }
.employee-portal .profile-page .card .form-label    { font-size: .72rem; font-weight: 700; color: var(--text-heading); margin: 0 0 5px; }
.employee-portal .profile-page .card .form-control  { min-height: 35px; border-color: var(--input-border); font-size: .84rem; }
.employee-portal .profile-page .card .form-control:focus { border-color: var(--input-focus); box-shadow: 0 0 0 3px var(--primary-ring); }
.employee-portal .profile-page .card .btn           { border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600; padding: 7px 14px; }
@media (max-width: 600px) { .profile-page { grid-template-columns: 1fr; } .profile-form-grid { grid-template-columns: 1fr; } .profile-info-grid { grid-template-columns: 1fr; } }

/* ── Notifications page ─────────────────────────────────────── */
.notifications-page { width: 100%; max-width: none; }
.notification-list  { display: flex; flex-direction: column; gap: 7px; }
.notification-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px;
  border-radius: var(--radius-md); border: 1px solid var(--card-border);
  background: var(--card-bg); color: inherit; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, transform .15s;
}
.notification-item:hover { border-color: var(--primary); background: var(--primary-light); text-decoration: none; color: inherit; transform: translateY(-1px); }
.notification-item--unread { background: var(--primary-light); border-color: var(--border-input); }
.notification-icon  { width: 34px; height: 34px; border-radius: var(--radius-sm); flex: 0 0 34px; display: grid; place-items: center; }
.notification-body  { flex: 1; min-width: 0; }
.notification-head  { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.notification-head strong  { font-size: .8rem; font-weight: 700; color: var(--text-heading); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; animation: pulse-notif 1.8s ease-in-out infinite; }
@keyframes pulse-notif { 0%,100%{opacity:.6;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
.notification-ticket { display: inline-block; margin: 0 0 3px; font-size: .62rem; font-weight: 700; color: var(--primary); letter-spacing: .02em; }
.notification-body p     { font-size: .8rem; line-height: 1.5; color: var(--text-primary); margin: 0 0 4px; }
.notification-body small { font-size: .66rem; color: var(--text-secondary); }

/* ── Dashboard tables ───────────────────────────────────────── */
.tdv-recently-created { border-radius: var(--radius-md); }
.tdv-recently-created .card-header { font-size: .875rem; }
.tdv-recently-created .badge.bg-danger { font-size: .68rem; padding: 3px 9px; border-radius: 999px; }

/* ── Inline assign widget ───────────────────────────────────── */
.assign-cell     { white-space: nowrap; min-width: 195px; }
.assign-widget   { display: flex; align-items: center; gap: 5px; }
.assign-widget .assign-select  { font-size: .76rem; height: 30px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--input-border); background: var(--input-bg); color: var(--input-text); }
.assign-widget .assign-btn     { flex-shrink: 0; padding: 4px 9px; font-size: .74rem; border-radius: var(--radius-sm); }
.assign-status   { font-size: .7rem; min-width: 16px; display: inline-block; }
@media (max-width: 768px) { .assign-cell { min-width: 150px; } .assign-widget .assign-select { min-width: 90px !important; } }

/* ── Ticket success / updated modals ───────────────────────── */
.ts-check { display: grid; place-items: center; width: 50px; height: 50px; margin: 2px auto 12px; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 1.4rem; font-weight: 800; }
.tu-check { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--success-bg); color: var(--success); box-shadow: 0 4px 14px rgba(22,163,74,.18); }
#ticketUpdatedModal .modal-dialog.modal-md { --bs-modal-width: 480px; }
#ticketUpdatedModal .modal-content  { border-radius: var(--radius-lg) !important; overflow: hidden; }
#ticketUpdatedModal .modal-header .modal-title { font-size: .9rem; font-weight: 800; }
#ticketUpdatedModal .modal-footer   { background: var(--table-head-bg); padding-top: 12px; padding-bottom: 12px; }

/* ── Ticket-detail compact sidebar cards (if legacy) ───────── */
.ticket-page           { max-width: none; }
.ticket-sidebar-compact{ border-radius: var(--radius-md); }
.ticket-sidebar-compact h6 { font-size: .78rem; font-weight: 700; }
.ticket-sidebar-compact .form-control,
.ticket-sidebar-compact .form-select { min-height: 30px; font-size: .78rem; border-radius: var(--radius-sm); }
.ticket-sidebar-compact .btn.btn-sm { padding: 4px 9px; font-size: .74rem; min-height: 28px; }

/* Comment cards */
.comment-card { border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 11px 14px; background: var(--card-bg); }
.comment-card.comment-admin { border-color: var(--border-input); background: var(--primary-light); }
.comment-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),#60a5fa); color: #fff; font-size: .74rem; font-weight: 800; flex: 0 0 32px; }
.comment-admin .comment-avatar { background: linear-gradient(135deg,#f76707,#ff9249); }
.comment-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; flex-wrap: wrap; }
.comment-head b     { font-size: .8rem; font-weight: 700; color: var(--text-heading); }
.comment-head small { font-size: .66rem; color: var(--text-secondary); }
.comment-body { font-size: .84rem; line-height: 1.65; color: var(--text-primary); white-space: pre-wrap; }
.comment-list { display: flex; flex-direction: column; gap: 9px; }
.comment-form { border: 1px dashed var(--input-border); border-radius: var(--radius-md); padding: 13px; background: var(--table-head-bg); }
.comment-form textarea { border-radius: var(--radius-sm); border-color: var(--input-border); background: var(--input-bg); font-size: .84rem; min-height: 70px; resize: vertical; }
.comment-form .btn { padding: 6px 14px; border-radius: var(--radius-sm); font-size: .78rem; font-weight: 600; background: var(--primary); border: 0; color: #fff; box-shadow: 0 3px 9px var(--primary-ring); }
.comment-form .btn:hover { filter: brightness(1.06); color: #fff; }
.file-input-label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; padding: 6px 11px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text-secondary); font-size: .76rem; font-weight: 600; transition: .15s; }
.file-input-label:hover { border-color: var(--primary); color: var(--primary); }
.file-input-label input { display: none; }

/* Resolution card */
.resolution-card { border-left: 3px solid var(--success); border-radius: var(--radius-md); background: var(--success-bg); }

/* Ticket subject/desc */
.ticket-subject  { font-size: 18px; font-weight: 600; color: var(--text-heading); letter-spacing: 0; }
.ticket-desc     { line-height: 1.75; font-size: .9rem; white-space: pre-wrap; color: var(--text-primary); }
.ticket-sidebar  { border-radius: var(--radius-md); }
.ticket-sidebar h6 { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; }
.ticket-meta     { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; }
.ticket-meta dt  { margin: 0; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); font-weight: 700; align-self: center; }
.ticket-meta dd  { margin: 0; font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.ticket-meta-compact { gap: 4px 10px; }
.ticket-meta-compact dt { font-size: .6rem; }
.ticket-meta-compact dd { font-size: .76rem; }
.ticket-notfound .nf-icon { color: var(--primary); }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: .64rem; font-weight: 700; letter-spacing: 1.2px; }

/* ── Bulk-close confirmation ────────────────────────────────── */
/* (kept for compatibility) */

/* ── Reports / employees pages ──────────────────────────────── */
/* Inherits card, table, button styles */

/* ── Ticket row highlight (admin tables) ────────────────────── */
/* ── Scroll animation ───────────────────────────────────────── */
@keyframes tdvSpin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* ── Miscellaneous employee portal overrides ────────────────── */
.employee-portal .user-dashboard,
.employee-portal .my-tickets-page,
.employee-portal .create-ticket-page,
.employee-portal .notifications-page,
.employee-portal .ticket-view,
.employee-portal .profile-page { width: 100%; max-width: none; margin: 0; }
.employee-portal .impersonation-banner { max-width: none; border-radius: var(--radius-md); }
.employee-portal .alert { font-size: .82rem; border-radius: var(--radius-md); }
.employee-portal .ticket-status { font-size: .66rem; }
.employee-portal .list-group { border: 1px solid var(--card-border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.employee-portal .list-group-item { padding: 11px 14px; border-color: var(--card-border); background: var(--card-bg); color: var(--text-primary); font-size: .82rem; }
.employee-portal .list-group-item strong { color: var(--text-heading); font-size: .84rem; }
.employee-portal .container-fluid > h3 { display: none; }
.employee-portal:not(.employee-dashboard) .container-fluid > h3 { display: block; font-size: var(--fs-page); font-weight: 600; }

/* ── Admin portal all-page wrapper ──────────────────────────── */
.admin-portal .ticket-view { max-width: none; }
.admin-portal .life-page   { max-width: none; }
.admin-portal .table td a  { font-weight: 600; }

/* ── Session table (admin) ──────────────────────────────────── */
/* inherits card + table styles */

/* ── Reports page ───────────────────────────────────────────── */
/* inherits card + table styles */

/* ── Assets page ────────────────────────────────────────────── */
/* inherits card + table styles */

/* ── Remember-me checkbox ───────────────────────────────────── */
.remember-me { display: flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--login-muted); cursor: pointer; user-select: none; margin-top: -2px; }
.remember-me input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* ── Dark mode specific adjustments ────────────────────────── */
[data-bs-theme=dark] .user-welcome { border-color: rgba(37,99,235,.2); }
[data-bs-theme=dark] .user-stat-grid { background: var(--card-bg); border-color: var(--card-border); }
[data-bs-theme=dark] .user-stat      { border-color: var(--card-border); }
[data-bs-theme=dark] .user-panel     { background: var(--card-bg); border-color: var(--card-border); }
[data-bs-theme=dark] .ticket-list-item { background: var(--card-bg); border-color: var(--card-border); }
[data-bs-theme=dark] .ticket-list-icon { background: rgba(37,99,235,.12); color: #60a5fa; }
[data-bs-theme=dark] .new-file-drop  { background: var(--input-bg); border-color: var(--input-border); }
[data-bs-theme=dark] .new-file-drop.is-drag-over { background: rgba(37,99,235,.1) !important; }
[data-bs-theme=dark] .tdv-tl-dot     { background: #60a5fa; box-shadow: 0 0 0 2px var(--card-bg); }
[data-bs-theme=dark] .tdv-ticket-no  { background: rgba(59,130,246,.14); color: #60a5fa; }
[data-bs-theme=dark] .tdv-comment--admin .tdv-comment__avatar { background: linear-gradient(135deg,#c05010,#e07030); }
[data-bs-theme=dark] .tdv-resolution-box { background: rgba(22,163,74,.06); border-color: rgba(22,163,74,.18); }
[data-bs-theme=dark] .tdv-comment__role--admin { background: rgba(59,130,246,.15); color: #60a5fa; }
[data-bs-theme=dark] .notification-item--unread { background: rgba(37,99,235,.07); border-color: rgba(37,99,235,.2); }
[data-bs-theme=dark] .comment-card.comment-admin { background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.18); }
[data-bs-theme=dark] .priority-high { background: rgba(234,88,12,.12); color: #fb923c; }
[data-bs-theme=dark] .priority-low  { background: rgba(22,163,74,.1);  color: #4ade80; }
[data-bs-theme=dark] .priority-medium  { background: rgba(217,119,6,.1); color: #fbbf24; }
[data-bs-theme=dark] .priority-critical{ background: rgba(220,38,38,.12); color: #f87171; }
[data-bs-theme=dark] .tu-check { background: rgba(22,163,74,.12); color: #4ade80; }
[data-bs-theme=dark] .ts-check { background: rgba(22,163,74,.1); color: #4ade80; }
[data-bs-theme=dark] .ticket-table > tbody > tr:nth-child(even) > td { background: color-mix(in srgb, var(--table-head-bg) 80%, transparent); }
[data-bs-theme=dark] .assign-widget .assign-select { background: var(--input-bg); border-color: var(--input-border); color: var(--input-text); }
[data-bs-theme=dark] .ct-file-item { background: var(--card-bg); border-color: var(--card-border); }
[data-bs-theme=dark] .profile-avatar-big { box-shadow: 0 0 0 2px var(--border), 0 8px 18px rgba(0,0,0,.3); }
[data-bs-theme=dark] .tdv-reply-form__textarea { background: var(--input-bg); border-color: var(--input-border); color: var(--input-text); }
[data-bs-theme=dark] .tdv-field select,
[data-bs-theme=dark] .tdv-field textarea { background: var(--input-bg); border-color: var(--input-border); color: var(--input-text); }
[data-bs-theme=dark] .new-ticket-field select,
[data-bs-theme=dark] .new-ticket-field input,
[data-bs-theme=dark] .new-ticket-field textarea { background: var(--input-bg); border-color: var(--input-border); color: var(--input-text); }

/* Bootstrap components follow the same tokens as the app shell. */
[data-bs-theme=dark] {
  color-scheme: dark;
  --bs-body-bg: var(--page-bg);
  --bs-body-color: var(--text-primary);
  --bs-emphasis-color: var(--text-heading);
  --bs-secondary-color: var(--text-secondary);
  --bs-tertiary-color: var(--text-secondary);
  --bs-border-color: var(--border);
  --bs-card-bg: var(--card-bg);
  --bs-card-color: var(--text-primary);
  --bs-card-cap-bg: var(--card-bg);
  --bs-card-border-color: var(--card-border);
  --bs-modal-bg: var(--card-bg);
  --bs-modal-color: var(--text-primary);
  --bs-dropdown-bg: var(--card-bg);
  --bs-dropdown-color: var(--text-primary);
  --bs-dropdown-link-color: var(--text-primary);
  --bs-dropdown-link-hover-bg: var(--table-hover);
  --bs-dropdown-link-hover-color: var(--text-heading);
  --bs-list-group-bg: var(--card-bg);
  --bs-list-group-color: var(--text-primary);
  --bs-list-group-border-color: var(--border);
  --bs-secondary-bg: var(--surface-raised);
  --bs-tertiary-bg: var(--table-head-bg);
}
[data-bs-theme=dark] body,
[data-bs-theme=dark] .content,
[data-bs-theme=dark] .admin-portal,
[data-bs-theme=dark] .employee-portal { background: var(--page-bg); color: var(--text-primary); }
[data-bs-theme=dark] .card,
[data-bs-theme=dark] .card-header,
[data-bs-theme=dark] .modal-content,
[data-bs-theme=dark] .dropdown-menu,
[data-bs-theme=dark] .list-group-item,
[data-bs-theme=dark] .tdv-card,
[data-bs-theme=dark] .life-hero,
[data-bs-theme=dark] .profile-card,
[data-bs-theme=dark] .profile-summary,
[data-bs-theme=dark] .comment-card,
[data-bs-theme=dark] .comment-form,
[data-bs-theme=dark] .notification-item { background: var(--card-bg); color: var(--text-primary); border-color: var(--card-border); }
[data-bs-theme=dark] .form-control,
[data-bs-theme=dark] .form-select,
[data-bs-theme=dark] textarea { background-color: var(--input-bg); color: var(--input-text); border-color: var(--input-border); }
[data-bs-theme=dark] .form-control::placeholder,
[data-bs-theme=dark] textarea::placeholder { color: var(--input-placeholder); }
[data-bs-theme=dark] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--table-border);
  --bs-table-hover-bg: var(--table-hover);
  --bs-table-striped-bg: rgba(255,255,255,.03);
  color: var(--text-primary);
}
[data-bs-theme=dark] .table > thead,
[data-bs-theme=dark] .table > thead th { background: var(--table-head-bg); color: var(--table-head-text); }
[data-bs-theme=dark] .ticket-help-card--urgent p { color: #fecdd3; }
[data-bs-theme=dark] .btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-input); }
[data-bs-theme=dark] .btn-outline-secondary:hover { background: var(--table-head-bg); color: var(--text-heading); }
[data-bs-theme=dark] .page-link { background: var(--card-bg); color: var(--text-primary); border-color: var(--border); }
[data-bs-theme=dark] .nav-tabs { border-color: var(--border); }
[data-bs-theme=dark] .nav-tabs .nav-link { color: var(--text-secondary); }
[data-bs-theme=dark] .nav-tabs .nav-link.active { background: var(--card-bg); color: var(--text-heading); border-color: var(--border) var(--border) var(--card-bg); }
[data-bs-theme=dark] .life-pipe__step,
[data-bs-theme=dark] .life-stat,
[data-bs-theme=dark] .ticket-filter-bar { background: var(--card-bg); border-color: var(--card-border); color: var(--text-primary); }
[data-bs-theme=dark] .chart-empty { color: var(--text-secondary); }
