/* Dental College Store Management UI
   Bootstrap 5.3 + custom design tokens. Theme presets are applied via body[data-theme]. */
:root {
  --brand-primary: #087f8c;
  --brand-primary-rgb: 8, 127, 140;
  --brand-primary-dark: #066873;
  --brand-navy: #142d4e;
  --brand-navy-2: #1b3b60;
  --brand-soft: #eaf4f6;
  --page-bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text-main: #1d2b3a;
  --text-muted: #718096;
  --border: #e5ebf1;
  --success: #198754;
  --warning: #e6a23c;
  --danger: #dc5b64;
  --sidebar-width: 264px;
  --topbar-height: 76px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 8px 26px rgba(20, 45, 78, .06);
}
body[data-theme="ocean"] { --brand-primary:#2563a6; --brand-primary-rgb:37,99,166; --brand-primary-dark:#1d4f86; --brand-soft:#edf4fc; }
body[data-theme="forest"] { --brand-primary:#2f7a58; --brand-primary-rgb:47,122,88; --brand-primary-dark:#245f44; --brand-soft:#edf7f1; }
body[data-theme="plum"] { --brand-primary:#7652a5; --brand-primary-rgb:118,82,165; --brand-primary-dark:#604187; --brand-soft:#f4effa; }
body[data-theme="custom"] { --brand-primary:var(--custom-primary, #087f8c); --brand-primary-rgb:var(--custom-primary-rgb, 8,127,140); --brand-primary-dark:var(--custom-primary-dark, #066873); --brand-soft:var(--custom-soft, #eaf4f6); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin:0; background:var(--page-bg); color:var(--text-main); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size:14px; }
a { color:inherit; text-decoration:none; }
button, input, select, textarea { font:inherit; }
.text-muted-custom { color:var(--text-muted)!important; }
.fw-semibold { font-weight:600!important; }
.small-label { color:var(--text-muted); font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; }

/* Authentication */
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:32px 18px; background:linear-gradient(135deg,#edf5f7 0%,#f7f9fc 52%,#eaf0f7 100%); }
.auth-shell { width:min(100%, 1020px); min-height:620px; display:grid; grid-template-columns: .95fr 1.05fr; background:var(--surface); border:1px solid rgba(229,235,241,.9); border-radius:24px; overflow:hidden; box-shadow:0 24px 70px rgba(20,45,78,.12); }
.auth-visual { position:relative; padding:48px; display:flex; flex-direction:column; justify-content:space-between; color:#fff; overflow:hidden; background:radial-gradient(circle at 85% 18%,rgba(255,255,255,.17),transparent 25%),linear-gradient(150deg,#142d4e 0%,#174c68 54%,#087f8c 100%); }
.auth-visual:before,.auth-visual:after { content:""; position:absolute; border:1px solid rgba(255,255,255,.14); border-radius:50%; pointer-events:none; }
.auth-visual:before { width:390px;height:390px;right:-150px;bottom:-120px; }
.auth-visual:after { width:270px;height:270px;right:-90px;bottom:-60px; }
.auth-brand { position:relative; z-index:1; display:flex; align-items:center; gap:12px; }
.auth-brand .brand-mark { background:rgba(255,255,255,.15); color:#fff; }
.auth-visual-content { position:relative; z-index:1; max-width:390px; }
.auth-visual-content h1 { font-size:clamp(28px,3vw,40px); line-height:1.15; font-weight:750; letter-spacing:-.04em; margin:0 0 18px; }
.auth-visual-content p { color:rgba(255,255,255,.78); line-height:1.8; font-size:15px; }
.auth-feature-list { display:grid; gap:14px; margin-top:30px; }
.auth-feature { display:flex; align-items:center; gap:12px; color:rgba(255,255,255,.9); font-size:13px; }
.auth-feature i { width:30px;height:30px;border-radius:9px;background:rgba(255,255,255,.13);display:grid;place-items:center; }
.auth-visual-footer { position:relative;z-index:1;color:rgba(255,255,255,.62);font-size:11px; }
.auth-form-panel { padding:54px clamp(26px,5vw,64px); display:flex; align-items:center; }
.auth-form-inner { width:100%; max-width:420px; margin:auto; }
.auth-form-inner h2 { font-size:28px; font-weight:750; letter-spacing:-.035em; margin:0 0 8px; color:var(--brand-navy); }
.auth-form-inner .auth-subtitle { color:var(--text-muted); line-height:1.65; margin-bottom:30px; }
.auth-form-footer { margin-top:24px; color:var(--text-muted); font-size:12px; text-align:center; }
.auth-back { display:inline-flex; align-items:center; gap:8px; color:var(--text-muted); font-weight:600; margin-bottom:28px; }
.auth-back:hover { color:var(--brand-primary); }

/* Brand */
.brand-lockup { display:flex; align-items:center; gap:11px; min-width:0; }
.brand-mark { width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border-radius:13px;background:var(--brand-primary);color:#fff;font-size:20px;box-shadow:0 7px 18px rgba(var(--brand-primary-rgb),.2); }
.brand-title { font-size:14px; font-weight:750; color:var(--brand-navy); letter-spacing:-.02em; line-height:1.2; }
.brand-subtitle { display:block; margin-top:4px; color:var(--text-muted); font-size:10px; letter-spacing:.08em; text-transform:uppercase; font-weight:700; }

/* App layout */
.app-layout { min-height:100vh; }
.sidebar { width:var(--sidebar-width); position:fixed; inset:0 auto 0 0; z-index:1030; display:flex; flex-direction:column; background:#142d4e; color:#dce7f2; padding:22px 15px 16px; overflow-y:auto; }
.sidebar .brand-lockup { padding:0 10px 24px; border-bottom:1px solid rgba(255,255,255,.1); }
.sidebar .brand-title { color:#fff; }
.sidebar .brand-subtitle { color:rgba(255,255,255,.48); }
.sidebar .brand-mark { background:linear-gradient(135deg,#0d9aa4,#087f8c); box-shadow:none; }
.sidebar-section { margin-top:22px; }
.sidebar-section-title { padding:0 12px 9px; color:rgba(220,231,242,.42); font-size:10px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.sidebar-nav { list-style:none; padding:0; margin:0; display:grid; gap:4px; }
.sidebar-link { display:flex; align-items:center; gap:12px; min-height:43px; padding:10px 12px; border-radius:10px; color:rgba(231,240,248,.72); font-size:13px; font-weight:550; transition:.18s ease; }
.sidebar-link i { width:18px; font-size:16px; text-align:center; color:rgba(231,240,248,.58); }
.sidebar-link:hover { background:rgba(255,255,255,.07); color:#fff; }
.sidebar-link.active { background:rgba(8,127,140,.26); color:#fff; box-shadow:inset 3px 0 #22b6b7; }
.sidebar-link.active i { color:#6fe0dd; }
.sidebar-link.disabled { opacity:.42; cursor:not-allowed; }
.sidebar-link .nav-tag { margin-left:auto; font-size:9px; text-transform:uppercase; letter-spacing:.06em; border:1px solid rgba(255,255,255,.18); border-radius:5px; padding:2px 5px; color:rgba(255,255,255,.58); }
.sidebar-bottom { margin-top:auto; padding:18px 10px 2px; }
.sidebar-help { padding:14px; border-radius:13px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.08); }
.sidebar-help strong { display:block; font-size:12px; color:#fff; margin-bottom:5px; }
.sidebar-help p { margin:0; color:rgba(255,255,255,.55); font-size:11px; line-height:1.55; }
.main-area { min-height:100vh; margin-left:var(--sidebar-width); }
.topbar { height:var(--topbar-height); position:sticky; top:0; z-index:1020; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:0 34px; background:rgba(255,255,255,.94); border-bottom:1px solid var(--border); backdrop-filter:blur(12px); }
.topbar-left,.topbar-right { display:flex; align-items:center; gap:14px; min-width:0; }
.topbar-search { position:relative; width:min(340px,36vw); }
.topbar-search > i { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:#9aa8b7; }
.topbar-search input { padding-left:38px; border-radius:9px; background:#f7f9fb; border-color:#edf1f5; height:39px; font-size:12px; }
.icon-button { width:38px;height:38px;border:1px solid var(--border);background:#fff;border-radius:10px;display:grid;place-items:center;color:#637488;position:relative; }
.icon-button:hover { color:var(--brand-primary);border-color:rgba(var(--brand-primary-rgb),.3); }
.notification-dot { position:absolute; width:7px;height:7px;border-radius:50%;background:#ed6b73;right:8px;top:7px;border:1px solid #fff; }
.profile-trigger { display:flex;align-items:center;gap:10px;border:0;background:transparent;padding:4px 0 4px 5px;text-align:left; }
.avatar { width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#e7f1f3;color:var(--brand-primary);font-size:12px;font-weight:800;flex:0 0 auto; }
.avatar.avatar-sm { width:32px;height:32px;border-radius:9px;font-size:10px; }
.profile-meta strong { display:block;font-size:12px;color:var(--text-main);font-weight:700; }
.profile-meta span { display:block;font-size:10px;color:var(--text-muted);margin-top:2px; }
.page-content { padding:28px 34px 42px; max-width:1700px; margin:0 auto; }
.page-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:24px; }
.page-heading h1 { margin:0;color:var(--brand-navy);font-size:25px;letter-spacing:-.04em;font-weight:760; }
.page-heading p { margin:7px 0 0;color:var(--text-muted);font-size:12px; }
.breadcrumb-line { display:flex;align-items:center;gap:8px;color:#97a4b2;font-size:11px;margin-bottom:8px; }
.breadcrumb-line .current { color:var(--brand-primary);font-weight:700; }
.heading-actions { display:flex;gap:9px;align-items:center;flex-wrap:wrap; }
.mobile-brand { display:none; }

/* Components */
.card-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-soft); }
.card-panel .card-panel-header { padding:18px 20px 14px; display:flex;align-items:center;justify-content:space-between;gap:12px; }
.card-panel .card-panel-body { padding:18px 20px 20px; }
.card-title { margin:0;color:var(--brand-navy);font-size:14px;font-weight:750; }
.card-subtitle { color:var(--text-muted);font-size:11px;margin-top:4px; }
.stat-card { height:100%;padding:19px 20px;background:#fff;border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-soft); }
.stat-top { display:flex;align-items:center;justify-content:space-between;gap:10px; }
.stat-icon { width:42px;height:42px;border-radius:13px;display:grid;place-items:center;font-size:18px; }
.stat-icon.teal { background:#e6f5f4;color:#07818a; }
.stat-icon.blue { background:#eaf1fc;color:#4779c5; }
.stat-icon.amber { background:#fff5e6;color:#d28a24; }
.stat-icon.rose { background:#fff0f1;color:#d65d6a; }
.stat-value { margin-top:17px;color:var(--brand-navy);font-size:27px;line-height:1;font-weight:780;letter-spacing:-.04em; }
.stat-label { margin-top:7px;color:var(--text-muted);font-size:11px;font-weight:600; }
.stat-foot { display:flex;align-items:center;gap:6px;margin-top:13px;font-size:10px;color:var(--text-muted); }
.trend-up { color:#18875b;font-weight:700; }
.trend-down { color:#d65d6a;font-weight:700; }
.btn { border-radius:9px;font-size:12px;font-weight:650;padding:9px 14px; }
.btn-sm { padding:6px 10px;font-size:11px;border-radius:8px; }
.btn-primary { --bs-btn-bg:var(--brand-primary);--bs-btn-border-color:var(--brand-primary);--bs-btn-hover-bg:var(--brand-primary-dark);--bs-btn-hover-border-color:var(--brand-primary-dark);--bs-btn-active-bg:var(--brand-primary-dark);--bs-btn-active-border-color:var(--brand-primary-dark); }
.btn-outline-primary { --bs-btn-color:var(--brand-primary);--bs-btn-border-color:rgba(var(--brand-primary-rgb),.35);--bs-btn-hover-bg:var(--brand-primary);--bs-btn-hover-border-color:var(--brand-primary); }
.btn-light { background:#f6f8fa;border-color:#edf1f5;color:#56687b; }
.btn-light:hover { background:#edf2f6;border-color:#e3eaf0; }
.form-label { color:#4c5c6e;font-size:11px;font-weight:700;margin-bottom:7px; }
.form-control,.form-select { min-height:41px;border-radius:9px;border-color:#dfe6ed;color:var(--text-main);font-size:12px;padding:9px 12px; }
.form-control:focus,.form-select:focus { border-color:rgba(var(--brand-primary-rgb),.55);box-shadow:0 0 0 .2rem rgba(var(--brand-primary-rgb),.10); }
.form-control::placeholder { color:#aab5c0; }
.form-text { font-size:10px;color:#8b98a7; }
.input-group .btn { border-color:#dfe6ed; }
.input-icon-wrap { position:relative; }
.input-icon-wrap > i { position:absolute;left:13px;top:50%;transform:translateY(-50%);color:#98a5b2;z-index:2; }
.input-icon-wrap .form-control { padding-left:38px; }
.password-toggle { min-width:43px;color:#8795a4; }
.table { --bs-table-bg:transparent; margin:0; vertical-align:middle; }
.table thead th { background:#f8fafc;color:#7b8998;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.065em;padding:12px 14px;border-bottom:1px solid var(--border);white-space:nowrap; }
.table tbody td { padding:13px 14px;border-bottom:1px solid #edf1f5;color:#536477;font-size:11px; }
.table tbody tr:last-child td { border-bottom:0; }
.table tbody tr:hover { background:#fbfcfe; }
.table .primary-text { color:var(--brand-navy);font-weight:700; }
.table-responsive { border-radius:0 0 var(--radius-lg) var(--radius-lg); }
.status-pill { display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:20px;font-size:10px;font-weight:750;white-space:nowrap; }
.status-pill:before { content:"";width:6px;height:6px;border-radius:50%;background:currentColor; }
.status-active { background:#eaf7f0;color:#198754; }
.status-inactive { background:#f0f2f5;color:#7d8997; }
.status-pending { background:#fff5e7;color:#bd7a1e; }
.status-danger { background:#fff0f1;color:#d45561; }
.role-tag { display:inline-flex;padding:5px 8px;border-radius:6px;background:#edf3f8;color:#48627b;font-size:10px;font-weight:700; }
.table-user { display:flex;align-items:center;gap:9px;min-width:175px; }
.table-user strong { display:block;color:var(--brand-navy);font-size:11px;font-weight:700; }
.table-user span { display:block;color:#93a0ad;font-size:10px;margin-top:3px; }
.action-group { display:flex;align-items:center;gap:5px; }
.action-btn { width:29px;height:29px;display:grid;place-items:center;border:1px solid #e7edf2;background:#fff;border-radius:7px;color:#758598; }
.action-btn:hover { color:var(--brand-primary);border-color:rgba(var(--brand-primary-rgb),.3); }
.toolbar { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid var(--border); }
.toolbar-left,.toolbar-right { display:flex;align-items:center;gap:9px;flex-wrap:wrap; }
.toolbar .form-control,.toolbar .form-select { min-height:36px;font-size:11px; }
.pagination { gap:4px; }
.page-link { border:1px solid var(--border);border-radius:7px!important;color:#68798c;font-size:11px;padding:6px 10px; }
.page-item.active .page-link { background:var(--brand-primary);border-color:var(--brand-primary); }
.empty-note { color:#98a5b2;font-size:11px; }

/* Forms and permission matrix */
.form-section { padding:20px;border-bottom:1px solid var(--border); }
.form-section:last-child { border-bottom:0; }
.form-section-heading { display:flex;align-items:flex-start;gap:11px;margin-bottom:18px; }
.form-section-icon { width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--brand-soft);color:var(--brand-primary);flex:0 0 auto; }
.form-section-heading h3 { margin:0;color:var(--brand-navy);font-size:13px;font-weight:750; }
.form-section-heading p { margin:4px 0 0;color:var(--text-muted);font-size:10px; }
.form-actions { display:flex;justify-content:flex-end;gap:9px;padding:17px 20px;background:#fbfcfd;border-top:1px solid var(--border);border-radius:0 0 var(--radius-lg) var(--radius-lg); }
.permission-group { border:1px solid var(--border);border-radius:12px;overflow:visible;background:#fff;margin-bottom:12px; }
.permission-group-head { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;background:#f9fbfc;border-bottom:1px solid var(--border);border-radius:12px 12px 0 0; }
.permission-group-head .form-check-label { color:var(--brand-navy);font-size:11px;font-weight:750; }
.permission-items { padding:14px 15px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px; }
.form-check { min-height:unset;margin:0; }
.form-check-input { width:15px;height:15px;margin-top:.12em;border-color:#c8d2dc; }
.form-check-input:checked { background-color:var(--brand-primary);border-color:var(--brand-primary); }
.form-check-input:focus { box-shadow:0 0 0 .18rem rgba(var(--brand-primary-rgb),.12); }
.form-check-label { color:#607184;font-size:11px; }
.permission-row { display:grid;grid-template-columns:1.1fr 1.1fr auto;gap:9px;align-items:center;margin-bottom:9px; }
.permission-row:last-child { margin-bottom:0; }
.permission-row .form-control { min-height:38px; }
.add-row-btn { display:inline-flex;align-items:center;gap:7px;color:var(--brand-primary);background:var(--brand-soft);border:1px dashed rgba(var(--brand-primary-rgb),.45);border-radius:8px;padding:8px 11px;font-size:11px;font-weight:750; }
.add-row-btn:hover { background:rgba(var(--brand-primary-rgb),.12); }
.remove-row-btn { width:36px;height:36px;display:grid;place-items:center;border:1px solid #f1d9dc;background:#fff7f7;color:#cf5c65;border-radius:8px; }

/* Settings */
.settings-nav { display:flex;gap:7px;flex-wrap:wrap;padding:13px 18px;border-bottom:1px solid var(--border); }
.settings-nav .nav-link { color:#718094;font-size:11px;font-weight:700;border-radius:8px;padding:8px 12px; }
.settings-nav .nav-link.active { color:var(--brand-primary);background:var(--brand-soft); }
.theme-option { display:flex;align-items:center;gap:12px;padding:13px;border:1px solid var(--border);border-radius:11px;cursor:pointer;transition:.15s; }
.theme-option:hover { border-color:rgba(var(--brand-primary-rgb),.4); }
.theme-option.selected { border-color:var(--brand-primary);box-shadow:0 0 0 2px rgba(var(--brand-primary-rgb),.08);background:#fcfefe; }
.theme-swatch { display:flex;gap:3px;overflow:hidden;width:55px;height:35px;border-radius:8px;flex:0 0 auto; }
.theme-swatch span { flex:1; }
.theme-option strong { display:block;font-size:11px;color:var(--brand-navy); }
.theme-option small { display:block;color:var(--text-muted);font-size:10px;margin-top:3px; }
.theme-radio { margin-left:auto; }
.color-picker-wrap { display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--border);border-radius:11px; }
.form-control-color { width:42px;height:38px;padding:4px;border-radius:8px; }

/* Dashboard */
.chart-area { height:210px;display:flex;align-items:flex-end;gap:14px;padding:20px 8px 0;border-bottom:1px solid #e8eef3; }
.chart-col { flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:8px; }
.chart-bar-wrap { width:100%;height:165px;display:flex;align-items:flex-end;justify-content:center;gap:4px; }
.chart-bar { width:12px;max-width:34%;border-radius:5px 5px 0 0;background:rgba(var(--brand-primary-rgb),.82); }
.chart-bar.secondary { background:#c6d8e5; }
.chart-label { color:#91a0af;font-size:9px; }
.legend-dot { display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px; }
.activity-icon { width:29px;height:29px;display:grid;place-items:center;border-radius:9px;background:var(--brand-soft);color:var(--brand-primary); }
.progress { height:6px;border-radius:10px;background:#edf1f5; }
.progress-bar { background:var(--brand-primary);border-radius:10px; }

/* Choices.js + Flatpickr: dropdowns must escape card boundaries */
.card-panel,.card-panel-body,.form-section,.settings-content { overflow:visible; }
.choices { margin-bottom:0; }
.choices__inner { min-height:41px!important;border-radius:9px!important;border:1px solid #dfe6ed!important;background:#fff!important;padding:6px 10px!important;font-size:12px!important; }
.choices.is-focused .choices__inner,.choices.is-open .choices__inner { border-color:rgba(var(--brand-primary-rgb),.55)!important;box-shadow:0 0 0 .2rem rgba(var(--brand-primary-rgb),.10); }
.choices__list--dropdown,.choices__list[aria-expanded] { z-index:1085!important;border:1px solid #dfe6ed!important;border-radius:9px!important;box-shadow:0 12px 28px rgba(20,45,78,.13)!important;overflow:hidden!important; }
.choices__list--dropdown .choices__item,.choices__list[aria-expanded] .choices__item { font-size:12px!important;padding:9px 12px!important; }
.choices__list--multiple .choices__item { background:var(--brand-primary)!important;border-color:var(--brand-primary)!important;border-radius:6px!important;font-size:10px!important; }
.choices[data-type*=select-one]::after { border-color:#8795a4 transparent transparent; }
.flatpickr-calendar { z-index:1090!important;border-radius:12px!important;box-shadow:0 14px 35px rgba(20,45,78,.16)!important;border:1px solid var(--border)!important; }
.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange { background:var(--brand-primary)!important;border-color:var(--brand-primary)!important; }

/* Responsive */
@media (max-width:1199.98px) {
  .topbar { padding:0 24px; }
  .page-content { padding:24px; }
}
@media (max-width:991.98px) {
  .main-area { margin-left:0; }
  .sidebar { display:none!important; }
  .topbar { height:66px;padding:0 18px; }
  .mobile-brand { display:flex; }
  .topbar-search { width:min(280px,32vw); }
  .page-content { padding:22px 18px 34px; }
  .auth-shell { grid-template-columns:1fr;max-width:560px;min-height:auto; }
  .auth-visual { display:none; }
  .auth-form-panel { padding:42px 34px; }
}
@media (max-width:767.98px) {
  .topbar-search { display:none; }
  .profile-meta { display:none; }
  .page-heading { flex-direction:column;align-items:stretch; }
  .heading-actions { justify-content:flex-start; }
  .permission-items { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .toolbar { align-items:flex-start;flex-direction:column; }
  .toolbar-left,.toolbar-right { width:100%; }
  .toolbar-left .form-control { flex:1;min-width:150px; }
  .chart-area { gap:7px; }
  .chart-bar { width:9px; }
}
@media (max-width:575.98px) {
  .page-content { padding:18px 12px 28px; }
  .topbar { padding:0 12px; }
  .auth-page { padding:12px; }
  .auth-shell { border-radius:17px; }
  .auth-form-panel { padding:34px 22px; }
  .auth-form-inner h2 { font-size:24px; }
  .permission-items { grid-template-columns:1fr; }
  .permission-row { grid-template-columns:1fr auto; }
  .permission-row .permission-key { grid-column:1/2; }
  .form-section { padding:16px; }
  .card-panel .card-panel-header,.card-panel .card-panel-body { padding-left:15px;padding-right:15px; }
  .stat-value { font-size:24px; }
}


/* Custom, Laravel-friendly pagination component */
.custom-pagination-footer {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  flex-wrap:wrap; padding:16px 18px; border-top:1px solid var(--border);
}
.custom-pagination-info { color:var(--text-muted); font-size:10px; }
.custom-pagination-info strong { color:var(--text-main); font-weight:750; }
.custom-pagination-info .page-position { display:inline-block; margin-left:8px; color:var(--brand-primary); font-weight:700; }
.custom-pagination { display:flex; align-items:center; gap:5px; list-style:none; padding:0; margin:0; }
.custom-pagination li { margin:0; padding:0; }
.custom-pagination button {
  min-width:34px; height:34px; padding:0 9px; display:inline-flex; align-items:center; justify-content:center; gap:6px;
  border:1px solid var(--border); border-radius:8px; background:#fff; color:#617187;
  font-size:10px; font-weight:700; transition:all .16s ease;
}
.custom-pagination button:hover:not(:disabled) { color:var(--brand-primary); border-color:var(--brand-primary); background:var(--brand-soft); }
.custom-pagination button.active { background:var(--brand-primary); color:#fff; border-color:var(--brand-primary); box-shadow:0 4px 10px rgba(var(--brand-primary-rgb),.16); }
.custom-pagination button:disabled { opacity:.38; cursor:not-allowed; background:#f7f8fa; }
.custom-pagination .page-ellipsis { color:#9aa5b4; padding:0 3px; font-size:12px; }
@media (max-width:767.98px) {
  .custom-pagination-footer { align-items:flex-start; }
  .custom-pagination { flex-wrap:wrap; }
  .custom-pagination button { min-width:30px; height:31px; padding:0 7px; }
}
@media (max-width:420px) {
  .custom-pagination button .page-word { display:none; }
}

/* Mobile off-canvas navigation mirrors the desktop navy sidebar. */
.mobile-offcanvas { width:280px !important; min-height:100vh; overflow-y:auto; background:#142d4e !important; color:#dce7f2 !important; padding:22px 15px 16px; }
.mobile-offcanvas .brand-lockup { width:100%; padding:0 10px 22px; border-bottom:1px solid rgba(255,255,255,.1); }
.mobile-offcanvas .brand-title { color:#fff; }
.mobile-offcanvas .brand-subtitle { color:rgba(220,231,242,.48); }
.mobile-offcanvas .brand-mark { background:linear-gradient(135deg,#0d9aa4,#087f8c); }
.mobile-offcanvas .sidebar-section { margin-top:22px; }
.mobile-offcanvas .sidebar-section-title { color:rgba(220,231,242,.42); }
.mobile-offcanvas .sidebar-link { color:rgba(231,240,248,.72); }
.mobile-offcanvas .sidebar-link:hover,.mobile-offcanvas .sidebar-link.active { color:#fff; background:rgba(255,255,255,.11); }
.mobile-offcanvas .sidebar-link.active { box-shadow:inset 3px 0 0 #36c1c4; }
.mobile-offcanvas .sidebar-help { display:none !important; }

/* Refined attachment upload and preview panels */
.file-upload-layout { display:grid;grid-template-columns:minmax(0,1.05fr) minmax(220px,.95fr);gap:13px;align-items:stretch; }
.file-upload-zone { position:relative;min-height:132px;display:flex;align-items:center;gap:13px;padding:18px;border:1px dashed rgba(var(--brand-primary-rgb),.42);border-radius:13px;background:linear-gradient(135deg,var(--brand-soft),#fff 76%);cursor:pointer;transition:border-color .18s ease,background .18s ease,transform .18s ease; }
.file-upload-zone:hover { border-color:var(--brand-primary);background:var(--brand-soft);transform:translateY(-1px); }
.file-upload-zone input[type="file"] { position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer; }
.file-upload-symbol { width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border-radius:12px;background:#fff;color:var(--brand-primary);font-size:19px;box-shadow:0 4px 12px rgba(20,45,78,.07); }
.file-upload-copy { display:flex;flex-direction:column;gap:5px;min-width:0; }
.file-upload-copy strong { color:var(--brand-navy);font-size:12px;font-weight:750; }
.file-upload-copy small { color:var(--text-muted);font-size:10px;line-height:1.5; }
.file-upload-action { margin-left:auto;align-self:flex-end;white-space:nowrap;color:var(--brand-primary);font-size:10px;font-weight:750;background:#fff;border:1px solid rgba(var(--brand-primary-rgb),.2);border-radius:8px;padding:7px 9px; }
.file-preview-panel { min-height:132px;display:flex;align-items:center;padding:13px;border:1px solid var(--border);border-radius:13px;background:#fbfcfd; }
.file-preview-empty { width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;color:var(--text-muted); }
.file-preview-empty-icon { width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#eef3f7;color:#8494a5;font-size:15px;margin-bottom:3px; }
.file-preview-empty strong { color:#607184;font-size:10px;font-weight:750; }
.file-preview-empty small { font-size:9px; }
.file-preview-content { width:100%;display:flex;align-items:center;gap:11px;min-width:0; }
.file-preview-visual { width:76px;height:76px;flex:0 0 auto;display:grid;place-items:center;overflow:hidden;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--brand-primary); }
.file-preview-visual img { width:100%;height:100%;object-fit:contain; }
.file-preview-file-icon { font-size:31px; }
.file-preview-details { min-width:0;display:flex;flex-direction:column;gap:5px; }
.file-preview-details strong { color:var(--brand-navy);font-size:10px;overflow-wrap:anywhere; }
.file-preview-details span { color:var(--text-muted);font-size:9px; }
.file-preview-remove { align-self:flex-start;padding:0;border:0;background:none;color:#c35b64;font-size:9px;font-weight:700; }
.attachment-card { display:flex;align-items:center;gap:13px;padding:14px;border:1px solid var(--border);border-radius:13px;background:#fbfcfd; }
.attachment-icon { width:42px;height:42px;display:grid;place-items:center;flex:0 0 auto;border-radius:11px;background:#fff0f0;color:#d45d66;font-size:19px; }
.attachment-icon.attachment-image { background:#edf4fc;color:#4c7fc0; }
.attachment-copy { min-width:0;flex:1;display:flex;flex-direction:column;gap:4px; }
.attachment-copy strong { color:var(--brand-navy);font-size:11px;overflow-wrap:anywhere; }
.attachment-copy span { color:var(--text-muted);font-size:10px; }

/* Card-based product lines keep searchable dropdowns clear of card clipping. */
.line-item-list { display:grid;gap:12px;position:relative;overflow:visible; }
.line-item-card { position:relative;z-index:1;padding:15px 16px 16px;border:1px solid var(--border);border-radius:13px;background:#fff;overflow:visible;transition:border-color .16s ease,box-shadow .16s ease; }
.line-item-card:focus-within { z-index:1096;border-color:rgba(var(--brand-primary-rgb),.42);box-shadow:0 7px 22px rgba(20,45,78,.07); }
.line-item-card-head { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px; }
.line-item-card-title { display:flex;align-items:center;gap:10px;min-width:0; }
.line-item-number { width:28px;height:28px;display:grid;place-items:center;flex:0 0 auto;border-radius:8px;background:var(--brand-soft);color:var(--brand-primary);font-size:10px;font-weight:800; }
.line-item-card-title strong { display:block;color:var(--brand-navy);font-size:11px;font-weight:750; }
.line-item-card-title small { display:block;margin-top:3px;color:var(--text-muted);font-size:9px; }
.line-remove-btn { flex:0 0 auto; }
.line-item-card .form-label { margin-bottom:6px; }
.line-item-card .form-control,.line-item-card .form-select,.line-item-card .choices__inner { min-height:39px!important; }
.line-item-card .choices { position:relative;z-index:2;width:100%; }
.line-item-card .choices.is-open { z-index:1100!important; }
.line-item-card .choices__list--dropdown,.line-item-card .choices__list[aria-expanded] { z-index:1102!important;top:calc(100% + 4px)!important;bottom:auto!important;max-height:250px;border-radius:10px!important; }
.line-item-list .choices.is-open { z-index:1100!important; }
.line-summary-wrap { display:flex;justify-content:flex-end;margin-top:14px; }
.line-summary-card { min-width:min(100%,300px);display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 16px;border:1px solid rgba(var(--brand-primary-rgb),.18);border-radius:12px;background:var(--brand-soft); }
.line-summary-card > div { display:flex;flex-direction:column;gap:3px; }
.line-summary-label { color:var(--text-muted);font-size:10px;font-weight:700; }
.line-summary-card strong { color:var(--brand-navy);font-size:23px;line-height:1.1;font-weight:800;letter-spacing:-.04em; }
.line-summary-card small { color:var(--text-muted);font-size:9px; }
.line-summary-icon { width:39px;height:39px;display:grid;place-items:center;border-radius:11px;background:#fff;color:var(--brand-primary);font-size:17px; }

/* Keep all dropdown overlays above nearby cards and panels. */
.card-panel,.card-panel-body,.card-panel-header,.form-section,.line-item-list,.line-item-card,.row,[class^="col-"],[class*=" col-"] { overflow:visible; }
.choices { max-width:100%; }
.choices.is-open { z-index:1098!important; }
.choices__list--dropdown,.choices__list[aria-expanded] { z-index:1100!important; }

@media (max-width:767.98px) {
  .file-upload-layout { grid-template-columns:1fr; }
  .file-upload-zone,.file-preview-panel { min-height:118px; }
  .line-item-card { padding:13px; }
  .line-item-card-head { margin-bottom:12px; }
  .line-summary-wrap { justify-content:stretch; }
  .line-summary-card { width:100%; }
}


/* Product image uploader: single-column layout prevents clipping in the narrow form sidebar. */
.product-image-uploader.file-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
  align-items: stretch;
}
.product-image-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 13px;
  width: 100%;
  min-width: 0;
  min-height: 142px;
  margin: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px dashed rgba(var(--brand-primary-rgb), .42);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-soft), #fff 78%);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.product-image-dropzone:hover {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
  box-shadow: 0 5px 16px rgba(20, 45, 78, .05);
}
.product-image-dropzone:focus-within {
  outline: 3px solid rgba(var(--brand-primary-rgb), .16);
  outline-offset: 2px;
}
.product-image-dropzone input[type="file"] {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.product-image-dropzone-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(var(--brand-primary-rgb), .12);
  border-radius: 13px;
  background: #fff;
  color: var(--brand-primary);
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(20, 45, 78, .06);
}
.product-image-dropzone-copy {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.product-image-dropzone-copy strong {
  color: var(--brand-navy);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}
.product-image-dropzone-copy small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.product-image-dropzone-action {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(var(--brand-primary-rgb), .2);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-primary);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 750;
  white-space: nowrap;
}
.product-image-preview-panel {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 142px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfcfd;
  box-sizing: border-box;
}
.product-image-preview-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 5px;
}
.product-image-preview-empty-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eef3f7;
  color: #8293a5;
  font-size: 18px;
}
.product-image-preview-empty-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.product-image-preview-empty-copy strong {
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 750;
}
.product-image-preview-empty-copy small {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.5;
}
.product-image-preview-content {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
}
.product-image-preview-visual {
  display: grid;
  place-items: center;
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-primary);
}
.product-image-preview-visual img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 7px;
  object-fit: contain;
}
.product-image-preview-file-icon { font-size: 29px; }
.product-image-preview-details {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.product-image-preview-status {
  color: #27845e;
  font-size: 9px;
  font-weight: 750;
}
.product-image-preview-details strong {
  color: var(--brand-navy);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.product-image-preview-details > span:not(.product-image-preview-status) {
  color: var(--text-muted);
  font-size: 9px;
}
.product-image-preview-remove {
  align-self: flex-start;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c35b64;
  font-size: 9px;
  font-weight: 750;
}
.product-image-helper {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.5;
}
@media (max-width: 1199.98px) {
  .product-image-preview-visual { flex-basis: 92px; width: 92px; height: 92px; }
}
@media (max-width: 575.98px) {
  .product-image-dropzone { min-height: 132px; padding: 14px; grid-template-columns: 42px minmax(0, 1fr); gap: 8px 11px; }
  .product-image-dropzone-icon { width: 42px; height: 42px; font-size: 19px; }
  .product-image-preview-panel { min-height: 124px; padding: 10px; }
  .product-image-preview-visual { flex-basis: 82px; width: 82px; height: 82px; }
  .product-image-preview-content { gap: 10px; }
}


/* Institution branding: dedicated logo and icon image upload cards. */
.institution-branding-heading { display:flex;align-items:center;gap:11px;padding:3px 0 0;margin-top:3px; }
.institution-branding-heading-icon { width:34px;height:34px;display:grid;place-items:center;flex:0 0 auto;border-radius:10px;background:var(--brand-soft);color:var(--brand-primary);font-size:15px; }
.institution-branding-heading > div:last-child { display:flex;flex-direction:column;gap:3px;min-width:0; }
.institution-branding-heading strong { color:var(--brand-navy);font-size:12px;font-weight:800; }
.institution-branding-heading span { color:var(--text-muted);font-size:10px;line-height:1.45; }
.institution-asset-card { height:100%;min-width:0;padding:15px;border:1px solid var(--border);border-radius:14px;background:#fff; }
.institution-asset-card-head { display:flex;align-items:center;gap:10px;margin-bottom:12px; }
.institution-asset-icon { width:36px;height:36px;display:grid;place-items:center;flex:0 0 auto;border-radius:10px;background:var(--brand-soft);color:var(--brand-primary);font-size:16px; }
.institution-asset-card-head h4 { margin:0;color:var(--brand-navy);font-size:11px;font-weight:800; }
.institution-asset-card-head p { margin:3px 0 0;color:var(--text-muted);font-size:9px;line-height:1.45; }
.institution-asset-card .file-upload-layout { grid-template-columns:minmax(0,1fr);gap:9px;width:100%;min-width:0; }
.institution-asset-card .file-upload-zone { min-height:112px;padding:13px;gap:10px; }
.institution-asset-card .file-upload-symbol { width:38px;height:38px;font-size:17px; }
.institution-asset-card .file-upload-copy strong { font-size:11px; }
.institution-asset-card .file-upload-copy small { font-size:9px; }
.institution-asset-card .file-upload-action { padding:7px 8px;font-size:9px; }
.institution-asset-card .file-preview-panel { min-height:108px;padding:10px; }
.institution-asset-card .file-preview-visual { width:82px;height:82px; }
.institution-asset-card .file-preview-details strong { font-size:10px; }
.institution-asset-card .file-preview-details span { font-size:9px; }
.institution-asset-note { margin-top:9px;color:var(--text-muted);font-size:9px;line-height:1.45; }
.institution-asset-note i { color:var(--brand-primary); }
@media (max-width:575.98px) {
  .institution-asset-card { padding:12px; }
  .institution-asset-card .file-upload-zone { min-height:120px;padding:12px; }
  .institution-asset-card .file-preview-panel { min-height:100px; }
}

/* Shared record-detail components used by the Category and Unit modules. */
.detail-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--brand-primary-rgb), .12);
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-size: 23px;
}
.detail-title {
  margin: 0 0 5px;
  color: var(--brand-navy);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -.03em;
}
.detail-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.detail-label + strong {
  display: block;
  color: var(--brand-navy);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.stock-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}
.stock-kpi > span {
  color: var(--text-muted);
  font-size: 11px;
}
.stock-kpi > strong {
  color: var(--brand-navy);
  font-size: 23px;
  font-weight: 800;
}
.stock-kpi > strong small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}


/* Product catalogue visuals copied from the current store-management design. */
.product-thumb {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-size: 16px;
}
.product-thumb-image {
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
}
.product-hero {
  display: grid;
  place-items: center;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(var(--brand-primary-rgb), .12);
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-size: 34px;
}
.product-hero-image {
  display: block;
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  object-fit: contain;
  padding: 8px;
}
.sidebar-dropdown-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sidebar-dropdown-toggle .sidebar-chevron {
  width: auto;
  margin-left: auto;
  font-size: 11px;
  transition: transform .18s ease;
}
.sidebar-dropdown-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}
.sidebar-subnav {
  display: grid;
  gap: 3px;
  list-style: none;
  margin: 4px 0 2px 19px;
  padding: 0 0 0 12px;
  border-left: 1px solid rgba(231, 240, 248, .16);
}
.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(231, 240, 248, .66);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: .18s ease;
}
.sidebar-sublink i {
  width: 15px;
  color: rgba(231, 240, 248, .48);
  text-align: center;
}
.sidebar-sublink:hover,
.sidebar-sublink.active {
  background: rgba(8, 127, 140, .22);
  color: #fff;
}
.sidebar-sublink.active i {
  color: #6fe0dd;
}
.mobile-offcanvas .sidebar-sublink {
  color: rgba(231, 240, 248, .72);
}
.mobile-offcanvas .sidebar-sublink:hover,
.mobile-offcanvas .sidebar-sublink.active {
  color: #fff;
  background: rgba(255, 255, 255, .11);
}

/* Vendor return approval timeline and editable return-line layout. */
.vendor-return-item-row {
  background: #fbfcfd;
  border-color: var(--border) !important;
}
.vendor-return-item-row .form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-navy);
}
.timeline {
  display: grid;
  gap: 18px;
}
.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 42px;
}
.timeline-item:not(:last-child)::after {
  position: absolute;
  top: 34px;
  left: 15px;
  width: 1px;
  height: calc(100% + 2px);
  background: var(--border);
  content: "";
}
.timeline-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-primary);
}
.timeline-item strong {
  display: block;
  padding-top: 2px;
  color: var(--brand-navy);
  font-size: 12px;
}
.timeline-item small {
  margin-top: 3px;
  font-size: 10px;
}


/* App shell: keep the footer at the viewport bottom on short pages,
   while allowing it to flow below long page content without overlap. */
.app-layout {
  min-height: 100vh;
}

.main-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.main-area > .topbar {
  flex: 0 0 auto;
}

.main-area > .page-content {
  flex: 1 0 auto;
  width: 100%;
}

.main-area > .app-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 16px 28px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.app-footer .footer-separator {
  display: inline-block;
  margin: 0 5px;
  color: #a7b2bf;
}

@media (max-width: 767.98px) {
  .main-area > .app-footer {
    padding: 14px 16px 16px;
  }
}

/* Global, permission-aware header search. */
.global-search {
  z-index: 1045;
}

.global-search input {
  padding-right: 34px;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 1080;
  width: min(460px, calc(100vw - 32px));
  max-height: min(68vh, 520px);
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(20, 45, 78, .16);
}

.global-search-group {
  padding: 9px 10px 6px;
  color: #93a0ad;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.global-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-main);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.global-search-item:hover,
.global-search-item:focus,
.global-search-item.active {
  outline: 0;
  background: var(--brand-soft);
  color: var(--brand-primary-dark);
}

.global-search-item-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #f1f5f9;
  color: var(--brand-primary);
  font-size: 15px;
}

.global-search-item-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.global-search-item-content strong {
  overflow: hidden;
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-item-content small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-item-arrow {
  flex: 0 0 auto;
  color: #9aa8b7;
  font-size: 11px;
}

.global-search-empty,
.global-search-loading {
  padding: 20px 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

/* Password form uses the full content width instead of a narrow centred column. */
.change-password-page .row.g-0,
.change-password-page .col-12,
.change-password-card {
  width: 100%;
  max-width: none;
}

.change-password-fields {
  padding: 24px 20px;
}

@media (max-width: 767.98px) {
  .topbar-search {
    display: block;
    width: min(190px, 34vw);
    flex: 0 1 190px;
  }

  .topbar-left,
  .topbar-right {
    gap: 8px;
  }

  .topbar-search input {
    height: 36px;
    font-size: 11px;
  }

  .global-search-results {
    right: auto;
    left: 50%;
    width: min(420px, calc(100vw - 24px));
    transform: translateX(-50%);
  }
}

@media (max-width: 575.98px) {
  .topbar-search {
    width: min(150px, 34vw);
    flex-basis: 150px;
  }

  .mobile-brand .brand-title,
  .mobile-brand .brand-subtitle {
    display: none;
  }

  .topbar {
    gap: 8px;
  }

  .change-password-fields {
    padding: 18px 15px;
  }
}


/* Typography refinement: slightly larger navigation, page copy and table data. */
body {
  font-size: 15px;
}

.sidebar-section-title {
  font-size: 11px;
}

.sidebar-link {
  font-size: 14px;
}

.sidebar-sublink {
  font-size: 12px;
}

.sidebar-dropdown-toggle .sidebar-chevron {
  font-size: 12px;
}

.topbar-search input {
  font-size: 13px;
}

.profile-meta strong {
  font-size: 13px;
}

.profile-meta span {
  font-size: 11px;
}

.page-heading p {
  font-size: 13px;
}

.breadcrumb-line {
  font-size: 12px;
}

.card-title {
  font-size: 15px;
}

.card-subtitle,
.stat-label {
  font-size: 12px;
}

.stat-foot {
  font-size: 11px;
}

.small-label {
  font-size: 12px;
}

.btn {
  font-size: 13px;
}

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

.form-label {
  font-size: 12px;
}

.form-control,
.form-select {
  font-size: 13px;
}

.form-text {
  font-size: 11px;
}

/* Table headings and live database values are easier to read. */
.table thead th {
  font-size: 11px;
}

.table tbody td {
  font-size: 13px;
}

.table .primary-text,
.table-user strong {
  font-size: 13px;
}

.table-user span {
  font-size: 11px;
}

.status-pill,
.role-tag {
  font-size: 11px;
}

.toolbar .form-control,
.toolbar .form-select {
  font-size: 12px;
}

.page-link {
  font-size: 12px;
}

.custom-pagination-info {
  font-size: 11px;
}

.custom-pagination button {
  font-size: 11px;
}

.empty-note {
  font-size: 12px;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  font-size: 13px !important;
}

.choices__list--multiple .choices__item {
  font-size: 11px !important;
}

.file-upload-copy strong {
  font-size: 13px;
}

.file-upload-copy small {
  font-size: 11px;
}

.file-upload-action {
  font-size: 11px;
}

.file-preview-empty strong {
  font-size: 11px;
}

.file-preview-empty small {
  font-size: 10px;
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item small {
  font-size: 11px;
}

.main-area > .app-footer {
  font-size: 12px;
}
