*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  /* Bagani Brand - teal from butterfly body */
  --teal:#1a9e96;--teal-dark:#0e7c75;--teal-light:#d0f4f2;--teal-mid:#5ecec8;
  /* Sidebar light - soft cream-teal matching butterfly logo body */
  --sidebar-bg-1:#f0faf8;       /* very light teal, top of gradient   */
  --sidebar-bg-2:#dff3f0;       /* slightly deeper teal, bottom       */
  --sidebar-border:#b8e0db;     /* soft teal divider line             */
  --sidebar-text:#2d4a47;       /* dark teal for body nav text        */
  --sidebar-text-muted:#5d7a76; /* softer teal-gray for sub-labels    */
  /* Kept for compatibility with the rest of the system               */
  --navy:#3a1a35;--navy-mid:#52284c;--navy-light:#6b3563;
  --slate:#7a6678;--slate-light:#b09aaa;
  --white:#ffffff;--off-white:#fdf8fc;--border:#edd8e8;
  /* Danger - coral/red from butterfly wings */
  --danger:#d94f4f;--danger-light:#fde8e8;
  /* Warning - golden yellow from butterfly outer wings */
  --warning:#e8a020;--warning-light:#fff3d0;
  /* Success - warm green from butterfly lower wings */
  --success:#4a9e6a;--success-light:#d5f0e0;
  /* Info - soft teal-blue */
  --info:#2196a0;--info-light:#d5eef2;
  /* Accent gold */
  --gold:#f0b429;--gold-light:#fff8e1;
  /* Coral accent */
  --coral:#d95f52;--coral-light:#fde9e7;
  --radius:12px;--radius-sm:8px;
  --shadow:0 1px 3px rgba(58,26,53,.08),0 1px 2px rgba(58,26,53,.04);
  --shadow-md:0 4px 6px rgba(58,26,53,.07),0 2px 4px rgba(58,26,53,.05);
  --shadow-lg:0 10px 25px rgba(58,26,53,.12),0 4px 10px rgba(58,26,53,.06);
  --font:'Sora',sans-serif;--mono:'Sora',sans-serif; /* only two fonts in the app: numbers use Sora too */
  /* Titles only: Playfair Display is a display serif and gets hard to read in small UI text */
  --font-display:'Playfair Display',Georgia,'Times New Roman',serif;
}
/* ===== TYPE SCALE =====
   Titles (Playfair Display 700): landing headline 52 · landing sections 32 · page title 24 · card/section titles 18 (16 on phones)
   Text (Sora): body 15 (14 on phones) · labels 12.5–13 · table headers 12.5 caps · buttons 15
   Numbers (Sora, via --mono, with tabular figures so digits line up): stat values 32 (22 on phones)
   Only two fonts are used in the app: Playfair Display and Sora. */
.page-title, .mobile-page-title, .mobile-greeting-name, .card-title, .modal-title, .pd-section-title,
.login-title-modern, .brand-headline-modern, .landing-page h1, .landing-page h2, .landing-page h3 {
  font-family: var(--font-display); letter-spacing: 0;
}
/* Aliases used by individual pages. Declared on body too so they pick up role, scheme and dark-mode
   overrides (a var() alias resolves where it is declared, not where it is inherited). */
