/* =====================================================================
   HAMZAIF TECHNOLOGIES — shared THEME (white + navy)
   Same look as HamZaif Point of Sale. Loaded LAST on every AMS page so
   it overrides the old red theme. Brand tokens live here.
   ===================================================================== */
:root {
  --brand: #1F2557;
  --brand-2: #2F3679;
  --brand-accent: #3F4C9E;
  --navy: #0E1330;

  /* legacy AMS variable names -> now navy */
  --red: #1F2557;
  --red-dark: #141A45;
  --red-light: #3F4C9E;
  --red-pale: #EEF0FA;
  --accent: #1F2557;
  --accent2: #2F3679;
  --accent-dim: rgba(31, 37, 87, 0.06);

  --white: #FFFFFF;
  --off-white: #F6F7FB;
  --bg: #F6F7FB;
  --surface2: #F8F9FC;
  --surface3: #F0F2F7;
  --border: #E8EAF1;
  --border2: #DCDFE8;
  --text: #121733;
  --text-2: #4B526B;
  --text-muted: #7A8099;
  --text3: #7A8099;

  /* real danger red (delete / error / out of stock) stays red */
  --danger: #D64550;
  --danger-dim: rgba(214, 69, 80, 0.08);

  --shadow-sm: 0 1px 2px rgba(18, 23, 51, .04), 0 4px 14px rgba(18, 23, 51, .05);
  --shadow-md: 0 1px 2px rgba(18, 23, 51, .04), 0 8px 24px -12px rgba(18, 23, 51, .12);
  --shadow-lg: 0 30px 80px -24px rgba(13, 18, 36, .30);
  --shadow-accent: 0 10px 30px -10px rgba(31, 37, 87, .35);
  --radius: 14px;
  --radius-sm: 10px;

  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, .8, .28, 1);
}

/* dark mode keeps a lighter indigo so navy buttons / text stay readable */
body.dark-mode {
  --red: #5B5FE6;
  --red-dark: #4348C9;
  --red-light: #7F89F0;
  --red-pale: rgba(91, 95, 230, .14);
  --brand: #8F9AF5;
}

