/* ============================================================
   GDE FEEDING SCHEME — DESIGN SYSTEM
   Palette: #7B7E8E (primary), #1702B6 (secondary/accent),
            #100B00 (dark), #F4D35E (gold), #F8F1FF (light)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #7B7E8E;
  --accent: #1702B6;
  --accent-dark: #110188;
  --dark: #100B00;
  --gold: #F4D35E;
  --light: #F8F1FF;
  --bg: #F3F2F8;
  --surface: #FFFFFF;
  --surface-2: #F8F7FC;
  --border: #E2E0EC;
  --border-strong: #CCCAD8;
  --text-1: #100B00;
  --text-2: #4A4858;
  --text-3: #7B7E8E;
  --text-inv: #F8F1FF;
  --sidebar-w: 256px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(23,2,182,.06), 0 4px 12px rgba(23,2,182,.04);
  --shadow-md: 0 4px 16px rgba(23,2,182,.10);

  --status-pending-bg: #FFF8E1; --status-pending-text: #8B6914; --status-pending-border: #F4D35E;
  --status-approved-bg: #E8F5E9; --status-approved-text: #2E7D32; --status-approved-border: #81C784;
  --status-rejected-bg: #FFEBEE; --status-rejected-text: #C62828; --status-rejected-border: #EF9A9A;
  --status-draft-bg: #F3F2F8; --status-draft-text: #7B7E8E; --status-draft-border: #CCCAD8;
}

body { font-family: 'DM Sans', system-ui, sans-serif; font-size: 15px; color: var(--text-1); background: var(--bg); line-height: 1.6; }

h1 { font-family: 'Syne', sans-serif; font-size: 1.75rem; font-weight: 800; color: var(--dark); line-height: 1.2; }
h2 { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--dark); }
h3 { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--dark); }
h4 { font-size: 0.9rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

/* ---- BUTTONS ---- */
.btn-primary, .btn-secondary, .btn-ghost, .btn-success, .btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent; transition: all .18s ease; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #1201A0; border-color: #1201A0; text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn-success { background: #2E7D32; color: #fff; border-color: #2E7D32; }
.btn-success:hover { background: #1B5E20; }
.btn-danger { background: #C62828; color: #fff; border-color: #C62828; }
.btn-danger:hover { background: #8B0000; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; text-decoration: none; }
.btn-sm.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-sm.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-sm.btn-success { background: #2E7D32; color: #fff; border-color: #2E7D32; }
.btn-sm.btn-danger { background: #C62828; color: #fff; border-color: #C62828; }

/* ---- FORMS ---- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="tel"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; color: var(--text-1); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,2,182,.1); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%237B7E8E' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-hint { font-size: 0.75rem; color: var(--text-3); }
.req { color: #C62828; }

/* ---- AUTH PAGES ---- */
.auth-body { min-height: 100vh; background: var(--bg); display: flex; align-items: stretch; }
.auth-split { display: flex; min-height: 100vh; width: 100%; }

.auth-brand-panel {
  width: 420px; min-width: 380px; background: var(--accent);
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem; position: relative; overflow: hidden;
}
.auth-brand-inner { position: relative; z-index: 2; }
.auth-logo { margin-bottom: 1.5rem; }
.auth-brand-name { font-family: 'Syne', sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--gold); display: block; line-height: 1; }
.auth-brand-tagline { color: rgba(248,241,255,.8); font-size: 1rem; margin-top: .5rem; line-height: 1.5; display: block; }
.auth-brand-dept { margin-top: 1.5rem; display: inline-block; background: rgba(244,211,94,.15); border: 1px solid rgba(244,211,94,.3); border-radius: 6px; padding: 6px 12px; color: var(--gold); font-size: 0.8rem; font-weight: 600; }
.auth-stats { display: flex; gap: 2rem; margin-top: 2.5rem; }
.auth-stat { display: flex; flex-direction: column; }
.stat-num { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--gold); line-height: 1; }
.stat-label { font-size: 0.75rem; color: rgba(248,241,255,.7); margin-top: 2px; }
.art-circle { position: absolute; border-radius: 50%; }
.c1 { width: 300px; height: 300px; background: rgba(244,211,94,.06); top: -80px; right: -80px; }
.c2 { width: 200px; height: 200px; background: rgba(248,241,255,.04); bottom: 40px; right: 40px; }
.c3 { width: 100px; height: 100px; background: rgba(244,211,94,.08); bottom: -20px; left: 60px; }

.auth-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form-inner { width: 100%; max-width: 440px; }

.portal-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius); padding: 4px; margin-bottom: 1.5rem; }
.portal-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: none; background: none; border-radius: 8px; font-size: 0.78rem; font-weight: 600; color: var(--text-3); cursor: pointer; transition: all .15s; white-space: nowrap; }
.portal-tab.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.auth-form-header { margin-bottom: 1.5rem; }
.auth-form-header h2 { margin-bottom: 4px; }
.form-desc { color: var(--text-3); font-size: 0.875rem; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; }

