* { box-sizing: border-box; }
:root {
  --bg: #eef3fb;
  --surface: rgba(255,255,255,0.88);
  --surface-strong: #ffffff;
  --text: #172033;
  --muted: #66758f;
  --line: #dbe5f3;
  --line-soft: #edf3fb;
  --primary: #284bce;
  --primary-2: #5c7cff;
  --dark: #0f1b34;
  --success: #159067;
  --warning: #f59e0b;
  --danger: #e25555;
  --shadow: 0 18px 45px rgba(30, 43, 71, 0.10);
  --radius: 24px;
}
html, body { margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; background: radial-gradient(circle at top left, #f9fbff 0, #edf3fb 36%, #eef3fb 100%); color: var(--text); }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font: inherit; }

.login-body { min-height: 100vh; background: linear-gradient(135deg, #eef4ff, #f8fbff); }
.login-wrapper { max-width: 1240px; margin: 0 auto; padding: 42px 20px; }
.login-card { display: grid; grid-template-columns: 1.1fr 0.9fr; background: rgba(255,255,255,0.95); border-radius: 30px; overflow: hidden; box-shadow: 0 26px 70px rgba(16, 24, 40, 0.10); border: 1px solid rgba(255,255,255,0.55); }
.login-left { background: linear-gradient(145deg, #0e1a36, #122452 52%, #0f1b34); color: #fff; padding: 56px; position: relative; }
.login-left::before, .login-left::after { content: ''; position: absolute; border-radius: 999px; background: rgba(255,255,255,0.08); }
.login-left::before { width: 220px; height: 220px; top: -60px; right: -60px; }
.login-left::after { width: 160px; height: 160px; bottom: -30px; left: -30px; }
.login-right { padding: 52px; background: linear-gradient(180deg, #ffffff, #f8fbff); }
.login-badge { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: rgba(255,255,255,0.12); margin-bottom: 18px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.login-left h1 { font-size: 56px; line-height: 1.03; margin: 0 0 18px; max-width: 520px; position: relative; z-index: 1; }
.login-left p { color: #d8e2f4; max-width: 530px; line-height: 1.7; font-size: 19px; position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 38px; position: relative; z-index: 1; }
.hero-tile { padding: 18px 18px 16px; border-radius: 22px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.08); backdrop-filter: blur(4px); }
.hero-tile strong { display: block; font-size: 18px; margin-bottom: 10px; }
.hero-tile span { color: #d6e1f4; line-height: 1.6; font-size: 15px; }
.login-right h2 { margin-top: 0; font-size: 58px; line-height: 1; margin-bottom: 14px; }
.small-text { color: var(--muted); font-size: 17px; line-height: 1.6; }
.login-form { display: grid; gap: 12px; margin-top: 18px; }
.login-form label { font-size: 14px; color: #455468; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.login-form input, .login-form select, .form-control { width: 100%; padding: 15px 16px; border: 1px solid #d8e0ec; border-radius: 18px; font-size: 18px; background: #fff; transition: .2s ease; box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.login-form input:focus, .login-form select:focus, .form-control:focus { outline: none; border-color: #9ab0ff; box-shadow: 0 0 0 4px rgba(92,124,255,.14); }
.login-form button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; padding: 16px 18px; border: 0; border-radius: 18px; background: linear-gradient(90deg, #132347, #2f5bdf); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 16px 30px rgba(40,75,206,.20); }
.login-form button:hover, .btn:hover { transform: translateY(-1px); }
.btn-secondary { background: #f3f6fd; color: #25427e; box-shadow: none; border: 1px solid #dbe5f3; }
.btn-ghost { background: transparent; color: #e7efff; box-shadow: none; border: 1px solid rgba(255,255,255,.14); }
.btn-small { padding: 11px 14px; font-size: 14px; border-radius: 14px; }
.error-box, .demo-box { margin-top: 20px; padding: 16px 18px; border-radius: 18px; }
.error-box { background: #fff1f1; color: #b42318; border: 1px solid #fecaca; }
.demo-box { background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }
.demo-box p { margin: 10px 0 0; }

.app-shell { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0e1830, #142342 52%, #101a35 100%); color: #fff; padding: 26px 18px 24px; position: sticky; top: 0; height: 100vh; box-shadow: inset -1px 0 0 rgba(255,255,255,.06); }
.sidebar-scroll { overflow-y: auto; height: calc(100vh - 80px); padding-right: 4px; }
.brand { display: flex; align-items: center; gap: 14px; margin: 4px 8px 28px; }
.brand-badge { width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg, #fff, #dfe7ff); color: #162033; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.brand h2 { margin: 0; font-size: 20px; }
.brand p { margin: 4px 0 0; color: #aebcd2; font-size: 13px; }
.nav-section-label { color: rgba(255,255,255,.45); font-size: 11px; text-transform: uppercase; letter-spacing: .18em; margin: 18px 12px 10px; }
.nav-links { display: grid; gap: 6px; }
.nav-links a { color: #dbe7fb; padding: 13px 14px; border-radius: 16px; display: flex; align-items: center; gap: 12px; font-weight: 600; position: relative; }
.nav-links a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-links a.active { background: linear-gradient(90deg, rgba(92,124,255,.28), rgba(26,41,85,.55)); color: #fff; box-shadow: inset 0 0 0 1px rgba(151,175,255,.20); }
.nav-icon { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 auto; }
.nav-links a.active .nav-icon { background: rgba(255,255,255,.16); }
.main-content { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 34px; line-height: 1.1; }
.topbar p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.topbar-right { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.user-chip, .context-chip { background: rgba(255,255,255,.72); border: 1px solid #dbe3ef; border-radius: 999px; padding: 12px 16px; font-weight: 700; color: #334155; box-shadow: 0 6px 18px rgba(15,23,42,.04); }
.context-chip { font-weight: 600; }
.mobile-nav-toggle { display: none; border: 0; border-radius: 14px; padding: 12px 14px; background: var(--surface-strong); box-shadow: var(--shadow); color: var(--text); }
.flash-box { padding:14px 16px; border-radius:18px; margin-bottom:18px; border:1px solid transparent; box-shadow: var(--shadow); }
.flash-box.success { background:#ecfdf3; color:#067647; border-color:#abefc6; }
.flash-box.error { background:#fef3f2; color:#b42318; border-color:#fecdca; }
.flash-box.info { background:#eff8ff; color:#175cd3; border-color:#b2ddff; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { position: relative; overflow: hidden; border-radius: 24px; padding: 22px; color: #fff; box-shadow: 0 18px 34px rgba(22, 32, 51, 0.12); min-height: 140px; }
.stat-card::before { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 999px; background: rgba(255,255,255,.12); right: -30px; top: -35px; }
.stat-card::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 999px; background: rgba(255,255,255,.08); right: 35px; bottom: -72px; }
.stat-card .stat-top { display:flex; align-items:center; justify-content:space-between; gap:12px; position: relative; z-index: 1; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 16px; display:flex; align-items:center; justify-content:center; font-size: 20px; background: rgba(255,255,255,.16); }
.stat-card .stat-label { font-size: 12px; color: rgba(255,255,255,.80); text-transform: uppercase; letter-spacing: .08em; }
.stat-card .stat-value { display:block; font-size: 34px; font-weight: 800; margin-top: 16px; position: relative; z-index: 1; }
.stat-card .stat-meta { margin-top: 8px; color: rgba(255,255,255,.78); font-size: 14px; position: relative; z-index: 1; }
.stat-indigo { background: linear-gradient(135deg, #162033, #24334d); }
.stat-blue { background: linear-gradient(135deg, #1e40af, #2f61ff); }
.stat-purple { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.stat-teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.stat-orange { background: linear-gradient(135deg, #b45309, #f59e0b); }
.stat-red { background: linear-gradient(135deg, #b42318, #f97316); }

.dashboard-grid { display: grid; gap: 18px; margin-bottom: 24px; }
.dashboard-grid.two { grid-template-columns: 1.2fr 1fr; }
.dashboard-grid.three { grid-template-columns: 1.2fr .8fr .8fr; }
.panel { background: var(--surface); backdrop-filter: blur(12px); border: 1px solid rgba(219,229,243,.92); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.panel-header, .panel-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom: 18px; }
.panel-title { font-size: 19px; font-weight: 800; margin: 0; }
.panel-subtitle { color: var(--muted); margin: 5px 0 0; line-height: 1.5; }
.panel-note { color: var(--muted); font-size: 13px; }
.inline-form { display:flex; gap:10px; flex-wrap:wrap; }
.muted { color: var(--muted); margin-top: 12px; }
.alert-list { display: grid; gap: 12px; }
.alert-item { display:flex; gap:12px; align-items:flex-start; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; }
.alert-badge { width: 34px; height: 34px; border-radius: 12px; background: #eef3ff; color: #274dcf; display:flex; align-items:center; justify-content:center; font-size: 16px; flex: 0 0 auto; }

.table { width: 100%; border-collapse: collapse; }
.table thead th { text-align: left; font-size: 12px; text-transform: uppercase; color: #7a889f; padding: 12px 10px; border-bottom: 1px solid #e2e8f0; letter-spacing: .08em; }
.table tbody td { padding: 14px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:hover { background: rgba(239,244,255,.58); }
.badge { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:6px 10px; font-size:12px; font-weight:700; }
.badge.green { background:#ecfdf3; color:#067647; }
.badge.orange { background:#fff6e6; color:#b45309; }
.badge.red { background:#fef3f2; color:#b42318; }
.badge.blue { background:#eff8ff; color:#175cd3; }

.chart-card { overflow: hidden; }
.chart-card .chart-wrap { position: relative; height: 280px; }
.chart-legend { display:flex; gap:16px; flex-wrap:wrap; margin-top:12px; color: var(--muted); font-size: 13px; }
.chart-legend span { display:inline-flex; align-items:center; gap:8px; }
.legend-dot { width:10px; height:10px; border-radius:999px; display:inline-block; }
.chart-svg { width: 100%; height: 100%; display:block; }
.chart-axis-labels, .bar-chart-labels { display:flex; justify-content:space-between; margin-top: 10px; gap:8px; }
.chart-axis-labels span, .bar-chart-labels span { color: var(--muted); font-size: 12px; text-align:center; flex:1; }
.bar-chart { display:flex; align-items:flex-end; gap:14px; height: 240px; }
.bar-group { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }
.bar-stack { width:100%; max-width:56px; display:flex; flex-direction:column; justify-content:flex-end; height: 100%; gap:6px; }
.bar-segment { border-radius: 14px 14px 8px 8px; min-height: 8px; }
.bar-a { background: linear-gradient(180deg, #4169ff, #244bd2); }
.bar-b { background: linear-gradient(180deg, #14b8a6, #0f766e); }
.metric-list { display:grid; gap:14px; }
.metric-item { display:grid; grid-template-columns: 1fr auto; gap:10px; align-items:center; }
.metric-item strong { display:block; }
.progress-track { width:100%; height:12px; background:#e8eef8; border-radius:999px; overflow:hidden; margin-top:8px; }
.progress-fill { height:100%; background: linear-gradient(90deg, #213fca, #5d7cff); border-radius:999px; }
.kpi-row { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:14px; }
.kpi-box { background: linear-gradient(180deg, #f9fbff, #edf3fb); border:1px solid #dfe8f6; border-radius: 18px; padding: 16px; }
.kpi-box .big { font-size: 28px; font-weight: 800; margin-top: 6px; }
.list-card { display:grid; gap:12px; }
.list-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border:1px solid #e4ecf7; border-radius:16px; background:#fbfdff; }
.list-row strong { display:block; }
.list-row span { color: var(--muted); font-size: 13px; }
.avatar-dot { width: 40px; height: 40px; border-radius: 14px; display:flex; align-items:center; justify-content:center; background:#eef3ff; color:#2c51d6; font-weight:800; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed #d9e5f2; border-radius: 18px; background: #fbfdff; }

.module-header { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:18px; flex-wrap:wrap; }
.module-header p { margin:6px 0 0; color:#64748b; }
.module-grid { display:grid; grid-template-columns: 380px 1fr; gap:18px; align-items:start; }
.form-panel, .table-panel { background:#fff; border:1px solid #e2e8f0; border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
.form-grid.one { grid-template-columns: 1fr; }
.field label { display:block; font-size:13px; font-weight:700; color:#475569; margin-bottom:8px; text-transform: uppercase; letter-spacing: .05em; }
.textarea { min-height: 120px; resize: vertical; }
.actions-row { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.toolbar { display:flex; gap:12px; justify-content:space-between; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.search-input { min-width: 240px; }
.info-chip { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border-radius:999px; background:#eff4fb; color:#334155; border:1px solid #dbe3ef; font-weight:700; }
.note-box { background:#f8fbff; border:1px solid #dfe8f7; border-radius:18px; padding:16px; color:#475569; }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid.two, .dashboard-grid.three, .module-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .login-card, .hero-grid, .stats-grid, .kpi-row { grid-template-columns: 1fr; }
  .login-left, .login-right, .main-content { padding: 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .25s ease; z-index: 40; height: auto; }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::before { content:''; position: fixed; inset:0; background: rgba(15,23,42,.45); z-index: 30; }
  .mobile-nav-toggle { display: inline-flex; align-items:center; gap:8px; }
  .topbar { flex-direction: column; }
  .topbar-right { width:100%; }
}


/* Premium module pages */
.module-header {
  position: relative;
  padding: 26px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(19,35,71,.96), rgba(47,91,223,.88));
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 22px 38px rgba(23,39,74,.18);
}
.module-header::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -34px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.module-header h2 { margin: 0; font-size: 28px; line-height: 1.15; }
.module-header p { max-width: 760px; color: rgba(255,255,255,.82); font-size: 15px; }
.module-grid { margin-top: 18px; }
.form-panel, .table-panel, .data-panel, .report-card, .receipt-card {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(219,229,243,.96);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 16px 34px rgba(15,23,42,.08);
  backdrop-filter: blur(10px);
}
.data-panel { min-width: 0; }
.form-group, .field { display: flex; flex-direction: column; gap: 8px; }
.form-group label, .field label, .label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #5b6b82;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.form-group input,
.form-group select,
.form-group textarea,
.field input,
.field select,
.field textarea,
.search-input,
textarea,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbe5f3;
  background: #f8fbff;
  color: #1f2937;
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
textarea:focus,
input:focus,
select:focus {
  border-color: #7b9cff;
  box-shadow: 0 0 0 4px rgba(93,124,255,.14);
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.btn-primary { background: linear-gradient(90deg, #132347, #2f5bdf); color: #fff; }
.btn-secondary { background: #f3f6fd; color: #25427e; box-shadow: none; border: 1px solid #dbe5f3; }
.btn-danger { background: linear-gradient(90deg, #b42318, #f97316); color: #fff; }
.actions-cell, .table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table tbody td .btn { margin-top: 0; }
.small-text { color: var(--muted); font-size: 13px; }
.value { font-size: 28px; font-weight: 800; color: #132347; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 18px; }
.full-width { grid-column: 1 / -1; }
.message-quote {
  background: #f8fbff;
  border-left: 4px solid #5d7cff;
  padding: 14px 16px;
  border-radius: 14px;
  color: #475569;
}
.receipt-body, .report-meta, .receipt-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.receipt-header, .report-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.receipt-table, .report-card table { width: 100%; border-collapse: collapse; }
.receipt-table td, .receipt-table th, .report-card td, .report-card th {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
}
.receipt-footer, .report-signatures {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 20px;
}
.separator { height: 1px; background: #e7eef7; margin: 18px 0; }
@media (max-width: 1200px) {
  .report-grid, .receipt-body, .report-meta, .receipt-meta, .receipt-footer, .report-signatures { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .module-header { padding: 22px; }
  .module-header h2 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
}

.checkbox-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-top:8px}.checkbox-card{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.68);border:1px solid rgba(148,163,184,.28);padding:12px 14px;border-radius:16px;font-weight:600;color:#0f172a}.checkbox-card input{width:auto;margin:0}.actions-row{display:flex;gap:10px;flex-wrap:wrap}


.segmented-switch{display:flex;gap:10px;flex-wrap:wrap}
.segmented-switch a{display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:999px;border:1px solid rgba(37,99,235,.18);background:#eef4ff;color:#1d4ed8;font-weight:700;text-decoration:none}
.segmented-switch a.active{background:linear-gradient(135deg,#1d4ed8,#0f172a);color:#fff;border-color:transparent;box-shadow:0 10px 25px rgba(29,78,216,.25)}
.compact-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.table-card{background:#f8fbff;border:1px solid #dbe7ff;border-radius:16px;padding:16px}
.table-card-title{font-weight:800;color:#0f172a;margin-bottom:10px}
.table-responsive{overflow:auto}
.bulk-entry-table input,.bulk-entry-table select{min-width:140px;padding:10px;border:1px solid #d1d5db;border-radius:10px;background:#fff}
.bulk-entry-table td{vertical-align:top}
@media (max-width: 900px){.compact-grid{grid-template-columns:1fr}}
.module-actions-row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.module-actions-row .btn{display:inline-flex;align-items:center;justify-content:center}
