:root {
  --bg: #0a0c10;
  --bg2: #111318;
  --bg3: #171a22;
  --surface: #1c2030;
  --surface2: #222840;
  --border: #2e3448;
  --primary: #4f8ef7;
  --primary-dark: #3a72d8;
  --accent: #00d4aa;
  --accent2: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --text: #eef0f8;
  --text2: #9099b0;
  --text3: #5a6275;
  --sidebar-w: 275px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 15px;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 100; transition: transform .3s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 18px; border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.brand-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.company-switcher {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  background: var(--surface); margin: 12px 10px 4px; border-radius: var(--radius);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text2);
  transition: background .2s; border: 1px solid var(--border);
}
.company-switcher:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav { flex: 1; padding: 6px 0; }
.nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: 1.8px;
  color: var(--text3); padding: 16px 18px 5px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px; color: var(--text2); text-decoration: none;
  font-size: 14.5px; font-weight: 500; transition: all .15s;
  cursor: pointer; border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--primary); background: rgba(79,142,247,.1); border-left-color: var(--primary); }
.nav-item i { width: 20px; text-align: center; font-size: 14px; opacity: .8; }
.nav-item.child { padding-left: 46px; font-size: 14px; }
.nav-item.child:hover { background: rgba(79,142,247,.05); }
.nav-arrow { margin-left: auto; font-size: 10px !important; transition: transform .25s; }
.nav-parent.open .nav-arrow { transform: rotate(90deg); }
.nav-children { display: none; }
.nav-parent.open + .nav-children { display: block; }
.sidebar-footer { padding: 14px 10px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: var(--radius); padding: 10px 12px; border: 1px solid var(--border);
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; color: #fff;
}

/* ── MAIN ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 62px; background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-plan {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  border: 1px solid var(--primary); padding: 4px 10px; border-radius: 20px;
}
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; }
.page-body { padding: 28px; }

/* ── CARDS ── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 22px 26px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 22px;
  position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--stat-color,var(--primary)); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px;
  background: var(--stat-bg,rgba(79,142,247,.12)); color: var(--stat-color,var(--primary));
}
.stat-value { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 13px; color: var(--text2); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table.erp-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.erp-table th {
  background: var(--bg3); color: var(--text2); font-size: 12px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; padding: 12px 16px;
  text-align: left; border-bottom: 1px solid var(--border);
}
.erp-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 15px; }
.erp-table tr:hover td { background: rgba(79,142,247,.04); }
.erp-table tr:last-child td { border-bottom: none; }

/* ── TALLY-STYLE REPORT TABLE ── */
table.tally-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tally-table th {
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: .5px; padding: 13px 18px; text-align: left;
}
.tally-table th.right { text-align: right; }
.tally-table td { padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 15px; }
.tally-table tr:hover td { background: rgba(79,142,247,.05); }
.tally-table .group-row td {
  background: var(--bg3); font-weight: 700; font-size: 14px;
  color: var(--text2); padding: 9px 18px; text-transform: uppercase; letter-spacing: .5px;
}
.tally-table .sub-row td { padding-left: 32px; color: var(--text); }
.tally-table .total-row td {
  background: var(--surface); font-weight: 800; font-size: 16px;
  font-family: 'Syne', sans-serif; padding: 14px 18px;
  border-top: 2px solid var(--border);
}
.tally-table .grand-row td {
  font-weight: 800; font-size: 17px; font-family: 'Syne', sans-serif;
  padding: 16px 18px; border-top: 3px solid var(--primary);
}

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 15px; color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 15px; transition: border-color .2s; outline: none; width: 100%;
}
.form-control:focus { border-color: var(--primary); background: var(--surface2); }
.form-control::placeholder { color: var(--text3); }
select.form-control option { background: var(--surface); }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 15px;
  font-weight: 600; cursor: pointer; border: none; transition: all .2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #0a0c10; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.badge-success { background: rgba(34,197,94,.15); color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-primary { background: rgba(79,142,247,.15); color: var(--primary); }