.auth-links { display: flex; align-items: center; gap: 8px; margin-top: 1rem; flex-wrap: wrap; }
.auth-link { color: var(--accent); font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }
.auth-sep { color: var(--border-strong); }
.auth-note { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 0.75rem; margin-top: 1.5rem; }

/* ---- REGISTER PAGE ---- */
.register-page { min-height: 100vh; background: var(--bg); padding-bottom: 4rem; }
.register-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 2rem; display: flex; align-items: center; gap: 2rem; }
.register-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: var(--dark); }
.register-container { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; }
.register-info { background: var(--accent); border-radius: var(--radius-lg); padding: 1.5rem 2rem; margin-bottom: 2rem; color: #fff; }
.register-info h2 { color: var(--gold); font-family: 'Syne', sans-serif; margin-bottom: .5rem; }
.register-info p { color: rgba(248,241,255,.85); margin-bottom: 1rem; }
.register-rules { display: flex; flex-direction: column; gap: 6px; }
.rule-item { display: flex; align-items: center; gap: 8px; color: rgba(248,241,255,.9); font-size: 0.875rem; }

.register-form { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.form-section { padding: 1.75rem 2rem; border-bottom: 1px solid var(--bg); }
.form-section:last-of-type { border-bottom: none; }
.section-title { display: flex; align-items: center; gap: 10px; font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--dark); }
.section-num { background: var(--accent); color: var(--gold); width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; flex-shrink: 0; }
.form-actions { padding: 1.25rem 2rem; background: var(--bg); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- AUTH SIMPLE ---- */
.auth-simple { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-simple-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 2rem; }
.auth-logo-sm { margin-bottom: 1rem; }

/* ---- BACK LINK ---- */
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 0.8rem; margin-bottom: .5rem; font-weight: 500; }
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ---- APP LAYOUT ---- */
.app-body { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w); background: var(--dark);
  display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0;
  border-right: 1px solid rgba(244,211,94,.1); overflow-y: auto;
}
.sidebar-brand { padding: 1.5rem 1.25rem 1rem; display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--gold); line-height: 1; }
.brand-sub { font-size: 0.65rem; color: rgba(248,241,255,.4); margin-top: 2px; }

.sidebar-user { margin: 0 1rem .5rem; padding: .75rem; background: rgba(244,211,94,.07); border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--gold); flex-shrink: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--light); display: block; line-height: 1.2; }
.user-role { font-size: 0.65rem; color: rgba(248,241,255,.5); display: block; margin-top: 2px; }

.nav-menu { list-style: none; padding: .5rem 0; flex: 1; }
.nav-section-label { font-size: 0.65rem; font-weight: 700; color: rgba(248,241,255,.25); text-transform: uppercase; letter-spacing: 0.1em; padding: 1rem 1.25rem .25rem; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 1.25rem; color: rgba(248,241,255,.65); font-size: 0.875rem; font-weight: 500; transition: all .15s; border-radius: 0; text-decoration: none; }
.nav-link:hover { color: var(--light); background: rgba(244,211,94,.05); text-decoration: none; }
.nav-link.active { color: var(--gold); background: rgba(244,211,94,.12); border-right: 2px solid var(--gold); }