:root, body {
  --primary: var(--teal); --red: var(--danger); --blue: var(--info); --blue-light: var(--info-light);
  --gray: var(--slate); --text-muted: var(--slate); --bg-body: var(--off-white); --burgundy: var(--navy-mid);
  --purple: #8e44ad; --purple-light: #f3e8fb; --radius-lg: 16px;
}
[data-theme="dark"] body { --purple: #c08ae0; --purple-light: #2a1533; }
/* ===== DARK MODE VARIABLES ===== */
[data-theme="dark"] {
  --sidebar-bg-1:#111e1d;
  --sidebar-bg-2:#223835;
  --sidebar-border:#182a29;
  --sidebar-text:#b8e0db;
  --sidebar-text-muted:#6b9a94;
  --navy:#e8f4f3;
  --navy-mid:#c0e0dc;
  --navy-light:#96cac5;
  --slate:#8baaa6;
  --slate-light:#4a706b;
  --white:#111e1d;
  --off-white:#0d1918;
  --border:#182a29;
  --teal:#2ec8be;
  --teal-dark:#1fa89f;
  --teal-light:#0e2e2c;
  --teal-mid:#1d7a75;
  --gold:#f0c040;
  --gold-light:#1a1500;
  --coral:#e8705a;
  --coral-light:#1e0c09;
  --danger:#f07070;
  --danger-light:#1f0808;
  --warning:#f0b840;
  --warning-light:#1a1200;
  --success:#5cc48a;
  --success-light:#081a10;
  --info:#4ab8c8;
  --info-light:#061418;
}
[data-theme="dark"] body { background:#0d1918; color:#e2f0ef; }
[data-theme="dark"] .card { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .topbar { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .modal { background:#111e1d; border-color:#182a29; color:#e2f0ef; }
[data-theme="dark"] .modal-header { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .modal-footer { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .modal-title { color:#e2f0ef; }
[data-theme="dark"] .form-control { background:#0d1918; border-color:#182a29; color:#e2f0ef; }
[data-theme="dark"] .form-control:focus { border-color:var(--coral); background:#0d1918; }
[data-theme="dark"] .form-control option { background:#111e1d; color:#e2f0ef; }
[data-theme="dark"] thead { background:#0d1918; }
[data-theme="dark"] tbody tr:hover { background:#162524; }
[data-theme="dark"] th { color:#7a9e9b; border-color:#182a29; }
[data-theme="dark"] td { border-color:#182a29; color:#e2f0ef; }
[data-theme="dark"] .sidebar-user { background:rgba(0,0,0,.15); border-color:#182a29; }
[data-theme="dark"] .table-wrapper { border-color:#182a29; }
[data-theme="dark"] .search-bar { background:#0d1918; border-color:#182a29; }
[data-theme="dark"] .search-bar input { color:#e2f0ef; }
[data-theme="dark"] .search-bar:focus-within { background:#111e1d; }
[data-theme="dark"] .stat-card { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .stat-value { color:#e2f0ef; }
[data-theme="dark"] .badge-gray { background:#162423; color:#b8d8d5; border: 1px solid #182a29; }
[data-theme="dark"] .btn-outline { background:#111e1d; color:#a8d8d4; border-color:#182a29; }
[data-theme="dark"] .btn-outline:hover { background:#0e2e2c; border-color:var(--gold); color:var(--gold); }
[data-theme="dark"] .btn-ghost { color:#7a9e9b; }
[data-theme="dark"] .btn-ghost:hover { background:#162524; color:#e2f0ef; }
[data-theme="dark"] .arch-card { background:#0d1918; border-color:#182a29; }
[data-theme="dark"] .arch-card p { color:#7a9e9b; }
[data-theme="dark"] .demo-accounts-modern { background:#0d1918; border-color:#182a29; }
[data-theme="dark"] .demo-account-modern { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .demo-account-modern:hover { background:#0e2e2c; border-color:var(--teal); }
[data-theme="dark"] .login-form-panel-modern { background:#111e1d; }
[data-theme="dark"] .login-brand-panel { background: linear-gradient(135deg, #111e1d 0%, #182a29 50%, #0d1918 100%); }
[data-theme="dark"] .login-title-modern, [data-theme="dark"] .form-label-modern, [data-theme="dark"] .demo-name-modern { color: #e2f0ef; }
[data-theme="dark"] .login-sub-modern, [data-theme="dark"] .demo-role, [data-theme="dark"] .demo-label-modern { color: #7a9e9b; }
[data-theme="dark"] .form-control-modern { background: #0d1918; border-color:#182a29; color: #e2f0ef; }
[data-theme="dark"] .form-control-modern:focus { background: #111e1d; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(46,200,190,0.1); }
[data-theme="dark"] .nav-item:hover { background:rgba(46,200,190,.1); color:var(--teal); }
[data-theme="dark"] .logout-btn:hover { background:rgba(240,112,112,.1); color:var(--danger); }
[data-theme="dark"] .alert-warning { background:#1a1200; border-color:#5a3e00; color:#f0c040; }
[data-theme="dark"] .alert-danger { background:#1f0808; border-color:#5a1010; color:#f07070; }
[data-theme="dark"] .alert-success { background:#081a10; border-color:#0e4020; color:#5cc48a; }
[data-theme="dark"] .alert-info { background:#061418; border-color:#0e3038; color:#4ab8c8; }
[data-theme="dark"] .scan-result { background:#0e2e1a; border-color:#1e5030; }
[data-theme="dark"] .tab-item { color:#5a8a85; }
[data-theme="dark"] .tab-item:hover { color:var(--coral); background:var(--gold-light); }
[data-theme="dark"] .tab-item.active { color:var(--coral); border-bottom-color:var(--gold); }
[data-theme="dark"] .tab-bar { border-color:#182a29; }
[data-theme="dark"] .schema-table td { color:#e2f0ef; border-color:#182a29; }
[data-theme="dark"] .schema-table tr:nth-child(even) td { background:#0d1918; }
[data-theme="dark"] .code-card { background:#111e1d; border-color:#182a29; }
[data-theme="dark"] .code-card .name { color:#e2f0ef; }
[data-theme="dark"] .endpoint-row { border-color:#182a29; }
[data-theme="dark"] .endpoint-path { color:#a8d8d4; }
[data-theme="dark"] .endpoint-desc { color:#7a9e9b; }
[data-theme="dark"] .stock-bar { background:#182a29; }

/* Dark mode toggle button */
.dark-toggle-btn {
  display:inline-flex;align-items:center;gap:7px;padding:8px 14px;
  border-radius:var(--radius-sm);font-size:14px;font-weight:600;
  cursor:pointer;border:1.5px solid var(--border);background:var(--white);
  color:var(--navy);transition:all .1s ease-out;font-family:var(--font);white-space:nowrap;
  box-shadow:0 4px 0 rgba(0,0,0,0.3), 0 8px 12px rgba(0,0,0,0.2);margin-bottom:4px;
}
.dark-toggle-btn:active {
  transform:translateY(4px);box-shadow:0 0px 0 rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.15);
}
.dark-toggle-btn:hover { border-color:var(--teal);color:var(--teal);background:var(--teal-light); }
[data-theme="dark"] .dark-toggle-btn { background:#111e1d;border-color:#182a29;color:#a8d8d4; }
[data-theme="dark"] .dark-toggle-btn:hover { border-color:var(--gold);color:var(--gold); }

html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }
body{font-variant-numeric:tabular-nums;font-family:var(--font);background:var(--off-white);color:var(--navy);font-size:15px;overflow-y:scroll}
/* No blinking text cursor on plain text (it appears there when the browser's caret browsing, F7, is on);
   the cursor stays wherever people type */
body{caret-color:transparent}
input,textarea,select,[contenteditable]:not([contenteditable="false"]){caret-color:auto}
.preload *{transition:none!important;-webkit-transition:none!important}
/* ===== UTILITIES ===== */
.desktop-only { display: block; }
.mobile-only { display: none; }
/* Mobile (max-width 768px) and tablet (769px-1024px) rules live in mobile.css and tablet.css */

/* ===== SIDEBAR (light, logo-themed) ===== */
.sidebar{width:270px;min-width:270px;background:linear-gradient(180deg,var(--sidebar-bg-1) 0%,var(--sidebar-bg-2) 100%);display:flex;flex-direction:column;position:fixed;top:0;left:0;height:100vh;z-index:100;overflow-y:auto;border-right:1px solid var(--sidebar-border);box-shadow:2px 0 8px rgba(26,158,150,.06);scrollbar-width:none;-ms-overflow-style:none}
.sidebar::-webkit-scrollbar{display:none}
.sidebar-logo{padding:24px 20px 20px;border-bottom:1px solid var(--sidebar-border)}
.logo-badge{display:flex;align-items:center;gap:12px}
.logo-icon{width:42px;height:42px;background:linear-gradient(135deg,var(--gold),var(--coral));border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 8px rgba(240,180,41,.35)}
/* Same two-tone wordmark as the landing page: Playfair, "Bagani" red, "Stock" in the sidebar text color */
.logo-text{font-family:var(--font-display);color:var(--sidebar-text);font-size:21px;font-weight:800;line-height:1.1;letter-spacing:0}
.logo-text .logo-text-red{color:#c62828}
[data-theme="dark"] .logo-text .logo-text-red{color:#ff6b6b}
/* Tagline styled like the "NAVIGATION" section label */
.logo-sub{color:var(--sidebar-text-muted);font-size:9.5px;font-weight:600;line-height:1.3;margin-top:3px;letter-spacing:.6px;text-transform:uppercase}
.sidebar-user{margin:16px 12px;padding:14px 14px;background:rgba(255,255,255,.7);border-radius:var(--radius-sm);display:flex;align-items:center;gap:11px;border:1px solid var(--sidebar-border)}
.user-avatar{width:38px;height:38px;border-radius:50%;background:linear-gradient(135deg,var(--gold),var(--coral));display:flex;align-items:center;justify-content:center;color:white;font-size:15px;font-weight:700;flex-shrink:0;box-shadow:0 2px 4px rgba(240,180,41,.3)}
.user-name{color:var(--sidebar-text);font-size:15px;font-weight:600;line-height:1.2}
.user-role{display:inline-block;margin-top:4px;background:var(--teal);color:white;font-size:11px;font-weight:600;letter-spacing:.8px;text-transform:uppercase;padding:3px 9px;border-radius:20px}
.sidebar-nav{flex:1;padding:8px 12px}
.nav-section-label{color:var(--sidebar-text-muted);font-size:11px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;padding:14px 10px 8px}
.nav-item{display:flex;align-items:center;gap:13px;padding:12px 14px;border-radius:var(--radius-sm);color:var(--sidebar-text);font-size:16px;font-weight:600;cursor:pointer;transition:all .15s;margin-bottom:4px;border:none;background:none;width:100%;text-align:left;text-decoration:none}
.nav-item:hover{background:rgba(26,158,150,.12);color:var(--teal-dark)}
.nav-item.active{background:linear-gradient(90deg,var(--gold),var(--coral));color:var(--white);box-shadow:0 2px 8px rgba(217,95,82,.4)}
.nav-item.active svg{stroke:var(--white)}
.nav-item .nav-label{flex:1}
.nav-badge{background:var(--danger);color:white;font-size:12px;font-weight:700;padding:3px 8px;border-radius:20px;min-width:22px;text-align:center}
.sidebar-footer{padding:14px;border-top:1px solid var(--sidebar-border)}
.logout-btn{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--radius-sm);color:var(--danger);background:rgba(217,79,79,0.06);font-size:16px;font-weight:600;cursor:pointer;transition:all .15s;border:none;width:100%}
.logout-btn:hover{background:rgba(217,79,79,.15);color:var(--danger)}
.desktop-toggle-btn{position:fixed;left:calc(270px - 18px);top:18px;width:36px;height:36px;background:var(--white);border:1.5px solid var(--border);border-radius:50%;cursor:pointer;color:var(--slate);transition:left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, color 0.2s;display:inline-flex;align-items:center;justify-content:center;z-index:110;box-shadow:0 2px 5px rgba(0,0,0,0.05)}
.desktop-toggle-btn:hover{background:var(--off-white);color:var(--teal-dark);border-color:var(--teal)}
[data-theme="dark"] .desktop-toggle-btn{background:#111e1d;color:#a8d8d4;border-color:#182a29}
[data-theme="dark"] .desktop-toggle-btn:hover{background:#0e2e2c;color:var(--gold);border-color:var(--gold)}
.desktop-toggle-btn .toggle-icon{transition:transform 0.3s ease}
.sidebar{transition:width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1)}
.main{flex:1;min-width:0;margin-left:270px;width:calc(100% - 270px);max-width:calc(100% - 270px);min-height:100vh;display:flex;flex-direction:column;transition:margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);overflow-x:hidden}

html.sidebar-collapsed .sidebar{width:76px;min-width:76px}
html.sidebar-collapsed .main{margin-left:76px;width:calc(100% - 76px);max-width:calc(100% - 76px)}
html.sidebar-collapsed .desktop-toggle-btn{left:calc(76px - 18px)}
html.sidebar-collapsed .logo-text, html.sidebar-collapsed .logo-sub, html.sidebar-collapsed .user-name, html.sidebar-collapsed .user-role, html.sidebar-collapsed .nav-label, html.sidebar-collapsed .logout-btn span {display:none}
html.sidebar-collapsed .nav-item{position:relative}
html.sidebar-collapsed .nav-badge{position:absolute;top:3px;right:1px;font-size:10px;padding:1px 5px;min-width:16px;line-height:14px}
html.sidebar-collapsed .sidebar-logo{padding:24px 0 20px;display:flex;justify-content:center}
html.sidebar-collapsed .logo-badge{justify-content:center}
html.sidebar-collapsed .logo-badge img {width:38px !important; height:38px !important;}
html.sidebar-collapsed .sidebar-user{padding:12px 0;justify-content:center;gap:0;background:transparent;border-color:transparent;margin:12px auto;box-shadow:none}
html.sidebar-collapsed .user-avatar{width:36px;height:36px;font-size:13px}
html.sidebar-collapsed .nav-item{justify-content:center;padding:12px 0;width:52px;margin:0 auto 4px;border-radius:12px}
html.sidebar-collapsed .logout-btn{justify-content:center;width:52px;margin:0 auto;padding:12px 0}
html.sidebar-collapsed .nav-section-label{display:none}
html.sidebar-collapsed .desktop-toggle-btn .toggle-icon{transform:rotate(180deg)}
html.sidebar-collapsed .nav-item svg { margin-left: 0 !important; }

/* ===== MAIN AREA ===== */
.topbar{background:var(--white);border-bottom:2px solid var(--gold);padding:0 28px;height:72px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:50}
.page-title{font-size:24px;font-weight:700;color:var(--navy);letter-spacing:0}
.page-subtitle{font-size:14px;color:var(--slate);margin-top:2px}
.topbar-actions{display:flex;align-items:center;gap:14px;flex-shrink:0}
.topbar-left-desktop{flex:1 1 auto;overflow:hidden}
.topbar-left-desktop .page-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Keep the notification bell visible on narrow desktop/tablet widths: the date gives way first */
@media (max-width:1180px){ .topbar-date{display:none} }
@media (max-width:960px){ .dark-toggle-btn #darkToggleLabel{display:none} }
.content{padding:28px;flex:1;min-width:0;overflow-x:hidden;box-sizing:border-box}
.card{background:var(--white);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow)}
.card-header{padding:18px 22px 0;display:flex;align-items:center;justify-content:space-between}
.card-title{font-size:18px;font-weight:700;color:var(--navy)}
.card-subtitle{font-size:14px;color:var(--slate);margin-top:3px}
.card-body{padding:18px 22px}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}
.stat-card{background:var(--white);border-radius:var(--radius);padding:22px 24px;border:1px solid var(--border);box-shadow:var(--shadow);display:flex;align-items:flex-start;gap:16px;position:relative;overflow:hidden}
.stat-card::before{content:'';position:absolute;top:0;left:0;width:4px;height:100%;background:var(--accent-color,var(--teal))}
.stat-icon{width:48px;height:48px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.stat-value{font-size:32px;font-weight:700;color:var(--navy);line-height:1;font-family:var(--mono)}
.stat-label{font-size:14px;color:var(--slate);margin-top:6px;font-weight:500}
.btn{white-space:nowrap;display:inline-flex;align-items:center;gap:8px;padding:10px 18px;border-radius:var(--radius-sm);font-size:15px;font-weight:600;cursor:pointer;border:none;transition:all .1s ease-out;font-family:var(--font);text-decoration:none;box-shadow:0 6px 0 rgba(0,0,0,0.4), 0 12px 18px rgba(0,0,0,0.25);margin-bottom:6px}
.btn:active{transform:translateY(6px);box-shadow:0 0px 0 rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.2)}
.btn-primary{background:linear-gradient(90deg,var(--coral),var(--teal));color:white}
.btn-primary:hover{background:linear-gradient(90deg,var(--teal-dark),var(--coral))}
.btn-outline{background:white;color:var(--navy);border:1.5px solid var(--border)}
/* Round "back" arrow used in page header cards */
.back-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:38px;height:38px;border-radius:50%;background:var(--white);color:var(--navy);border:1.5px solid var(--border);box-shadow:0 1px 3px rgba(0,0,0,.08);text-decoration:none;transition:all .15s}
.back-btn svg{display:block}.back-btn:hover{border-color:var(--gold);color:var(--coral);background:var(--gold-light)}
.card-header:has(> .back-btn), .card-header:has(> div > .back-btn){padding-bottom:18px}
[data-theme="dark"] .back-btn{background:#111e1d;border-color:#182a29;color:#e2f0ef}
.btn-outline:hover{border-color:var(--gold);color:var(--coral);background:var(--gold-light)}
.btn-danger{background:var(--danger);color:white}
.btn-danger:hover{background:#c43e3e}
.btn-success{background:var(--success);color:white}
.btn-success:hover{background:#3a8457}
.btn-sm{padding:7px 13px;font-size:13.5px}
.btn-icon{padding:8px;border-radius:var(--radius-sm)}
.btn-ghost{background:transparent;color:var(--slate)}
.btn-ghost:hover{background:var(--off-white);color:var(--navy)}
.btn-warning-outline{background:white;color:var(--warning);border:1.5px solid var(--warning)}
.table-wrapper{overflow-x:auto;border-radius:var(--radius);border:1px solid var(--border)}
table{width:100%;border-collapse:collapse}
thead{background:var(--off-white)}
th{padding:14px 16px;font-size:12.5px;font-weight:700;color:var(--slate);text-align:left;text-transform:uppercase;letter-spacing:.7px;border-bottom:1px solid var(--border);white-space:nowrap}
td{padding:14px 16px;font-size:15px;color:var(--navy);border-bottom:1px solid var(--border);vertical-align:middle}
tr:last-child td{border-bottom:none}
tbody tr:hover{background:var(--off-white)}
.card .table-wrapper{max-width:100%;box-sizing:border-box}
.card .table-wrapper table{table-layout:auto;width:100%}
/* overflow-wrap (not word-break) only splits a word when it is wider than the whole column,
   so short words and numbers like "ADMIN" or "76" never break across lines */
.card .table-wrapper td{white-space:normal;overflow-wrap:break-word}
.card .table-wrapper th{white-space:normal}
.badge{display:inline-flex;align-items:center;gap:5px;padding:4px 11px;border-radius:20px;font-size:12.5px;font-weight:600;white-space:nowrap;flex-shrink:0}
/* Long-text badges (e.g. category names) may wrap between words, never inside one */
.badge.badge-wrap{display:inline-block;white-space:normal;line-height:1.35;border-radius:10px;max-width:220px}
.badge-success{background:var(--success-light);color:#065f46}
.badge-warning{background:var(--warning-light);color:#92400e}
.badge-danger{background:var(--danger-light);color:#991b1b}
.badge-info{background:var(--info-light);color:#1e40af}
.badge-teal{background:var(--teal-light);color:var(--teal-dark)}
/* Dark mode: the light-mode badge text colors are too dark on the dark badge backgrounds */
[data-theme="dark"] .badge-success{color:var(--success)}
[data-theme="dark"] .badge-warning{color:var(--warning)}
[data-theme="dark"] .badge-danger{color:var(--danger)}
[data-theme="dark"] .badge-info{color:var(--info)}
[data-theme="dark"] .badge-teal{color:var(--teal)}
.badge-gray{background:#f1f5f9;color:var(--slate)}
.form-group{margin-bottom:18px}
.field-error{margin-top:5px;font-size:12.5px;line-height:1.45;color:var(--danger)}
.form-control.field-invalid,.form-control-modern.field-invalid{border-color:var(--danger)!important;box-shadow:0 0 0 3px rgba(220,38,38,.12)}
.form-label{display:block;font-size:15px;font-weight:600;color:var(--navy);margin-bottom:8px}
.form-label span{color:var(--danger)}
.form-control{width:100%;padding:11px 14px;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:15px;font-family:var(--font);color:var(--navy);background:white;outline:none;transition:all .15s}
.form-control:focus{border-color:var(--coral);box-shadow:0 0 0 3px rgba(217,95,82,.12)}
select.form-control{cursor:pointer}
textarea.form-control{resize:vertical;min-height:82px}
.form-hint{font-size:12.5px;color:var(--slate);margin-top:6px}
/* Fixed prefix joined to an input (Patient Code: "BLY" + the number). The prefix is not part of the input, so it can't be erased. */
.prefix-input{display:flex;align-items:stretch}
.prefix-input-tag{display:flex;align-items:center;padding:0 12px;border:1.5px solid var(--border);border-right:none;border-radius:var(--radius-sm) 0 0 var(--radius-sm);background:var(--off-white);color:var(--navy);font-weight:700;font-size:15px;letter-spacing:.5px;cursor:text;user-select:none}
.prefix-input .form-control{border-top-left-radius:0;border-bottom-left-radius:0;min-width:0}
/* Event picker (Event / Outreach dispensing): dropdown with the Add Event button beside it */
.event-pick{display:flex;gap:8px;align-items:stretch}
.event-pick .form-control{flex:1;min-width:0}
.event-pick .btn{white-space:nowrap;flex-shrink:0}
.event-new{display:flex;gap:6px;margin-top:8px;align-items:center}
.event-new[hidden]{display:none}
.event-new .form-control{flex:1;min-width:0}
.form-error{font-size:12.5px;color:var(--danger);margin-top:5px;font-weight:500}
.form-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.form-grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.modal-overlay{position:fixed;inset:0;background:rgba(15,23,41,.6);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}
.modal{background:white;border-radius:16px;width:100%;max-width:600px;max-height:90vh;overflow-y:auto;box-shadow:var(--shadow-lg)}
.modal-lg{max-width:740px}
.modal-header{padding:22px 24px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:white;z-index:1}
.modal-title{font-size:21px;font-weight:700;color:var(--navy)}
.modal-body{padding:22px 24px}
.modal-footer{padding:16px 24px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:flex-end;gap:10px;position:sticky;bottom:0;background:white}
.alert{padding:13px 18px;border-radius:var(--radius-sm);display:flex;align-items:flex-start;gap:10px;font-size:14.5px;margin-bottom:12px}
.alert-warning{background:var(--warning-light);color:#92400e;border:1px solid #fcd34d}
.alert-danger{background:var(--danger-light);color:#991b1b;border:1px solid #fca5a5}
.alert-success{background:var(--success-light);color:#065f46;border:1px solid #6ee7b7}
.alert-info{background:var(--info-light);color:#1e40af;border:1px solid #93c5fd}
.search-bar{display:flex;align-items:center;gap:10px;background:var(--off-white);border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:9px 14px;font-size:15px;color:var(--slate);transition:all .15s}
.search-bar:focus-within{border-color:var(--coral);background:white;box-shadow:0 0 0 3px rgba(217,95,82,.1)}
.search-bar input{border:none;background:none;outline:none;font-size:15px;font-family:var(--font);color:var(--navy);width:240px}
/* Search suggestions: right under the search bar, same width, about 6 rows tall (assets/js/app.js) */
.search-bar{position:relative}
.search-suggest{position:absolute;top:calc(100% + 6px);left:-1.5px;right:-1.5px;min-width:240px;max-height:288px;overflow-y:auto;z-index:60;padding:6px;background:var(--white);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg)}
.search-suggest[hidden]{display:none}
.ss-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px 4px;font-size:11.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--slate)}
.ss-clear{border:none;background:none;padding:2px 4px;font:inherit;font-size:11.5px;color:var(--teal-dark);cursor:pointer;text-transform:none;letter-spacing:0}
.ss-clear:hover{text-decoration:underline}
.ss-item{display:flex;align-items:center;gap:10px;min-height:38px;padding:8px 10px;border-radius:6px;font-size:14px;line-height:1.35;color:var(--navy);cursor:pointer}
.ss-item:hover,.ss-item.active{background:var(--teal-light);color:var(--teal-dark)}
.ss-item strong{font-weight:700;color:inherit}
.ss-ico{flex-shrink:0;width:18px;text-align:center;font-size:13px;opacity:.7}
.ss-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tab-bar{display:flex;gap:4px;border-bottom:2px solid var(--border);margin-bottom:20px}
.tab-item{padding:11px 20px;font-size:15px;font-weight:600;color:var(--slate);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .15s;border-radius:6px 6px 0 0;background:none;border-top:none;border-left:none;border-right:none;font-family:var(--font);text-decoration:none;display:inline-block}
.tab-item:hover{color:var(--coral);background:var(--gold-light)}
.tab-item.active{color:var(--coral);border-bottom-color:var(--gold)}
.toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:10px}
.toast{padding:14px 20px;border-radius:10px;font-size:15px;font-weight:500;box-shadow:var(--shadow-lg);min-width:280px;display:flex;align-items:center;gap:10px}
.toast-success{background:linear-gradient(90deg,#1a6e50,#1a9e96);color:white}
.toast-error{background:linear-gradient(90deg,#7f1d1d,#b03030);color:white}
.toast-info{background:var(--navy);color:white}
.stock-bar{height:7px;border-radius:4px;background:var(--border);overflow:hidden;margin-top:7px}
.stock-fill{height:100%;border-radius:4px}
.empty-state{text-align:center;padding:48px 24px;color:var(--slate)}
.empty-state-icon{font-size:42px;margin-bottom:12px}
.empty-state h3{font-size:16px;font-weight:600;color:var(--navy);margin-bottom:6px}
.login-page-modern {
  min-height: 100vh;
  display: flex;
  background: var(--off-white);
}
.login-brand-panel {
  flex: 1.2;
  background: linear-gradient(135deg,var(--navy) 0%,#5c1f52 50%,#8b3a20 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.login-bg-modern { position: absolute; inset: 0; overflow: hidden; }
.login-bg-circle-modern { position: absolute; border-radius: 50%; background: rgba(240,180,41,.12); }
.butterfly-deco-modern { position: absolute; opacity: .18; animation: float 6s ease-in-out infinite; }
.brand-content-modern {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px;
  max-width: 500px;
}
.brand-logo-container-modern {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: rotate(-5deg);
  transition: transform 0.3s;
}
.brand-logo-container-modern:hover { transform: rotate(0); }
.brand-logo-img-modern { width: 70%; height: 70%; object-fit: contain; }
.brand-headline-modern { font-size: 44px; font-weight: 800; margin-bottom: 16px; letter-spacing: 0; }
.brand-tagline-modern { font-size: 18px; line-height: 1.6; opacity: 0.9; }

.login-form-panel-modern {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--white);
  position: relative;
}
.login-card-modern {
  width: 100%;
  max-width: 420px;
  animation: fadeIn 0.6s ease;
}
.login-title-modern { font-size: 30px; font-weight: 800; color: var(--navy); margin-bottom: 8px; letter-spacing: 0;}
.login-sub-modern { font-size: 15px; color: var(--slate); margin-bottom: 16px; }

.demo-accounts-modern {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 20px;
}
.demo-label-modern { font-size: 12px; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.demo-grid-modern { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-account-modern {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.demo-account-modern:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(26,158,150,0.1);
  transform: translateY(-2px);
}
.demo-avatar-modern {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
}
.demo-avatar-modern.admin-avatar { background: linear-gradient(135deg, var(--coral), #b83b3b); }
.demo-avatar-modern.staff-avatar { background: linear-gradient(135deg, var(--teal), var(--teal-dark)); }
.demo-details-modern { display: flex; flex-direction: column; }
.demo-name-modern { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 2px;}

.form-group-modern { margin-bottom: 20px; }
.form-label-modern { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.input-wrapper-modern { position: relative; }
.input-icon-modern { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate); display:flex; align-items:center; }
.form-control-modern {
  width: 100%; padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font); color: var(--navy);
  background: var(--off-white);
  transition: all 0.2s;
}
.form-control-modern:focus {
  background: white;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-light);
  outline: none;
}
.btn-modern-primary {
  width: 100%;
  background: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--teal);
  color: white;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.1s ease-out;
  box-shadow: 0 6px 0 rgba(0,0,0,0.4), 0 12px 18px rgba(0,0,0,0.25);
  text-decoration: none;
  margin-bottom: 6px;
  width: 100%;
}
.btn-modern-primary:active {
  transform: translateY(6px);
  box-shadow: 0 0px 0 rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.2);
}


.arch-card{background:var(--off-white);border:1px solid var(--border);border-radius:var(--radius-sm);padding:16px;margin-bottom:10px}
.arch-card h4{font-size:14.5px;font-weight:700;color:var(--coral);margin-bottom:7px}
.arch-card p{font-size:14px;color:var(--slate);line-height:1.6}
.code-block{background:var(--navy);color:#e2e8f0;padding:16px;border-radius:var(--radius-sm);font-family:var(--mono);font-size:13px;line-height:1.7;overflow-x:auto;margin-top:8px;white-space:pre}
.endpoint-row{display:flex;align-items:flex-start;gap:12px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:14px}
.endpoint-row:last-child{border-bottom:none}
.method-badge{padding:4px 11px;border-radius:4px;font-size:11.5px;font-weight:700;font-family:var(--mono);min-width:58px;text-align:center}
.method-get{background:#dbeafe;color:#1d4ed8}
.method-post{background:#dcfce7;color:#166534}
.method-put{background:#fef3c7;color:#92400e}
.method-delete{background:#fee2e2;color:#991b1b}
.endpoint-path{font-family:var(--mono);font-size:13.5px;color:var(--navy);font-weight:500;min-width:230px}
.endpoint-desc{color:var(--slate);flex:1}
.schema-table{width:100%;border-collapse:collapse;font-size:14px}
.schema-table th{background:linear-gradient(90deg,var(--coral),var(--teal));color:white;padding:10px 14px;text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.6px}
.schema-table td{padding:10px 14px;border-bottom:1px solid var(--border);color:var(--navy);vertical-align:top}
.schema-table tr:last-child td{border-bottom:none}
.schema-table tr:nth-child(even) td{background:var(--off-white)}
.pk-badge{background:var(--gold-light);color:var(--warning);padding:2px 7px;border-radius:4px;font-size:11px;font-weight:700}
.fk-badge{background:var(--teal-light);color:var(--teal-dark);padding:2px 7px;border-radius:4px;font-size:11px;font-weight:700}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
@keyframes float{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-12px) rotate(5deg)}}
.butterfly-deco{position:absolute;opacity:.18;animation:float 6s ease-in-out infinite}
.mobile-menu-btn{display:none;background:none;border:none;cursor:pointer;padding:8px;border-radius:8px;color:var(--navy)}
.mobile-menu-btn:hover{background:var(--off-white)}
.sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:99}

.table-wrapper{overflow-x:auto;-webkit-overflow-scrolling:touch}
.code-card{background:white;border:1px solid var(--border);border-radius:var(--radius);padding:18px;display:flex;flex-direction:column;align-items:center;gap:10px;page-break-inside:avoid;break-inside:avoid}
.code-card .name{font-weight:700;font-size:15px;color:var(--navy);text-align:center;line-height:1.25}
.code-card .sku{font-family:var(--mono);font-size:12px;color:var(--slate);letter-spacing:.5px}
.code-card canvas, .code-card svg{display:block}
.codes-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.scanner-wrap{max-width:520px;margin:0 auto}
#scanner-reader{width:100%;max-width:480px;margin:0 auto;border-radius:var(--radius);overflow:hidden;background:#000}
#scanner-reader video{width:100%!important;height:auto!important;display:block}
.scan-mode-toggle{display:flex;gap:8px;justify-content:center;margin:12px 0 16px;flex-wrap:wrap}
.scan-mode-toggle .btn{flex:1;min-width:130px;justify-content:center}
.scan-result{background:var(--gold-light,#fff8e7);border:1px solid var(--gold,#f0b429);border-radius:var(--radius);padding:18px;margin-top:14px}
/* ===== LANDING PAGE ===== (public page before sign-in; see brain/landing-plan.md) */
.landing-page { background: var(--off-white); font-family: var(--font); color: var(--navy); min-height: 100vh; display: flex; flex-direction: column; }
.landing-page main { flex: 1; }
.landing-nav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--white) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.landing-nav-container { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.landing-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo-icon-small { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: #fff; border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon-small img { width: 82%; height: 82%; object-fit: contain; }
.landing-brand { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: #2b1a2a; letter-spacing: -.4px; }
/* Same two-tone wordmark as the hero title: "Bagani" red, "Stock" dark */
.landing-brand .landing-brand-red { color: #c62828; }
[data-theme="dark"] .landing-brand { color: #f3ece6; }
[data-theme="dark"] .landing-brand .landing-brand-red { color: #ff6b6b; }
.landing-nav-links { display: flex; align-items: center; gap: 10px; }
.lp-theme-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--off-white); color: var(--navy); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lp-theme-btn:hover { border-color: var(--teal); }

/* Buttons: flat with a light shadow, same family as the app's phone buttons */
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 12px; font: 700 15px var(--font); text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, filter .2s; }
.lp-btn:active { transform: translateY(1px); }
.lp-btn:focus-visible, .lp-theme-btn:focus-visible, .landing-logo:focus-visible, .landing-page a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.lp-btn-nav { min-height: 42px; padding: 0 18px; font-size: 14px; color: #fff; background: linear-gradient(90deg, var(--coral), var(--teal)); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.lp-btn-nav:hover { filter: brightness(1.06); }
.lp-btn-primary { color: #fff; background: linear-gradient(90deg, var(--coral), var(--teal)); box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.lp-btn-primary:hover { filter: brightness(1.06); }
.lp-btn-ghost { color: #fff; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.55); }
.lp-btn-ghost:hover { background: rgba(255,255,255,.18); }

/* Hero: Bagani plum-to-rust gradient with soft light shapes behind the text (no blurred decorations) */
.lp-hero {
  position: relative; overflow: hidden; color: #fff; padding: 64px 24px 72px;
  background:
    radial-gradient(520px 320px at 85% 15%, rgba(240,180,41,.22), transparent 70%),
    radial-gradient(420px 300px at 5% 95%, rgba(26,158,150,.25), transparent 70%),
    linear-gradient(135deg, #3a1a35 0%, #5c1f52 52%, #8b3a20 100%);
}
.lp-hero-inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.lp-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.lp-title { font-size: 52px; font-weight: 800; line-height: 1.1; letter-spacing: 0; margin-bottom: 18px; }
.lp-title span { color: var(--gold); }
.lp-lead { font-size: 18px; line-height: 1.6; color: rgba(255,255,255,.9); max-width: 540px; margin-bottom: 28px; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-hint { margin-top: 14px; font-size: 13.5px; color: rgba(255,255,255,.75); }

/* Phone preview drawn in CSS (sample numbers only) */
.lp-preview { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lp-preview figcaption { font-size: 12px; color: rgba(255,255,255,.7); letter-spacing: .4px; }
.lp-phone {
  position: relative; width: 270px; padding: 30px 14px 14px; border-radius: 38px; background: #fdf8fc;
  border: 8px solid #1d0f1b; box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
  color: #3a1a35; font-size: 11px; transform: rotate(-3deg); animation: lpFloat 6s ease-in-out infinite;
}
@keyframes lpFloat { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-8px); } }
.lp-phone-notch { position: absolute; top: 8px; left: 50%; width: 80px; height: 16px; margin-left: -40px; border-radius: 10px; background: #1d0f1b; }
.lp-ph-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lp-ph-head span { display: flex; flex-direction: column; line-height: 1.15; }
.lp-ph-head small { color: #7a6678; font-size: 9px; }
.lp-ph-head b { font-size: 14px; }
.lp-ph-head i { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #f0b429, #d95f52); }
.lp-ph-hero { display: flex; flex-direction: column; padding: 12px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #f0b429, #d95f52); }
.lp-ph-hero small { font-size: 8px; font-weight: 700; letter-spacing: .6px; opacity: .9; }
.lp-ph-hero b { font-size: 26px; line-height: 1.1; font-family: var(--mono); }
.lp-ph-hero span { font-size: 9px; opacity: .9; }
.lp-ph-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.lp-ph-tiles span { display: flex; flex-direction: column; padding: 7px 6px; border-radius: 10px; background: var(--b); font-size: 8.5px; font-weight: 600; color: #3a1a35; }
.lp-ph-tiles b { font-size: 14px; color: var(--c); font-family: var(--mono); }
.lp-ph-label { margin: 10px 0 6px; font-size: 10px; font-weight: 800; }
.lp-ph-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lp-ph-actions i { height: 34px; border-radius: 10px; background: var(--b); }
.lp-ph-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin-bottom: 5px; border-radius: 10px; background: #fff; border: 1px solid #edd8e8; }
.lp-ph-row > i { width: 22px; height: 22px; border-radius: 7px; background: #d0f4f2; }
.lp-ph-row span { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.lp-ph-row b { height: 6px; width: 80%; border-radius: 3px; background: #3a1a35; opacity: .75; }
.lp-ph-row em { height: 5px; width: 50%; border-radius: 3px; background: #b09aaa; }
.lp-ph-row strong { color: #0e7c75; font-family: var(--mono); }
.lp-ph-bar { display: flex; justify-content: space-around; margin-top: 8px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid #edd8e8; }
.lp-ph-bar i { width: 18px; height: 14px; border-radius: 5px; background: #e6dbe4; }
.lp-ph-bar i.on { background: linear-gradient(135deg, #f0b429, #d95f52); }

/* Sections */
.lp-section { padding: 64px 24px; }
.lp-section-alt { background: var(--white); border-top: 1px solid var(--border); }
.lp-container { max-width: 1160px; margin: 0 auto; }
.lp-section-title { font-size: 32px; font-weight: 800; letter-spacing: 0; color: var(--navy); margin-bottom: 26px; text-align: center; }
.lp-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.lp-feature { padding: 22px; border-radius: 18px; background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
.lp-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--teal); }
.lp-feature-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.lp-feature h3 { font-size: 16.5px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.lp-feature p { font-size: 14px; line-height: 1.55; color: var(--slate); }

.lp-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: none; }
.lp-step { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: 18px; background: var(--off-white); border: 1px solid var(--border); }
.lp-step-num { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--coral), var(--teal)); box-shadow: 0 4px 10px color-mix(in srgb, var(--teal) 35%, transparent); }
.lp-step h3 { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.lp-step p { font-size: 14px; line-height: 1.5; color: var(--slate); }
.lp-note { text-align: center; margin-top: 16px; font-size: 14px; color: var(--slate); }
.lp-trust { display: flex; align-items: flex-start; gap: 12px; max-width: 760px; margin: 28px auto 0; padding: 16px 18px; border-radius: 14px; background: var(--teal-light); color: var(--navy); }
.lp-trust-icon { color: var(--teal-dark); flex-shrink: 0; margin-top: 1px; }
.lp-trust p { font-size: 14px; line-height: 1.55; }
.lp-trust a { color: var(--teal-dark); font-weight: 700; white-space: nowrap; }

.landing-footer { background: linear-gradient(90deg, var(--coral), var(--teal)); padding: 22px 24px; color: #fff; }
/* Desktop/laptop footer: two centered lines (phones stack everything, see mobile.css "Landing footer")
   1 Privacy Notice · Terms of Use · Feature Overview in one row
   · 2 "BaganiStock© year • Bagani Community Center" + "All Rights Reserved" (not bold, 50% opacity) */
.footer-container { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: #fff; opacity: 1; text-decoration: none; font-size: 14px; }
.footer-links a:hover { text-decoration: underline; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 400; color: #fff; font-size: 14px; }
.footer-brand img { border-radius: 50%; background: #fff; object-fit: contain; }
.footer-rights-inline { display: inline-block; font-weight: 400; opacity: .5; margin-left: 4px; white-space: nowrap; }
#features { scroll-margin-top: 16px; }
/* "What you can do in BaganiStock": left-aligned, same size as other section titles */
.lp-features-head { text-align: left; }
.lp-features-head .lp-section-title { text-align: left; font-family: var(--font-display); }

/* Dark mode */
[data-theme="dark"] .landing-nav { background: rgba(17,30,29,.9); border-color: #182a29; }
[data-theme="dark"] .lp-theme-btn { background: #0d1918; border-color: #182a29; color: #e2f0ef; }
[data-theme="dark"] .lp-hero { background:
    radial-gradient(520px 320px at 85% 15%, rgba(240,192,64,.14), transparent 70%),
    radial-gradient(420px 300px at 5% 95%, rgba(46,200,190,.14), transparent 70%),
    linear-gradient(135deg, #1c1220 0%, #2b1a31 52%, #3a1c14 100%); }
[data-theme="dark"] .lp-section-alt { background: #111e1d; border-color: #182a29; }
[data-theme="dark"] .lp-feature { background: #111e1d; border-color: #182a29; box-shadow: none; }
[data-theme="dark"] .lp-step { background: #0d1918; border-color: #182a29; }
[data-theme="dark"] .lp-trust a, [data-theme="dark"] .lp-trust-icon { color: var(--teal); }
[data-theme="dark"] .landing-footer { background: linear-gradient(90deg, #5a2a24, #0e4a46); }

/* ----- v2 hero (option A): sharp Bagani mural + frosted-glass card ----- */
.lp-hero-mural { background: #f6f1ec; color: var(--navy); padding: 0; min-height: 520px; display: flex; align-items: center; }
.lp-mural { position: absolute; inset: 0; }
/* Soft blur on the mural (owner's choice): colors and the mask's shape stay recognizable.
   The photo is scaled up a little so the blur never shows pale edges. */
.lp-mural { overflow: hidden; }
.lp-mural img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; display: block; filter: blur(6px) saturate(115%); transform: scale(1.08); animation: lpMuralZoom 24s ease-in-out infinite alternate; }
@keyframes lpMuralZoom { from { transform: scale(1.08); } to { transform: scale(1.14); } }
.lp-hero-mural .lp-hero-inner { position: relative; z-index: 1; width: 100%; display: block; padding: 48px 24px; }
.lp-glass {
  max-width: 500px; padding: 30px 30px 26px; border-radius: 24px;
  background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 20px 50px rgba(58,26,53,.18);
}
.lp-hero-mural .lp-tag { background: rgba(58,26,53,.08); border-color: rgba(58,26,53,.18); color: var(--navy); margin-bottom: 0; }
/* Logo (transparent PNG) sits with the "For staff and admins" tag at the top of the card */
.lp-glass-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.lp-card-logo { width: 92px; height: 92px; object-fit: contain; flex-shrink: 0; }
[data-theme="dark"] .lp-card-logo { filter: drop-shadow(0 0 1px rgba(255,255,255,.9)) drop-shadow(0 0 6px rgba(255,255,255,.35)); }
.lp-hero-mural .lp-title { color: #2b1a2a; margin-bottom: 6px; }
.lp-title .lp-title-red { color: #c62828; } /* the same red as the painted "BAGANI" on the wall */
.lp-subtitle { font-size: 17px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.lp-hero-mural .lp-lead { color: var(--slate); font-size: 16px; margin-bottom: 22px; }
.lp-hero-mural .lp-hint { color: var(--slate); }
.lp-btn-outline { color: var(--navy); background: rgba(255,255,255,.7); border: 1.5px solid rgba(58,26,53,.35); }
.lp-btn-outline:hover { background: #fff; border-color: var(--navy); }
/* Thin line in the mural's feather colors */
.lp-feather-line { height: 6px; background: linear-gradient(90deg, #d62828 0%, #f4c20d 20%, #2e9e4f 40%, #1e5aa8 60%, #7b3fa0 80%, #e5559b 100%); }

/* "Also on your phone" section (the phone preview moved out of the hero) */
.lp-section-phone { background: var(--off-white); padding-top: 24px; }
.lp-phone-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; max-width: 900px; }
.lp-phone-text .lp-section-title { text-align: left; margin-bottom: 12px; }
.lp-phone-text p { font-size: 16px; line-height: 1.6; color: var(--slate); max-width: 440px; }
.lp-section-phone .lp-preview figcaption { color: var(--slate); }

[data-theme="dark"] .lp-hero-mural { background: #0d1918; }
[data-theme="dark"] .lp-mural::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.38); }
[data-theme="dark"] .lp-glass { background: rgba(17,30,29,.62); border-color: rgba(255,255,255,.12); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
[data-theme="dark"] .lp-hero-mural .lp-title { color: #f3ece6; }
[data-theme="dark"] .lp-title .lp-title-red { color: #ff6b6b; }
[data-theme="dark"] .lp-hero-mural .lp-tag { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #e2f0ef; }
[data-theme="dark"] .lp-btn-outline { color: #e2f0ef; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.35); }

/* ===== SIGN-IN PAGE (pages/login.php; see brain/login-plan.md) =====
   Same look as the landing page: blurred mural + frosted brand card, gold-to-coral buttons. */
.lg-page { min-height: 100vh; display: flex; background: var(--off-white); }
.lg-page [hidden] { display: none !important; } /* notes, Caps Lock warning and inactive cards stay hidden until needed */
.lg-brand { flex: 1.1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f6f1ec; color: var(--navy); padding: 40px; }
.lg-mural { position: absolute; inset: 0; overflow: hidden; }
.lg-mural img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; filter: blur(6px) saturate(115%); transform: scale(1.08); display: block; }
.lg-brand-glass {
  position: relative; z-index: 1; max-width: 400px; text-align: center; padding: 30px 36px 28px; border-radius: 24px;
  background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 20px 50px rgba(58,26,53,.18);
}
.lg-brand-logo { width: 110px; height: 110px; object-fit: contain; display: block; margin: 0 auto 10px; flex-shrink: 0; }
.lg-brand-name { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: #2b1a2a; line-height: 1.1; }
.lg-brand-name span { color: #c62828; }
.lg-brand-sub { margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--navy); }
.lg-feather { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; }

.lg-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--off-white); }
.lg-card { width: 100%; max-width: 430px; padding: 32px; border-radius: 22px; background: var(--white); border: 1px solid var(--border); box-shadow: 0 18px 44px rgba(58,26,53,.10); }
.lg-page .login-title-modern { margin-bottom: 6px; }
.lg-page .login-sub-modern { margin-bottom: 18px; }
.lg-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 0; border: none; background: none; color: var(--teal-dark); font: 600 14px var(--font); text-decoration: none; cursor: pointer; }
.lg-back:hover { text-decoration: underline; }
.lg-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lg-link-btn { padding: 0; border: none; background: none; color: var(--teal-dark); font: 600 13.5px var(--font); cursor: pointer; text-underline-offset: 3px; }
.lg-link-btn:hover:not(:disabled) { text-decoration: underline; }
.lg-link-btn:disabled { color: var(--slate); cursor: default; }
/* Sign-up name fields: Last | First on one row, Suffix below (stacked on phones) */
.lg-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.lg-name-grid .lg-suffix { grid-column: 1 / 2; }
.lg-page .form-control-modern.lg-plain { padding-left: 14px; }
.lg-page select.form-control-modern { cursor: pointer; }
.lg-optional { font-weight: 500; color: var(--slate); font-size: 12.5px; }
.lg-match { margin: 6px 0 0; font-size: 12.5px; font-weight: 700; }
.lg-match.ok { color: var(--success); }
.lg-match.bad { color: var(--danger); }
@media (max-width: 420px) { .lg-name-grid { grid-template-columns: 1fr; } .lg-name-grid .lg-suffix { grid-column: auto; } }
.lg-alert-action { margin-top: 6px; font-size: 14px; font-weight: 700; color: inherit; text-decoration: underline; }
.lg-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--info-light); color: var(--navy); font-size: 13px; line-height: 1.5; }
.lg-note svg { flex-shrink: 0; margin-top: 1px; color: var(--info); }
.lg-page .form-control-modern { min-height: 48px; }
.lg-page .form-control-modern.lg-has-eye { padding-right: 48px; }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 10px; background: none; color: var(--slate); cursor: pointer; }
.lg-eye:hover:not(:disabled) { color: var(--navy); background: var(--off-white); }
.lg-caps { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12.5px; font-weight: 600; color: #92400e; }

/* Main buttons: coral-to-teal, the logo colors (same as the original top-bar Sign in) */
.lg-btn { width: 100%; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: none; border-radius: 12px; font: 700 15.5px var(--font); text-decoration: none; cursor: pointer; transition: filter .2s, transform .1s, opacity .2s; }
.lg-btn-primary { color: #fff; background: linear-gradient(90deg, var(--coral), var(--teal)); box-shadow: 0 6px 16px color-mix(in srgb, var(--teal) 30%, transparent); }
.lg-btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.lg-btn:active:not(:disabled) { transform: translateY(1px); }
.lg-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.lg-btn.is-loading { opacity: .9; cursor: progress; }
.lg-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .8s linear infinite; }
.lg-btn.is-loading .lg-spinner { display: inline-block; }
.lg-switch { margin-top: 16px; text-align: center; font-size: 14px; color: var(--slate); }
.lg-page a:focus-visible, .lg-page button:focus-visible, .lg-page input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Steps: 1 Your details > 2 Verify email > 3 Admin approval */
.lg-steps { list-style: none; display: flex; gap: 6px; margin: 4px 0 14px; padding: 0; }
.lg-steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--slate); line-height: 1.2; }
.lg-steps span { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); font-size: 12px; font-weight: 800; background: var(--white); }
.lg-steps li.current { color: var(--navy); }
.lg-steps li.current span { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--coral), var(--teal)); }
.lg-steps li.done span { color: #fff; border-color: transparent; background: var(--success); }

.lg-agree { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 20px; font-size: 13px; line-height: 1.5; color: var(--slate); cursor: pointer; }
.lg-agree input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--coral); }
.lg-agree a { color: var(--teal-dark); font-weight: 600; }

/* 6 code boxes */
.lg-otp { border: none; padding: 0; margin: 0 0 18px; min-width: 0; }
.lg-otp legend { margin-bottom: 8px; }
.lg-otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.lg-otp-box { width: 100%; height: 58px; text-align: center; font: 700 24px var(--mono); color: var(--navy); border: 1.5px solid var(--border); border-radius: 12px; background: var(--off-white); caret-color: var(--coral); }
.lg-otp-box:focus { outline: none; border-color: var(--coral); background: var(--white); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 18%, transparent); }
.lg-otp[disabled] .lg-otp-box { opacity: .5; }
.lg-otp-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.lg-otp-actions form { margin: 0; }
.lg-muted, .lg-muted-btn { color: var(--slate); font-size: 13px; }

.lg-done { text-align: center; }
.lg-done .lg-steps { text-align: left; }
.lg-done-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--coral), var(--teal)); box-shadow: 0 8px 20px color-mix(in srgb, var(--teal) 35%, transparent); }

[data-theme="dark"] .lg-page, [data-theme="dark"] .lg-panel { background: #0d1918; }
[data-theme="dark"] .lg-brand { background: #0d1918; }
[data-theme="dark"] .lg-mural::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.4); }
[data-theme="dark"] .lg-brand-glass { background: rgba(17,30,29,.65); border-color: rgba(255,255,255,.12); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
[data-theme="dark"] .lg-brand-name { color: #f3ece6; }
[data-theme="dark"] .lg-brand-name span { color: #ff6b6b; }
[data-theme="dark"] .lg-brand-sub { color: #e2f0ef; }
[data-theme="dark"] .lg-brand-logo { filter: drop-shadow(0 0 1px rgba(255,255,255,.9)) drop-shadow(0 0 6px rgba(255,255,255,.35)); }
[data-theme="dark"] .lg-card { background: #111e1d; border-color: #182a29; box-shadow: 0 18px 44px rgba(0,0,0,.4); }
[data-theme="dark"] .lg-back, [data-theme="dark"] .lg-link-btn:not(:disabled), [data-theme="dark"] .lg-agree a { color: var(--teal); }
[data-theme="dark"] .lg-caps { color: #f0c040; }
[data-theme="dark"] .lg-steps span { background: #0d1918; border-color: #2a4240; }
[data-theme="dark"] .lg-otp-box { background: #0d1918; border-color: #2a4240; color: #e2f0ef; }

/* Sign-in page, phones and small tablets: mural banner on top, form card overlapping its bottom edge */
@media (max-width: 900px) {
  .lg-page { flex-direction: column; }
  .lg-brand { flex: none; height: 180px; padding: 0; }
  .lg-brand-glass { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; margin-top: -24px; max-width: none; border-radius: 16px; text-align: left; }
  .lg-brand-logo { width: 54px; height: 54px; margin: 0; }
  .lg-brand-name { font-size: 26px; }
  .lg-brand-sub { display: none; }
  .lg-panel { padding: 0 12px calc(24px + env(safe-area-inset-bottom)); margin-top: -36px; position: relative; z-index: 2; background: transparent; align-items: flex-start; }
  .lg-card { padding: 22px 18px; }
  .lg-page .login-title-modern { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-phone, .lp-mural img { animation: none; }
  .lp-feature, .lp-btn { transition: none; }
}

@media print{
  .sidebar, .topbar, .no-print, .mobile-menu-btn, .desktop-toggle-btn, .sidebar-backdrop{display:none!important}
  .main{margin-left:0!important;width:100%!important;max-width:100%!important}
  .content{padding:10px!important}
  body{background:white}
  .card{box-shadow:none;border:none}
  .codes-grid{grid-template-columns:repeat(3,1fr);gap:10px}
  .code-card{border:1px dashed #999;padding:10px}
}

/* ===== Critical Alerts pop-up: each alert is a button that opens what it is about (footer.php) ===== */
.crit-alert-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--ca-border, var(--border)); border-radius: 8px; background: var(--ca-bg, var(--off-white));
  font: inherit; color: inherit; transition: transform .12s, box-shadow .12s;
}
.crit-alert-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.crit-alert-item:focus-visible { outline: 2px solid var(--ca-color, var(--teal)); outline-offset: 2px; }
.crit-alert-icon { color: var(--ca-color, var(--slate)); margin-top: 2px; flex-shrink: 0; }
.crit-alert-text { flex: 1; min-width: 0; }
.crit-alert-title { display: block; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.crit-alert-msg { display: block; font-size: 14px; color: var(--slate); line-height: 1.45; }
/* ===== MY PROFILE (pages/profile.php) =====
   Desktop: photo column on the left, fields on the right. Tablet and phones: one column (tablet.css / mobile.css). */
.profile-card { max-width: 920px; margin: 8px auto 24px; }
.profile-card.profile-card-narrow { max-width: 520px; } /* verification-code step */
.profile-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.profile-side { text-align: center; padding: 18px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--off-white); }
.profile-side #avatarPreviewWrap, .profile-side #avatarPreviewWrap img, .profile-side #avatarPlaceholder { width: 120px !important; height: 120px !important; }
.profile-fields { min-width: 0; }
.profile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-section-title { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--slate); margin: 0 0 12px; }
.profile-section-title span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.profile-section-sep { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.profile-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.profile-actions .btn { min-width: 200px; justify-content: center; }

/* ===== SHOW / HIDE PASSWORD (app.js adds .pw-eye to every password box) ===== */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; padding-right: 46px !important; box-sizing: border-box; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 8px; background: transparent; color: var(--slate); cursor: pointer; padding: 0; }
.pw-eye:hover { background: var(--off-white); color: var(--teal-dark); }
.pw-eye:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--teal-dark); }
/* Microsoft Edge adds its own "reveal" eye to password boxes: hide it where we already show ours */
.pw-wrap > input::-ms-reveal, .pw-wrap > input::-ms-clear,
.lg-has-eye::-ms-reveal, .lg-has-eye::-ms-clear { display: none; }

/* ===== SCANNER BATCH LIST (app.js renderBatchCart) ===== */
.sb-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sb-item.sb-flash { animation: sbFlash .9s ease; }
@keyframes sbFlash { 0% { background: var(--teal-light); border-color: var(--teal); } 100% { background: var(--white); border-color: var(--border); } }
.sb-info { flex: 1; min-width: 0; }
.sb-name { font-weight: 600; font-size: 14px; color: var(--navy); line-height: 1.35; overflow-wrap: anywhere; }
.sb-avail { font-size: 12px; color: var(--slate); margin-top: 2px; }
.sb-qty { display: flex; align-items: center; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--off-white); }
.sb-step { width: 36px; height: 38px; border: none; background: transparent; color: var(--teal-dark); font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; font-family: var(--font); }
.sb-step:hover:not([disabled]) { background: var(--teal-light); }
.sb-step[disabled] { color: var(--border); cursor: not-allowed; }
.sb-qty-input { width: 46px; height: 38px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--white); color: var(--navy); text-align: center; font-size: 15px; font-weight: 700; font-family: var(--font); -moz-appearance: textfield; }
.sb-qty-input::-webkit-outer-spin-button, .sb-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sb-remove { flex-shrink: 0; width: 34px; height: 34px; border: none; border-radius: 8px; background: transparent; color: var(--danger); font-size: 16px; cursor: pointer; }
.sb-remove:hover { background: var(--danger-light); }
@media (prefers-reduced-motion: reduce) { .sb-item.sb-flash { animation: none; } }

/* ===== IN-APP CONFIRMATION DIALOG (app.js baganiConfirm / data-confirm) ===== */
.bc-overlay { z-index: 10050; }
.bc-modal { max-width: 440px; }
.bc-title { font-size: 20px; }
.bc-title.bc-danger { color: var(--danger); }
.bc-msg { margin: 0; color: var(--navy); line-height: 1.55; font-size: 15px; }
.bc-label { display: block; margin-top: 16px; }
.bc-req { font-weight: 400; color: var(--slate); }
.bc-reason { resize: vertical; min-height: 84px; }
.bc-hint { font-size: 12px; color: var(--slate); margin-top: 6px; }
.bc-hint.bc-hint-ok { visibility: hidden; }
.bc-ok[disabled] { opacity: .5; cursor: not-allowed; }
.bc-date { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--off-white); }
.bc-date-toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); cursor: pointer; margin-bottom: 8px; }
.bc-date-toggle input { width: 18px; height: 18px; accent-color: var(--teal); }
.bc-date input[type="date"][disabled] { opacity: .5; }
.bc-date-hint { margin-top: 6px; }

.grn-reject-reason { margin-bottom: 18px; padding: 12px 16px; border-radius: 8px; background: var(--danger-light); border-left: 4px solid var(--danger); color: var(--navy); line-height: 1.5; overflow-wrap: anywhere; }
.grn-reject-reason strong { color: var(--danger); margin-right: 4px; }
.grn-list-reason { font-size: 12px; color: var(--slate); margin-top: 4px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== LIVE NOTIFICATIONS (footer.php "Live notifications") ===== */
.desk-bell-count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 3px; box-sizing: content-box; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--sidebar-bg-1); }
[data-live-count][hidden], [data-live-new][hidden] { display: none !important; }
/* Unread badge ripple (owner's request, 2026-11-14): a ring grows out of the red number and fades, once a second,
   for as long as there are unread notifications. The ring sits under the number, so the count stays readable. */
.desk-bell-count, .mobile-bell-count { isolation: isolate; }
.desk-bell-count::after, .mobile-bell-count::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; background: var(--danger); z-index: -1; pointer-events: none; animation: bellPing 1s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes bellPing { 0% { transform: scale(1); opacity: .75; } 75%, 100% { transform: scale(2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .desk-bell-count::after, .mobile-bell-count::after { animation: none; opacity: 0; } }
.live-bump { animation: liveBump .5s ease; }
@keyframes liveBump { 30% { transform: scale(1.35); } }
.live-notifs { position: fixed; top: 84px; right: 20px; z-index: 10002; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.live-notif { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--ln-color, var(--teal)); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); color: var(--navy); animation: liveIn .25s ease; }
.live-notif.leaving { opacity: 0; transform: translateX(12px); transition: opacity .2s ease, transform .2s ease; }
@keyframes liveIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.live-notif-icon { color: var(--ln-color, var(--teal)); flex-shrink: 0; margin-top: 1px; }
.live-notif-body { flex: 1; min-width: 0; }
.live-notif-title { font-weight: 600; font-size: 14px; }
.live-notif-level { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--ln-color, var(--teal)); border: 1px solid var(--ln-color, var(--teal)); vertical-align: 1px; }
.live-notif-msg { font-size: 13.5px; color: var(--slate); line-height: 1.4; margin-top: 3px; overflow-wrap: anywhere; }
.live-notif-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--slate); }
.live-notif-actions a { font-weight: 700; color: var(--ln-color, var(--teal-dark)); text-decoration: none; }
.live-notif-actions a:hover { text-decoration: underline; }
.live-notif-close { flex-shrink: 0; border: none; background: transparent; color: var(--slate); cursor: pointer; padding: 2px; line-height: 0; border-radius: 6px; }
.live-notif-close:hover { background: var(--off-white); }
@media (max-width: 768px) { .live-notifs { top: 70px; right: 16px; } }
@media (prefers-reduced-motion: reduce) { .live-notif, .live-bump { animation: none; } }

/* Pop-up title colored by the most serious level present; small level label on each item */
.crit-alert-heading { color: var(--ca-color, var(--burgundy)); display: flex; align-items: center; gap: 8px; }
.crit-alert-level { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; vertical-align: 1px; color: var(--ca-color, var(--slate)); border: 1px solid var(--ca-border, var(--border)); background: var(--white); }
.crit-alert-go { display: inline-flex; align-items: center; gap: 2px; align-self: center; flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--ca-color, var(--teal)); }

/* Patient Queue: the refill a Dispense Reminder points to (#refill-ID) is highlighted when opened */
.pq-row:target { background: var(--warning-light); box-shadow: inset 4px 0 0 var(--warning); scroll-margin-top: 90px; animation: pqFlash 1.6s ease-out 2; }
@keyframes pqFlash { 50% { background: color-mix(in srgb, var(--warning) 25%, var(--white)); } }
@media (prefers-reduced-motion: reduce) { .pq-row:target { animation: none; } }

/* ===== QR label: on screen, and printing ===== */
#codeModalQr .code-label-qr { width: 220px; height: 220px; image-rendering: pixelated; }
.code-label-print-note { display: none; }
/* Printing from a stock's QR window (printCodeLabel() in app.js): only the label is printed, on one page,
   with a 14 cm QR code (GCash-style large QR). The page, bottom bar, AI button and buttons are hidden. */
@media print {
  @page { margin: 12mm; }
  html:has(body.printing-label), body.printing-label { background: #fff !important; overflow: visible !important; } /* body normally always shows a scrollbar */
  body.printing-label > *:not(#codeModalOverlay) { display: none !important; }
  body.printing-label #codeModalOverlay { position: static !important; display: block !important; background: none !important; padding: 0 !important; backdrop-filter: none !important; }
  body.printing-label #codeModalOverlay, body.printing-label #codeModalOverlay * { overflow: visible !important; } /* no scrollbars on paper */
  body.printing-label #codeModalOverlay .modal { max-width: none !important; width: 100% !important; max-height: none !important; overflow: visible !important; margin: 0 !important; box-shadow: none !important; border: none !important; background: #fff !important; animation: none !important; }
  body.printing-label #codeModalOverlay .modal-header { position: static !important; justify-content: center !important; border: none !important; background: #fff !important; padding: 8mm 0 2mm !important; }
  body.printing-label #codeModalOverlay .modal-header .btn,
  body.printing-label #codeModalOverlay .modal-footer,
  body.printing-label .code-label-heading { display: none !important; }
  body.printing-label #codeModalOverlay .modal-body { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  body.printing-label #codeModalTitle { font-size: 22pt !important; text-align: center; color: #000 !important; line-height: 1.25; }
  body.printing-label #codeModalSubtitle { font-size: 14pt !important; color: #000 !important; margin-bottom: 6mm !important; }
  body.printing-label #codeModalQr .code-label-qr { width: 14cm !important; height: 14cm !important; } /* fills most of the page width; still one page */
  body.printing-label .code-label-print-note { display: block; margin-top: 5mm; font-size: 11pt; color: #444; }
}


/* Phone-only header, bottom bar and "More" sheet - hidden on desktop and tablet (styled in mobile.css) */
.mobile-nav-panel, .mobile-sheet, .mobile-sheet-backdrop, .phone-dash, .ph-more, .rh-tabs, .rh-dots { display: none; }
.nav-item.active .nav-badge { background: #fff; color: var(--danger); } /* stays readable on the gradient of the active item */
/* Visible to screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


@keyframes spin { 100% { transform: rotate(360deg); } }

/* ===== SKELETON LOADING (app.js "Skeleton loading screen", AI chat thinking bubble) =====
   Grey placeholder blocks with a light sweep ("shimmer"). Colors come from --slate, so they
   follow light/dark mode and every color scheme. */
:root { --sk-base: color-mix(in srgb, var(--slate) 14%, transparent); --sk-shine: color-mix(in srgb, var(--slate) 28%, transparent); }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--sk-base) 0%, var(--sk-base) 35%, var(--sk-shine) 50%, var(--sk-base) 65%, var(--sk-base) 100%); background-size: 300% 100%; animation: skShimmer 1.4s ease-in-out infinite; }
@keyframes skShimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-screen { position: fixed; bottom: 0; z-index: 45; padding: 28px; background: var(--off-white); overflow: hidden; display: flex; flex-direction: column; gap: 14px; animation: skFadeIn .2s ease; box-sizing: border-box; }
@keyframes skFadeIn { from { opacity: 0; } to { opacity: 1; } }
.sk-title { height: 26px; width: min(320px, 60%); border-radius: 8px; }
.sk-line { height: 12px; }
.sk-w20 { width: 20%; } .sk-w30 { width: 30%; } .sk-w40 { width: 40%; } .sk-w60 { width: 60%; } .sk-w80 { width: 80%; }
.sk-num { height: 28px; width: 55%; margin-top: 12px; border-radius: 8px; }
.sk-dot { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.sk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.sk-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.sk-table { display: flex; flex-direction: column; gap: 16px; }
.sk-row { display: flex; align-items: center; gap: 14px; }
.sk-row .sk-w60 { flex: 1; }
@media (max-width: 768px) {
  .sk-screen { padding: 10px; gap: 10px; }
  .sk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sk-card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .sk-screen { animation: none; } }

/* ===== APPEARANCE: BAGANI COLOR SCHEMES (Settings & Tools > Appearance) =====
   sunrise = default :root palette (yellow -> red gradient). --gold/--coral drive the gradients,
   the --teal family is the main accent. Light and dark variants are kept separate so dark mode still works. */
html[data-scheme="blossom"]:not([data-theme="dark"]) {
  --gold:#e0559b; --gold-light:#fdeef6; --coral:#7e3fa6; --coral-light:#f3e8fb;
  --teal:#8e3f9e; --teal-dark:#6e2d80; --teal-light:#f5e6f8; --teal-mid:#c07fd0;
  --sidebar-bg-1:#fdf5fb; --sidebar-bg-2:#f6e4f3; --sidebar-border:#ecc8e6;
  --sidebar-text:#4a1f45; --sidebar-text-muted:#7d5577;
}
html[data-scheme="blossom"][data-theme="dark"] {
  --gold:#f472b6; --coral:#b45ad0; --teal:#d08ae6; --teal-dark:#b86fd4; --teal-light:#2a1533; --teal-mid:#8e4aa8;
  --sidebar-bg-1:#1c1220; --sidebar-bg-2:#2b1a31; --sidebar-border:#3a2442;
  --sidebar-text:#f0d4ec; --sidebar-text-muted:#b48aae;
}
html[data-scheme="meadow"]:not([data-theme="dark"]) {
  --gold:#e9b824; --gold-light:#fdf6dc; --coral:#3f9b5a; --coral-light:#e3f4e8;
  --teal:#2f8a55; --teal-dark:#22693f; --teal-light:#dcf3e4; --teal-mid:#6cc28c;
  --sidebar-bg-1:#f6fbf0; --sidebar-bg-2:#e6f3dc; --sidebar-border:#c6e2b9;
  --sidebar-text:#2a4a30; --sidebar-text-muted:#5b7a60;
}
html[data-scheme="meadow"][data-theme="dark"] {
  --gold:#f0c040; --coral:#4fb06e; --teal:#62c98e; --teal-dark:#45ad72; --teal-light:#0e2a1a; --teal-mid:#2f8a55;
  --sidebar-bg-1:#101c14; --sidebar-bg-2:#1b3022; --sidebar-border:#1f3626;
  --sidebar-text:#cdebd6; --sidebar-text-muted:#7fa98a;
}
html[data-scheme="blossom"] .btn-primary, html[data-scheme="meadow"] .btn-primary { background:linear-gradient(90deg,var(--gold),var(--coral)); }
html[data-scheme="blossom"] .btn-primary:hover, html[data-scheme="meadow"] .btn-primary:hover { background:linear-gradient(90deg,var(--coral),var(--gold)); }
html[data-scheme="blossom"] .nav-item:hover, html[data-scheme="meadow"] .nav-item:hover { background:color-mix(in srgb, var(--teal) 12%, transparent); color:var(--teal-dark); }
html[data-scheme="blossom"] .nav-item.active { box-shadow:0 2px 8px rgba(126,63,166,.35); }
html[data-scheme="meadow"] .nav-item.active { box-shadow:0 2px 8px rgba(63,155,90,.35); }

/* Appearance picker (Settings) */
.scheme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}
.scheme-option{position:relative;display:block;cursor:pointer;border:2px solid var(--border);border-radius:var(--radius);padding:12px;background:var(--white);transition:border-color .15s, box-shadow .15s}
.scheme-option:hover{border-color:var(--slate-light)}
.scheme-option input{position:absolute;opacity:0;pointer-events:none}
.scheme-option.selected{border-color:var(--teal);box-shadow:0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent)}
.scheme-swatch{height:56px;border-radius:8px;margin-bottom:10px;display:flex;align-items:flex-end;justify-content:flex-end;padding:6px}
.scheme-check{display:none;width:24px;height:24px;border-radius:50%;background:#fff;color:#2d2d2d;align-items:center;justify-content:center;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.scheme-option.selected .scheme-check{display:flex}
.scheme-name{font-weight:700;color:var(--navy);font-size:15px}
.scheme-colors{font-size:12.5px;color:var(--slate);margin-top:2px}