html, body, button, input, select, textarea {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
code, pre, kbd, samp, .mono { font-family: var(--font-mono); }
::selection { background: rgba(91, 95, 230, .18); }
::-webkit-scrollbar-thumb { background: #CDD0DB; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-accent); }

/* =====================================================================
   LOADING SCREEN (same animation as the POS / HamZaif website)
   ===================================================================== */
.hz-loader {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; overflow: hidden;
  transition: opacity .8s var(--ease), visibility .8s, transform .9s var(--ease);
}
.hz-loader.done { opacity: 0; visibility: hidden; transform: scale(1.03); pointer-events: none; }
.ld-row { --nm: 2.9rem; --sb: .6rem; position: relative; display: flex; align-items: center; gap: 20px; padding: 4px 6px; margin-bottom: 40px; }
.ld-mark { position: relative; top: 2px; flex-shrink: 0; width: 96px; height: 96px;
  border-radius: 50%; padding: 4px; border: 2.5px solid var(--brand); opacity: 0; transform: scale(.85); filter: blur(8px); animation: ldin 1s var(--ease) .2s forwards; }
.ld-mark img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; display: block; object-fit: cover; }
.ld-words { display: inline-flex; flex-direction: column; justify-content: center; align-items: stretch; opacity: 0; transform: translateX(-12px); filter: blur(6px); animation: ldin .9s var(--ease) .5s forwards; }
.ld-name { font-family: var(--font-display); font-weight: 800; font-size: var(--nm); line-height: .95; letter-spacing: .035em; margin-right: -.035em; color: var(--brand); text-transform: uppercase; }
.ld-sub { position: relative; display: block; margin-top: 9px; font-family: var(--font-display); font-weight: 700; font-size: var(--sb); line-height: 1; color: var(--brand); text-transform: uppercase; }
.ld-letters { display: flex; justify-content: space-between; }
.ld-letters i, .lk-sub i { font-style: normal; }
.ld-letters i.sp { width: .55em; }
.ld-bar { position: absolute; left: 0; right: 0; top: calc(100% + 12px); height: 3px; border-radius: 3px; background: #E6E7F1; overflow: hidden; }
.ld-bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); border-radius: 3px; background: var(--brand); }
.ld-pct { position: absolute; left: 0; top: calc(100% + 24px); font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: #8A8EB5; font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.ld-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ld-sweep { position: absolute; top: -20%; bottom: -20%; left: -30%; width: 26%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-16deg); animation: ldsweep 3.2s cubic-bezier(.45,0,.25,1) 1.3s infinite; }
.hz-loader .loader-status { position: absolute; bottom: 36px; font-size: 12px; color: #8A8EB5; font-family: var(--font-body); letter-spacing: .04em; min-height: 16px; }
.hz-loader .loader-powered { position: absolute; bottom: 62px; font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #B5B8D3; }
@keyframes ldsweep { 0% { left: -30%; } 70%, 100% { left: 115%; } }
@keyframes ldin { to { opacity: 1; transform: none; filter: none; } }
@media (max-width: 520px) {
  .ld-row { gap: 14px; --nm: 2rem; --sb: .43rem; }
  .ld-mark { width: 70px; height: 70px; padding: 3px; border-width: 2px; top: 2px; }
}
@media (prefers-reduced-motion: reduce) { .ld-mark, .ld-words { opacity: 1; transform: none; filter: none; animation: none; } .ld-sweep { display: none; } }

/* =====================================================================
   LOGO LOCKUP (round mark + name over spread letters)
   ===================================================================== */
.lockup { --nm: 1.3rem; --sb: .46rem; display: flex; align-items: center; gap: 11px; text-decoration: none; }
.lk-mark { position: relative; top: 1px; flex-shrink: 0; width: calc((var(--nm) * .95 + 4px + var(--sb)) * 1.38); height: calc((var(--nm) * .95 + 4px + var(--sb)) * 1.38);
  border-radius: 50%; padding: 2px; border: 1.5px solid var(--brand); transition: transform .45s cubic-bezier(.34,1.56,.64,1), box-shadow .45s var(--ease); background: #fff; }
.lk-mark img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; }
.lockup:hover .lk-mark { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(91,95,230,.14); }
.lk-words { display: inline-flex; flex-direction: column; align-items: stretch; }
.lk-name { font-family: var(--font-display); font-weight: 800; font-size: var(--nm); line-height: .95; letter-spacing: .035em; margin-right: -.035em; color: var(--brand); text-transform: uppercase; }
.lk-sub { margin-top: 4px; display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: var(--sb); line-height: 1; color: var(--brand); text-transform: uppercase; }
.lk-sub i.sp { width: .5em; }
.lockup-lg { --nm: 2rem; --sb: .7rem; gap: 14px; justify-content: center; }
.lockup-white .lk-name, .lockup-white .lk-sub { color: #fff; }
.lockup-white .lk-mark { border-color: rgba(255,255,255,.85); }

/* =====================================================================
   AUTH PAGES (login / create account) — same as POS login
   ===================================================================== */
body.hz-auth, .hz-auth *, .hz-auth *::before, .hz-auth *::after { box-sizing: border-box; }
body.hz-auth { margin: 0; min-height: 100vh; background: #F5F6FB; color: var(--text); display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; position: relative; }
.hz-auth .login-bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.hz-auth .login-aurora { position: absolute; inset: -20%; animation: hzHue 18s ease-in-out infinite; }
.hz-auth .login-aurora i { position: absolute; border-radius: 50%; opacity: .55; filter: blur(80px); }
.hz-auth .login-aurora i:nth-child(1) { width: 46%; height: 52%; left: 4%;  top: 8%;  background: #6E7FF3; animation: lgA 18s ease-in-out infinite alternate; }
.hz-auth .login-aurora i:nth-child(2) { width: 40%; height: 48%; right: 6%; top: 4%;  background: #F78DA7; animation: lgB 22s ease-in-out infinite alternate; }
.hz-auth .login-aurora i:nth-child(3) { width: 42%; height: 46%; left: 18%; bottom: 2%; background: #34C38F; opacity: .4; animation: lgB 20s ease-in-out infinite alternate-reverse; }
.hz-auth .login-aurora i:nth-child(4) { width: 36%; height: 42%; right: 14%; bottom: 6%; background: #F6B44B; opacity: .45; animation: lgA 24s ease-in-out infinite alternate-reverse; }
@keyframes lgA { to { transform: translate(14%, 10%) scale(1.15); } }
@keyframes lgB { to { transform: translate(-12%, 8%) scale(.9); } }
@keyframes hzHue { 0%, 100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(-14deg); } }
@keyframes hzFlow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hz-auth .login-grid { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(31,37,87,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(31,37,87,.05) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.hz-auth .login-card {
  position: relative; z-index: 1; width: 420px; max-width: 100%; text-align: center; margin: auto;
  padding: 38px 36px 26px; border-radius: 26px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 40px 90px -40px rgba(31,37,87,.45);
  animation: riseIn .7s var(--ease) both;
}
.hz-auth .login-card.wide { width: 520px; }
.hz-auth .login-logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-product {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-dim); color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.login-product::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-accent); }
.hz-auth .login-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-bottom: 6px; }
.hz-auth .login-desc { font-size: 13px; text-align: center; margin-bottom: 24px; color: var(--text-muted); line-height: 1.55; }
.hz-auth .form-group { text-align: left; margin-bottom: 14px; }
.hz-auth .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hz-auth .form-label { display: block; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.hz-auth .input-wrap { position: relative; }
.hz-auth .form-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; font-size: 14px; color: var(--text);
  background: rgba(255,255,255,.95); border: 1px solid var(--border2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.hz-auth .form-input::placeholder { color: #A3A8BE; }
.hz-auth .form-input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(91, 95, 230, .14); }
.hz-auth .input-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-accent); padding: 6px 8px; border-radius: 8px;
}
.hz-auth .input-toggle:hover { background: var(--accent-dim); }
.hz-auth .btn-primary, .hz-auth .btn-login {
  width: 100%; height: 50px; border-radius: 14px; font-size: 15px; font-weight: 700; margin-top: 6px; border: 0; color: #fff; cursor: pointer;
  background: linear-gradient(120deg, #3E4C8F, #5B6CF0, #2F3679, #3E4C8F); background-size: 300% 300%;
  animation: hzFlow 8s ease-in-out infinite; box-shadow: 0 16px 30px -16px rgba(62,76,143,.8); transition: transform .15s, filter .15s;
}
.hz-auth .btn-primary:hover, .hz-auth .btn-login:hover { filter: brightness(1.06); transform: translateY(-1px); }
.hz-auth .btn-primary:disabled, .hz-auth .btn-login:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.hz-auth .error-msg, .hz-auth .login-error { display: none; margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #B32F39; background: var(--danger-dim); border: 1px solid rgba(214,69,80,.25); text-align: center; }
.hz-auth .login-switch { margin-top: 18px; font-size: 13px; color: var(--text-muted); text-align: center; }
.hz-auth .login-switch a { color: var(--brand-accent); font-weight: 700; text-decoration: none; }
.hz-auth .login-switch a:hover { text-decoration: underline; }
.hz-auth .login-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); letter-spacing: .02em; }
.hz-auth .loader-overlay { position: fixed; inset: 0; z-index: 50; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(14, 19, 48, .45); backdrop-filter: blur(6px); }
.hz-auth .loader-overlay.show { display: flex; }
.hz-auth .loader-overlay .spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: hzspin .8s linear infinite; }
.hz-auth .loader-overlay .loader-text { color: #fff; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
@keyframes hzspin { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  body.hz-auth { padding: 14px; }
  .hz-auth .login-card, .hz-auth .login-card.wide { width: 100%; padding: 30px 22px 22px; border-radius: 22px; }
  .hz-auth .form-row { grid-template-columns: 1fr; gap: 0; }
  .lockup-lg { --nm: 1.6rem; --sb: .56rem; }
}
@media (prefers-reduced-motion: reduce) { .hz-auth .login-aurora, .hz-auth .login-aurora i, .hz-auth .btn-primary, .hz-auth .btn-login { animation: none !important; } }

/* danger toasts / errors keep the real red */
.toast.error { border-left-color: var(--danger) !important; }

/* =====================================================================
   APP SHELL (dashboard + inner pages) — POS-style header, sidebar,
   cards, tables, buttons, modals. Loaded last so it wins over the
   page's own <style> blocks.
   ===================================================================== */
:root { --header: rgba(255,255,255,.92); --header-h: 64px; --navy2: #141A45; }
html, body { font-family: var(--font-body); }
body:not(.hz-auth) { background: var(--bg); color: var(--text); }

/* ---------- header / topbar: white glass bar, navy text ---------- */
header, .topbar {
  background: rgba(255,255,255,.92) !important; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 var(--border) !important; height: var(--header-h) !important; color: var(--text);
}
header { padding: 0 20px !important; }
.header-left, .h-left, .topbar-left { gap: 14px; }
.hz-hdr-lockup { --nm: 1.15rem; --sb: .4rem; gap: 10px; }
.hz-sb-lockup { --nm: 1.2rem; --sb: .42rem; gap: 10px; }
.hz-page-title { font-weight: 800; font-size: 15px; letter-spacing: -.01em; color: var(--text); padding-left: 14px; border-left: 1px solid var(--border2); line-height: 1.1; }
.h-sub { color: var(--text-muted) !important; font-size: 11px !important; letter-spacing: .08em !important; font-weight: 700 !important; border-left: 1px solid var(--border2); padding-left: 14px; }
.header-brand, .h-brand, .topbar-brand { color: var(--brand) !important; font-weight: 800 !important; }
.header-badge, .h-pill, .topbar-badge, .animated-badge {
  background: var(--accent-dim) !important; color: var(--brand) !important; border: 1px solid rgba(31,37,87,.14) !important;
  font-weight: 700 !important; letter-spacing: .04em; animation: none !important;
}
.hamburger-btn {
  width: 42px !important; height: 42px !important; border-radius: 12px !important; border: 1px solid var(--border2) !important; background: #fff !important;
  display: inline-flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; transition: all .2s;
}
.hamburger-btn span { display: block; width: 18px !important; height: 2px !important; border-radius: 2px; background: var(--brand) !important; }
.hamburger-btn:hover { border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--accent-dim); }
/* header buttons */
.h-btn-ghost, .btn-theme, .btn-back, .btn-dashboard, .btn-it-support, .btn-issued-stock, .btn-export,
header .btn-logout, header .btn-outline {
  background: #fff !important; color: var(--text-2) !important; border: 1px solid var(--border2) !important; border-radius: 10px !important; font-weight: 600 !important; box-shadow: none !important;
}
.h-btn-ghost:hover, .btn-theme:hover, .btn-back:hover, .btn-dashboard:hover, .btn-it-support:hover, .btn-issued-stock:hover, .btn-export:hover, header .btn-logout:hover {
  background: var(--surface2) !important; color: var(--brand) !important; border-color: var(--brand) !important;
}
.h-btn-red { background: var(--brand) !important; color: #fff !important; border-radius: 10px !important; font-weight: 700 !important; box-shadow: 0 1px 2px rgba(13,18,36,.1), inset 0 1px 0 rgba(255,255,255,.12); }
.h-btn-red:hover { background: var(--brand-2) !important; box-shadow: var(--shadow-accent); }
.profile-chip, .topbar-user { background: #fff !important; border: 1px solid var(--border2) !important; border-radius: 999px !important; color: var(--text) !important; }
.profile-name, .topbar-uname { color: var(--text) !important; font-weight: 700 !important; }
.profile-role, .topbar-role { color: var(--text-muted) !important; }
.profile-avatar, .topbar-avatar { background: var(--brand) !important; color: #fff !important; }

/* ---------- sidebar drawer ---------- */
.sidebar-drawer, .sidebar { font-family: var(--font-body); }
.sidebar-drawer { background: #fff !important; border-right: 1px solid var(--border); box-shadow: var(--shadow-lg) !important; }
.sidebar-header { background: #fff !important; border-bottom: 1px solid var(--border) !important; }
.sidebar-brand { display: flex; align-items: center; }
.sidebar-close-btn { background: #fff !important; border: 1px solid var(--border2) !important; color: var(--text-2) !important; }
.sidebar-overlay { background: rgba(14,19,48,.30) !important; backdrop-filter: blur(2px); }
.sidebar-profile { background: var(--surface2) !important; border: 1px solid var(--border) !important; }
.sidebar-avatar { background: var(--brand) !important; color: #fff !important; }
.sidebar-section-label { color: var(--text-muted) !important; font-weight: 700 !important; letter-spacing: .1em !important; }
.sidebar-item { border-radius: 10px !important; font-weight: 600 !important; }
.sidebar-item:hover { background: var(--surface2) !important; }
.sidebar-item-label { color: var(--text-2) !important; font-weight: 600 !important; }
.sidebar-item:hover .sidebar-item-label { color: var(--brand) !important; }
.sidebar-item-active { background: var(--accent-dim) !important; box-shadow: none !important; border: 1px solid rgba(31,37,87,.15) !important; }
.sidebar-item-active .sidebar-item-label { color: var(--brand) !important; font-weight: 800 !important; }
.sidebar-logo-wrap { display: none !important; }
.sidebar-logout-btn { border-radius: 10px !important; font-weight: 700 !important; }
/* admin-settings left rail */
.sidebar { background: #fff; }
.nav-btn { border-radius: 10px; font-weight: 600; }
.nav-btn:hover { background: var(--surface2); color: var(--brand); }
.nav-btn.active { background: var(--accent-dim) !important; color: var(--brand) !important; border-color: rgba(31,37,87,.15) !important; }

/* ---------- headings, cards, tables ---------- */
.section-title, .table-title, .card-title, .form-title, .modal-title, h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.015em; }
.section-title { font-weight: 800; color: var(--text); }
.table-section, .table-card, .table-wrap, .card, .kpi-card, .summary-strip > *, .summary-box, .form-section, .section, .modal {
  border-color: var(--border) !important; box-shadow: 0 1px 2px rgba(18,23,51,.04), 0 6px 18px -10px rgba(18,23,51,.08);
}
.table-section, .table-card, .card, .kpi-card, .form-section, .summary-box { border-radius: 16px !important; background: #fff; }
.kpi-val { font-weight: 800; letter-spacing: -.02em; }
.kpi-label, .card-sub, .table-sub, .section-sub { color: var(--text-muted); }
table { font-family: var(--font-body); }
thead th, table th {
  background: var(--surface2) !important; color: var(--text-2) !important; font-weight: 700 !important; font-size: 11.5px !important;
  letter-spacing: .06em !important; text-transform: uppercase; border-bottom: 1px solid var(--border2) !important;
}
tbody tr:hover td { background: var(--surface2) !important; }
td { border-color: var(--border) !important; }
.search-box input, .search-box, input[type=search] { border-radius: 10px; }
input, select, textarea, .form-control, .form-input { font-family: var(--font-body); }
input:focus, select:focus, textarea:focus, .form-control:focus { border-color: var(--brand-accent) !important; box-shadow: 0 0 0 3px rgba(91,95,230,.14) !important; outline: none; }

/* ---------- buttons ---------- */
.btn-primary, .btn-save, .btn-submit, .btn-success, .btn-save-perms, .btn-create-user, .btn-update-pass, .card-save, .section-btn.primary {
  background: var(--brand) !important; color: #fff !important; border-radius: 10px !important; font-weight: 700 !important; letter-spacing: -.01em;
  border: 0 !important; box-shadow: 0 1px 2px rgba(13,18,36,.1), inset 0 1px 0 rgba(255,255,255,.12) !important;
}
.btn-primary:hover, .btn-save:hover, .btn-submit:hover, .btn-success:hover, .btn-save-perms:hover, .btn-create-user:hover, .btn-update-pass:hover {
  background: var(--brand-2) !important; box-shadow: var(--shadow-accent) !important;
}
.btn-outline, .btn-cancel, .btn-cancel-user, .btn-sm.btn-outline { border-radius: 10px !important; font-weight: 700 !important; border: 1px solid var(--border2) !important; background: #fff !important; color: var(--text-2) !important; }
.btn-outline:hover, .btn-cancel:hover { border-color: var(--brand) !important; color: var(--brand) !important; background: var(--surface2) !important; }
.btn-danger, .btn-clear-logs { background: var(--danger) !important; color: #fff !important; border-radius: 10px !important; }

/* ---------- modals ---------- */
.modal-overlay { background: rgba(14,19,48,.45) !important; backdrop-filter: blur(4px); }
.modal { border-radius: 18px !important; box-shadow: var(--shadow-lg) !important; }
.modal-head, .modal-header { border-bottom: 1px solid var(--border) !important; }
.modal-footer { border-top: 1px solid var(--border) !important; }
.modal-close { border-radius: 10px !important; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  header { padding: 0 12px !important; } .header-badge, .h-pill, .h-sub, .hz-page-title, .animated-badge { display: none !important; }
  .hz-hdr-lockup { --nm: 1rem; --sb: .36rem; gap: 8px; }
}
@media (max-width: 380px) { .hz-hdr-lockup .lk-words { display: none; } }

/* ---------- dark mode ---------- */
body.dark-mode { --bg: #0C0F1F; --surface2: #151A31; --surface3: #1B2140; --border: #242A47; --border2: #2E3558; --text: #E8EAF6; --text-2: #B3B8D6; --text-muted: #7E85A8; --accent-dim: rgba(143,154,245,.14); --brand-2: #7F89F0; --brand-accent: #8F9AF5; }
body.dark-mode header, body.dark-mode .topbar { background: rgba(14,18,38,.92) !important; border-bottom-color: var(--border); box-shadow: 0 1px 0 var(--border) !important; }
body.dark-mode .lk-name, body.dark-mode .lk-sub { color: #E8EAF6; }
body.dark-mode .lk-mark { border-color: #8F9AF5; background: #fff; }
body.dark-mode .hz-page-title { color: var(--text); border-left-color: var(--border2); }
body.dark-mode .sidebar-drawer, body.dark-mode .sidebar, body.dark-mode .sidebar-header { background: #0E1226 !important; }
body.dark-mode .hamburger-btn, body.dark-mode .h-btn-ghost, body.dark-mode .btn-theme, body.dark-mode .btn-back, body.dark-mode .profile-chip, body.dark-mode .topbar-user,
body.dark-mode header .btn-logout, body.dark-mode .btn-outline, body.dark-mode .btn-cancel, body.dark-mode .sidebar-close-btn { background: #151A31 !important; color: var(--text-2) !important; border-color: var(--border2) !important; }
body.dark-mode .btn-primary, body.dark-mode .btn-save, body.dark-mode .btn-submit, body.dark-mode .btn-success, body.dark-mode .h-btn-red { background: #5B5FE6 !important; }
body.dark-mode .table-section, body.dark-mode .table-card, body.dark-mode .card, body.dark-mode .kpi-card, body.dark-mode .form-section, body.dark-mode .summary-box, body.dark-mode .modal { background: #121733 !important; }
body.dark-mode .sidebar-item-label { color: var(--text-2) !important; }
body.dark-mode .sidebar-item-active { background: rgba(143,154,245,.16) !important; }
body.dark-mode .sidebar-item-active .sidebar-item-label, body.dark-mode .sidebar-item:hover .sidebar-item-label { color: #fff !important; }
body.dark-mode thead th, body.dark-mode table th { background: #151A31 !important; }

/* ---------- header action buttons: beat the pages' own .header-right rules ---------- */
html body header :is(.header-right, .h-right) :is(button, a):not(.h-btn-red):not(.btn-primary):not(.hamburger-btn),
html body header .btn-logout, html body header .btn-theme {
  background: #fff !important; color: var(--text-2) !important; border: 1px solid var(--border2) !important; border-radius: 10px !important;
  font-weight: 600 !important; box-shadow: none !important; text-shadow: none !important; backdrop-filter: none !important;
}
html body header :is(.header-right, .h-right) :is(button, a):not(.h-btn-red):not(.btn-primary):not(.hamburger-btn):hover,
html body header .btn-logout:hover, html body header .btn-theme:hover {
  background: var(--surface2) !important; color: var(--brand) !important; border-color: var(--brand) !important; transform: none !important;
}
html body header .btn-theme *, html body header .btn-logout * { color: inherit !important; }
html body header .btn-theme::before, html body header .btn-theme::after, html body header .btn-logout::before, html body header .btn-logout::after { display: none !important; }
html body header .profile-chip { background: #fff !important; border: 1px solid var(--border2) !important; box-shadow: none !important; }
html body header .profile-chip:hover { border-color: var(--brand) !important; }
html body header .profile-avatar { background: var(--brand) !important; color: #fff !important; }
html body header .profile-name { color: var(--text) !important; } html body header .profile-role { color: var(--text-muted) !important; }
body.dark-mode header :is(.header-right, .h-right) :is(button, a):not(.h-btn-red):not(.btn-primary):not(.hamburger-btn),
body.dark-mode header .btn-logout, body.dark-mode header .btn-theme, body.dark-mode header .profile-chip { background: #151A31 !important; color: var(--text-2) !important; border-color: var(--border2) !important; }
body.dark-mode header .profile-name { color: var(--text) !important; }
.sidebar-drawer:not(.open){box-shadow:none!important}

/* ---------- KPI cards: POS style (no rainbow top bar, tinted icon tile) ---------- */
.s-card, .kpi-card { border-radius: 16px !important; background: #fff; border: 1px solid var(--border) !important; }
.s-card::after, .kpi-card::before { display: none !important; }
.s-card:hover, .kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.s-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-dim); display: grid; place-items: center; font-size: 20px; margin-bottom: 10px; }
.s-card.c-green .s-icon { background: rgba(52,195,143,.14); } .s-card.c-blue .s-icon { background: rgba(79,124,240,.13); }
.s-card.c-amber .s-icon { background: rgba(246,180,75,.18); } .s-card.c-purple .s-icon { background: rgba(139,108,240,.14); }
.s-val, .kpi-val { font-weight: 800 !important; letter-spacing: -.02em; color: var(--text); }
.s-label, .kpi-label { font-weight: 700; color: var(--text-2); }
body.dark-mode .s-card, body.dark-mode .kpi-card { background: #121733 !important; }

/* auth pages keep the animated gradient button (the app-shell .btn-primary rule above must not flatten it) */
body.hz-auth .btn-primary, body.hz-auth .btn-login {
  background: linear-gradient(120deg, #3E4C8F, #5B6CF0, #2F3679, #3E4C8F) !important; background-size: 300% 300% !important;
  box-shadow: 0 16px 30px -16px rgba(62,76,143,.8) !important; border-radius: 14px !important;
}

/* dark mode: remaining primary-style buttons + admin title */
body.dark-mode .btn-save-perms, body.dark-mode .btn-create-user, body.dark-mode .btn-update-pass, body.dark-mode .card-save { background: #5B5FE6 !important; color: #fff !important; }
body.dark-mode .page-title, body.dark-mode .section-title, body.dark-mode .table-title { color: var(--text) !important; }