/* ── FLASH ── */
.flash { padding: 12px 18px; border-radius: 8px; font-size: 15px; font-weight: 500; animation: slideIn .3s ease; }
.flash-success { background: rgba(34,197,94,.12); color: var(--success); border: 1px solid rgba(34,197,94,.3); }
.flash-error   { background: rgba(239,68,68,.12); color: var(--danger);  border: 1px solid rgba(239,68,68,.3); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.page-header h1 { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; }

/* ── AUTH ── */
.auth-page { display: flex; min-height: 100vh; align-items: stretch; }
.auth-left {
  flex: 1; background: linear-gradient(135deg,#0d1524,#0d1e35);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; padding: 60px; position: relative; overflow: hidden;
}
.auth-left::before {
  content:''; position:absolute; width:500px; height:500px;
  background:radial-gradient(circle,rgba(79,142,247,.12) 0%,transparent 70%);
  top:50%; left:50%; transform:translate(-50%,-50%);
}
.auth-right { width: 500px; background: var(--bg2); display: flex; align-items: center; justify-content: center; padding: 60px 50px; }
.auth-box { width: 100%; }
.auth-logo { font-family: 'Syne', sans-serif; font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.auth-tagline { color: var(--text2); margin-bottom: 34px; font-size: 15px; }

/* ── MODAL ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.8); z-index:999; align-items:flex-start; justify-content:center; overflow-y:auto; padding:24px; }
.modal-box { background:var(--bg2); border:1px solid var(--border); border-radius:14px; width:860px; max-width:98vw; margin:auto; padding:28px; }
.modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; }
.modal-title { font-family:'Syne',sans-serif; font-weight:800; font-size:20px; }
.modal-close { background:none; border:none; color:var(--text2); cursor:pointer; font-size:22px; padding:4px; transition:color .2s; }
.modal-close:hover { color:var(--danger); }

/* ── VOUCHER TYPE TABS ── */
.vtype-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:22px; }
.vtype-tab {
  padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); color: var(--text2);
  background: var(--surface); transition: all .2s; text-decoration: none;
}
.vtype-tab:hover { border-color: var(--primary); color: var(--primary); }
.vtype-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── LANDING ── */
.hero { min-height:100vh; background:radial-gradient(ellipse at 50% -20%,rgba(79,142,247,.18) 0%,transparent 60%),var(--bg); display:flex; flex-direction:column; }
.hero-nav { display:flex; align-items:center; justify-content:space-between; padding:20px 80px; border-bottom:1px solid var(--border); }
.hero-content { flex:1; display:flex; align-items:center; justify-content:center; flex-direction:column; text-align:center; padding:80px 20px; }
.hero-badge { display:inline-flex; align-items:center; gap:8px; background:rgba(79,142,247,.1); border:1px solid rgba(79,142,247,.3); border-radius:20px; padding:7px 18px; font-size:13px; color:var(--primary); font-weight:600; margin-bottom:28px; }
.hero-title { font-family:'Syne',sans-serif; font-size:66px; font-weight:800; line-height:1.05; margin-bottom:22px; max-width:800px; }
.hero-title span { background:linear-gradient(135deg,var(--primary),var(--accent)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.hero-sub { font-size:19px; color:var(--text2); max-width:600px; margin-bottom:40px; line-height:1.7; }
.pricing-section { padding:80px; background:var(--bg2); }
.section-title { font-family:'Syne',sans-serif; font-size:40px; font-weight:800; text-align:center; margin-bottom:8px; }
.section-sub { text-align:center; color:var(--text2); margin-bottom:50px; font-size:16px; }
.pricing-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; max-width:1000px; margin:0 auto; }
.pricing-card { background:var(--bg3); border:1px solid var(--border); border-radius:16px; padding:32px; transition:transform .2s; }
.pricing-card:hover { transform:translateY(-4px); }
.pricing-card.featured { border-color:var(--primary); }
.plan-name { font-family:'Syne',sans-serif; font-weight:700; font-size:17px; margin-bottom:4px; }
.plan-price { font-family:'Syne',sans-serif; font-size:38px; font-weight:800; margin:16px 0 4px; }
.plan-price span { font-size:15px; color:var(--text2); }
.plan-features { list-style:none; margin:20px 0 28px; display:flex; flex-direction:column; gap:10px; }
.plan-features li { font-size:14px; color:var(--text2); }
.plan-features li::before { content:'✓  '; color:var(--accent); font-weight:700; }
.features-section { padding:80px; }
.features-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.feature-card { background:var(--bg2); border:1px solid var(--border); border-radius:14px; padding:28px; }
.feature-icon { width:52px; height:52px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; margin-bottom:16px; }
.feature-title { font-family:'Syne',sans-serif; font-weight:700; font-size:17px; margin-bottom:8px; }
.feature-desc { font-size:14px; color:var(--text2); line-height:1.7; }
.site-footer { background:var(--bg2); border-top:1px solid var(--border); padding:30px 80px; display:flex; align-items:center; justify-content:space-between; font-size:14px; color:var(--text2); }

/* ── RESPONSIVE ── */
@media (max-width:900px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main-content { margin-left:0; }
  .hamburger { display:flex; }
  .pricing-grid,.features-grid { grid-template-columns:1fr; }
  .auth-left { display:none; }
  .auth-right { width:100%; }
  .hero-title { font-size:38px; }
  .hero-nav,.pricing-section,.features-section { padding-left:20px; padding-right:20px; }
  .page-body { padding:16px; }
}