.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(248,241,255,.08); }
.btn-logout { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: none; border: 1px solid rgba(248,241,255,.12); border-radius: var(--radius-sm); color: rgba(248,241,255,.5); font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.btn-logout:hover { background: rgba(248,241,255,.06); color: rgba(248,241,255,.8); }

/* ---- MAIN CONTENT ---- */
.app-main { flex: 1; padding: 2rem; min-width: 0; max-width: calc(100vw - var(--sidebar-w)); }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; }
.page-subtitle { color: var(--text-3); font-size: 0.875rem; margin-top: 3px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ---- ALERTS ---- */
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem; border: 1px solid; }
.alert-success { background: var(--status-approved-bg); color: var(--status-approved-text); border-color: var(--status-approved-border); }
.alert-error { background: var(--status-rejected-bg); color: var(--status-rejected-text); border-color: var(--status-rejected-border); }
.alert-info { background: #E3F2FD; color: #1565C0; border-color: #90CAF9; }

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 1rem 1.25rem; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.stat-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-blue { background: rgba(21,101,192,.1); color: #1565C0; }
.icon-yellow { background: rgba(244,211,94,.2); color: #8B6914; }
.icon-green { background: rgba(46,125,50,.1); color: #2E7D32; }
.icon-red { background: rgba(198,40,40,.1); color: #C62828; }
.icon-purple { background: rgba(23,2,182,.1); color: var(--accent); }
.stat-body { display: flex; flex-direction: column; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-3); margin-top: 2px; font-weight: 500; }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dash-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.25rem; box-shadow: var(--shadow); }
.dash-card-lg { grid-column: 1; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header h3 { margin: 0; }
.card-link { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.badge-count { background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; }

/* ---- FORM LIST ---- */
.form-list { display: flex; flex-direction: column; gap: 2px; }
.form-list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.form-list-item:last-child { border-bottom: none; }
.form-list-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.form-list-title { font-size: 0.875rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-list-meta { font-size: 0.75rem; color: var(--text-3); }
.form-list-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---- STATUS BADGES ---- */
.status-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; border: 1px solid; white-space: nowrap; }
.status-pending { background: var(--status-pending-bg); color: var(--status-pending-text); border-color: var(--status-pending-border); }
.status-approved { background: var(--status-approved-bg); color: var(--status-approved-text); border-color: var(--status-approved-border); }
.status-rejected { background: var(--status-rejected-bg); color: var(--status-rejected-text); border-color: var(--status-rejected-border); }
.status-draft { background: var(--status-draft-bg); color: var(--status-draft-text); border-color: var(--status-draft-border); }
.status-lg { font-size: 0.8rem; padding: 5px 14px; }

.type-badge { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; background: rgba(23,2,182,.07); color: var(--accent); }

/* ---- SUPPLY COMPONENTS ---- */
.supply-list { display: flex; flex-direction: column; gap: 10px; }
.supply-item { display: flex; flex-direction: column; gap: 4px; }
.supply-item-header { display: flex; justify-content: space-between; align-items: center; }
.supply-name { font-size: 0.85rem; font-weight: 600; color: var(--text-1); }
.supply-stock { font-size: 0.8rem; font-weight: 700; }
.supply-stock.critical { color: #C62828; }
.supply-stock.low { color: #E65100; }
.supply-stock.ok { color: #2E7D32; }
.supply-bar-track { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.supply-bar-lg { height: 10px; }
.supply-bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.supply-bar-critical { background: #C62828; }
.supply-bar-low { background: #FF8F00; }
.supply-bar-ok { background: #2E7D32; }
.supply-bar-full { background: #1B5E20; }
.supply-min { font-size: 0.7rem; color: var(--text-3); }
.supply-alert { display: flex; align-items: center; gap: 8px; margin-top: 1rem; padding: 8px 12px; background: var(--status-rejected-bg); border: 1px solid var(--status-rejected-border); border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--status-rejected-text); }
.supply-alert-page { margin-top: 1.5rem; padding: 12px 16px; font-size: 0.875rem; }
.supply-alert a { color: inherit; font-weight: 700; }

/* ---- SUPPLIES GRID ---- */
.supplies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.supply-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.25rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.supply-card-critical { border-left: 3px solid #C62828; }
.supply-card-low { border-left: 3px solid #FF8F00; }
.supply-card-ok { border-left: 3px solid #2E7D32; }
.supply-card-full { border-left: 3px solid #1B5E20; }
.supply-card-header { display: flex; justify-content: space-between; align-items: center; }
.supply-card-name { font-size: 0.9rem; font-weight: 700; color: var(--dark); }
.supply-level-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.level-critical { background: var(--status-rejected-bg); color: var(--status-rejected-text); }
.level-low { background: #FFF3E0; color: #E65100; }
.level-ok { background: var(--status-approved-bg); color: var(--status-approved-text); }
.level-full { background: #E8F5E9; color: #1B5E20; }
.supply-big-num { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; color: var(--dark); line-height: 1; }
.supply-unit { font-size: 0.85rem; color: var(--text-3); font-weight: 500; }
.supply-card-footer { display: flex; justify-content: space-between; align-items: center; }
.supply-min-label { font-size: 0.72rem; color: var(--text-3); }
.supply-pct { font-size: 0.85rem; font-weight: 700; color: var(--text-2); }
.supply-updated { font-size: 0.7rem; color: var(--text-3); }
.supply-update-form { margin-top: .5rem; padding-top: .75rem; border-top: 1px solid var(--bg); }
.inline-update-form { display: flex; gap: 8px; align-items: center; }
.inline-input { width: 80px !important; }

/* ---- QUICK ACTIONS ---- */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; background: var(--bg); border-radius: var(--radius-sm); border: 1.5px solid var(--border); color: var(--text-2); font-size: 0.75rem; font-weight: 600; text-align: center; cursor: pointer; transition: all .15s; text-decoration: none; }
.quick-action-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ---- ATTENTION BANNER ---- */
.attention-banner { display: flex; align-items: center; gap: 10px; background: #FFF8E1; border: 1px solid var(--gold); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 1.5rem; font-size: 0.875rem; color: #8B6914; }
.attention-banner a { color: inherit; font-weight: 700; margin-left: auto; }

/* ---- FILTER BAR ---- */
.filter-bar { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.filter-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.75rem; font-weight: 600; color: var(--text-3); }
.filter-group input, .filter-group select { width: auto; min-width: 150px; }

/* ---- TABLE ---- */
.table-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--bg); font-size: 0.875rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.cell-primary { font-weight: 600; color: var(--text-1); }
.cell-secondary { font-size: 0.78rem; color: var(--text-3); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.emis-code { background: rgba(23,2,182,.06); color: var(--accent); }
.action-btns { display: flex; gap: 6px; }
.quintile-badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.q1, .q2, .q3 { background: #E8F5E9; color: #2E7D32; }
.q4, .q5 { background: rgba(23,2,182,.08); color: var(--accent); }

/* ---- FORM TYPE SELECTOR ---- */
.form-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1.5rem; }
.form-type-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 1rem; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all .15s; color: var(--text-2); font-size: 0.8rem; font-weight: 600; text-align: center; }
.form-type-card:hover { border-color: var(--accent); color: var(--accent); }
.form-type-card.active { border-color: var(--accent); background: rgba(23,2,182,.05); color: var(--accent); }

/* ---- FORM CARD ---- */
.form-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.form-card .form-section { padding: 1.5rem 2rem; border-bottom: 1px solid var(--bg); }
.form-card .form-actions { padding: 1.25rem 2rem; background: var(--bg); display: flex; justify-content: flex-end; gap: 10px; }
.dynamic-fields {}

/* ---- DETAIL VIEW ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.detail-main { display: flex; flex-direction: column; gap: 16px; }
.detail-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.5rem; box-shadow: var(--shadow); }
.detail-meta-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1rem; }
.detail-meta-item { display: flex; flex-direction: column; gap: 3px; }
.meta-label { font-size: 0.72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: 0.9rem; font-weight: 600; color: var(--text-1); }
.detail-divider { height: 1px; background: var(--bg); margin: 1rem 0; }
.detail-section-title { font-size: 0.9rem; font-weight: 700; color: var(--text-2); margin-bottom: .75rem; }
.data-table-simple { display: flex; flex-direction: column; gap: 0; }
.data-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--bg); font-size: 0.875rem; }
.data-row:last-child { border-bottom: none; }
.data-key { color: var(--text-3); font-weight: 500; }
.data-val { color: var(--text-1); font-weight: 600; text-align: right; }

.feedback-card { border-radius: var(--radius); padding: 1rem 1.25rem; border: 1px solid; }
.feedback-approved { background: var(--status-approved-bg); border-color: var(--status-approved-border); color: var(--status-approved-text); }
.feedback-rejected { background: var(--status-rejected-bg); border-color: var(--status-rejected-border); color: var(--status-rejected-text); }
.feedback-header { display: flex; align-items: center; gap: 8px; margin-bottom: .5rem; font-weight: 700; font-size: 0.875rem; }
.feedback-date { margin-left: auto; font-size: 0.8rem; font-weight: 400; }
.feedback-body { font-size: 0.875rem; }

.review-panel { background: var(--surface); border-radius: var(--radius-lg); border: 2px solid var(--gold); padding: 1.5rem; }
.review-panel h3 { margin-bottom: 1rem; color: var(--dark); }
.review-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1rem; }

.detail-sidebar { display: flex; flex-direction: column; gap: 14px; }
.sidebar-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.25rem; box-shadow: var(--shadow); }
.sidebar-card h4 { margin-bottom: 1rem; }
.sidebar-actions { display: flex; flex-direction: column; gap: 8px; }
.sidebar-action-btn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); color: var(--text-2); font-size: 0.8rem; font-weight: 600; text-decoration: none; transition: all .15s; }
.sidebar-action-btn:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* Status timeline */
.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 1rem; position: relative; }
.timeline-step:not(:last-child)::after { content: ''; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1.5px; background: var(--border); }
.timeline-step.done::after { background: var(--status-approved-border); }
.step-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--border); border: 2px solid var(--border-strong); flex-shrink: 0; margin-top: 2px; }
.timeline-step.done .step-dot { background: var(--status-approved-border); border-color: var(--status-approved-border); }
.timeline-step.current .step-dot { background: var(--gold); border-color: #B8860B; }
.timeline-step.done.approved .step-dot { background: #2E7D32; border-color: #1B5E20; }
.timeline-step.done.rejected .step-dot { background: #C62828; border-color: #8B0000; }
.step-info { display: flex; flex-direction: column; gap: 1px; }
.step-name { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.step-date { font-size: 0.72rem; color: var(--text-3); }

/* ---- MESSAGES ---- */
.compose-panel { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 1.5rem; box-shadow: var(--shadow-md); }
.compose-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bg); }
.compose-form { padding: 1.25rem; display: flex; flex-direction: column; gap: 12px; }
.compose-form .form-actions { padding: 0; background: none; }

.msg-tabs { display: flex; gap: 4px; margin-bottom: 1rem; border-bottom: 2px solid var(--border); }
.msg-tab { padding: 8px 16px; border: none; background: none; font-size: 0.875rem; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; display: flex; align-items: center; gap: 6px; }
.msg-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.unread-badge { background: #C62828; color: #fff; font-size: 0.65rem; font-weight: 700; border-radius: 999px; padding: 1px 6px; }

.msg-list { display: flex; flex-direction: column; gap: 4px; }
.msg-item { display: flex; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.msg-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(23,2,182,.1); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.msg-avatar-sent { background: rgba(46,125,50,.1); color: #2E7D32; }
.msg-body { flex: 1; min-width: 0; }
.msg-from { font-size: 0.8rem; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 6px; }
.msg-role { font-size: 0.65rem; font-weight: 600; color: var(--text-3); background: var(--bg); border-radius: 4px; padding: 1px 5px; }
.msg-subject { font-size: 0.875rem; font-weight: 600; color: var(--text-1); }
.msg-preview { font-size: 0.8rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.msg-date { font-size: 0.72rem; color: var(--text-3); }

/* ---- TICKETS ---- */
.tickets-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.25rem; box-shadow: var(--shadow); }
.ticket-open { border-left: 3px solid var(--gold); }
.ticket-resolved { border-left: 3px solid #2E7D32; opacity: .85; }
.ticket-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.ticket-subject { font-size: 1rem; font-weight: 700; color: var(--dark); display: block; }
.ticket-meta { font-size: 0.75rem; color: var(--text-3); display: block; margin-top: 2px; }
.ticket-badges { display: flex; gap: 6px; flex-shrink: 0; }
.priority-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.priority-low { background: #E8F5E9; color: #2E7D32; }
.priority-medium { background: #FFF8E1; color: #8B6914; }
.priority-high { background: #FFF3E0; color: #E65100; }
.priority-critical { background: var(--status-rejected-bg); color: var(--status-rejected-text); }
.ticket-desc { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }
.ticket-response { margin-top: 1rem; padding: 10px 14px; background: var(--status-approved-bg); border-radius: var(--radius-sm); border: 1px solid var(--status-approved-border); }
.ticket-response-label { font-size: 0.75rem; font-weight: 700; color: var(--status-approved-text); display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.ticket-response p { font-size: 0.875rem; color: #2E7D32; }
.ticket-respond-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bg); }

/* ---- SUMMARY LIST ---- */
.summary-list { display: flex; flex-direction: column; }
.summary-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.summary-item:last-child { border-bottom: none; }
.summary-label { font-size: 0.875rem; color: var(--text-2); }
.summary-value { font-size: 0.95rem; font-weight: 700; color: var(--dark); }
.summary-value.highlight { color: var(--accent); font-size: 1.1rem; }

/* ---- EMPTY STATE ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 2rem; text-align: center; color: var(--text-3); }
.empty-state.large { padding: 4rem 2rem; }
.empty-state.small { padding: 1rem; }

/* ---- ICON BTN ---- */
.icon-btn { display: flex; align-items: center; justify-content: center; padding: 5px; background: none; border: none; color: var(--text-3); cursor: pointer; border-radius: 6px; }
.icon-btn:hover { background: var(--bg); color: var(--accent); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-type-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .app-main { padding: 1rem; max-width: 100vw; }
  .auth-split { flex-direction: column; }
  .auth-brand-panel { width: 100%; min-width: unset; min-height: 220px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   FORM-SPECIFIC STYLES (Forms 1–5)
   ============================================================ */

/* Compact table inputs */
.compact-input { width: 100% !important; min-width: 60px; padding: 5px 7px !important; font-size: 0.78rem !important; border-radius: 4px !important; }
.num-input { min-width: 56px; text-align: right; }

/* Register tables (scrollable wide tables) */
.register-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.register-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.register-table th { background: var(--bg); padding: 7px 10px; text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.register-table td { padding: 5px 6px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.register-table tr:last-child td { border-bottom: none; }
.register-table tr:hover td { background: var(--surface-2); }
.register-totals { display: flex; gap: 1.5rem; padding: .5rem 0; font-size: 0.82rem; color: var(--text-3); }

/* Checklist tables (Sections B, D) */
.checklist-table { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.checklist-header { display: grid; grid-template-columns: 2fr 2fr 60px 60px; gap: 0; background: var(--bg); padding: 8px 14px; font-size: 0.72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.checklist-row { display: grid; grid-template-columns: 2fr 2fr 60px 60px; gap: 0; padding: 10px 14px; border-bottom: 1px solid var(--bg); align-items: center; }
.checklist-row:last-child { border-bottom: none; }
.checklist-row:hover { background: var(--surface-2); }
.checklist-q { font-size: 0.85rem; color: var(--text-1); line-height: 1.4; }
.checklist-guidance { font-size: 0.75rem; color: var(--text-3); padding-right: 1rem; line-height: 1.4; }
.checklist-row span:nth-child(3), .checklist-row span:nth-child(4) { display: flex; justify-content: center; }
.pts-hint { font-size: 0.7rem; color: var(--accent); font-style: normal; }

/* Radio & Checkbox groups */
.radio-group { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.radio-group-block { flex-direction: column; gap: .6rem; }
.radio-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; color: var(--text-1); }
.radio-opt input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.checkbox-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; padding: 6px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); transition: all .15s; }
.checkbox-opt:hover { border-color: var(--accent); }
.checkbox-opt input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-opt input:checked ~ span, .checkbox-opt:has(input:checked) { border-color: var(--accent); background: rgba(23,2,182,.04); }
.checkbox-group-lg .checkbox-opt-lg { padding: 10px 14px; font-weight: 500; }

/* KPI summary */
.kpi-summary { background: var(--bg); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.kpi-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 1rem; display: flex; flex-direction: column; gap: 4px; }
.kpi-card.kpi-total { border: 2px solid var(--accent); background: rgba(23,2,182,.04); }
.kpi-label { font-size: 0.72rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-val { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--dark); }
.kpi-total .kpi-val { color: var(--accent); }
.score-tag { font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--accent); background: rgba(23,2,182,.08); border-radius: 6px; padding: 2px 10px; margin-left: .75rem; }

/* Grade table */
.grade-table-wrap { overflow-x: auto; }
.grade-table td, .grade-table th { padding: 7px 12px; }
.grade-table .grade-total { font-weight: 700; color: var(--accent); text-align: right; }
.grade-grand-total td { background: var(--bg); font-size: 0.9rem; }

/* Delivery table */
.delivery-table th { white-space: nowrap; font-size: 0.68rem; }
.group-label { font-weight: 800; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: rgba(23,2,182,.04); vertical-align: middle; text-align: center; }

/* Stock control */
.stock-group { margin-bottom: 1.5rem; }
.stock-group-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .5rem; }
.stock-close { font-weight: 700; text-align: right; color: var(--dark); }
.unit-badge { font-size: 0.72rem; font-weight: 600; color: var(--text-3); background: var(--bg); border-radius: 4px; padding: 2px 6px; }

/* Form subsection */
.form-subsection { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bg); }

/* ============================================================
   FORM SELECTOR GALLERY (forms/new.ejs)
   ============================================================ */
.form-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}
.form-select-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all .18s ease;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.form-select-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.form-select-card--primary {
  border-color: var(--accent);
  background: rgba(23,2,182,.03);
}
.form-select-card--primary:hover {
  background: rgba(23,2,182,.07);
}
.fsc-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fsc-icon--blue   { background: rgba(21,101,192,.1); color: #1565C0; }
.fsc-icon--green  { background: rgba(46,125,50,.1); color: #2E7D32; }
.fsc-icon--purple { background: rgba(23,2,182,.1); color: var(--accent); }
.fsc-icon--amber  { background: rgba(244,211,94,.25); color: #8B6914; }
.fsc-icon--red    { background: rgba(198,40,40,.1); color: #C62828; }
.fsc-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.fsc-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  background: rgba(23,2,182,.08);
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}
.fsc-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}
.fsc-body p {
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.5;
  margin: 0;
}
.fsc-freq {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 2px;
}
