/* =======================================================================
   Digital Training Institute — ERP Student Portal Design System
   Shares the same navy/gold palette and Bebas Neue + Manrope type as the
   admin CMS, so the portal feels like part of the same product.
   ======================================================================= */

:root{
  --ink:        #14161f;
  --ink-2:      #1c2030;
  --ink-3:      #262c42;
  --paper:      #f6f4ee;
  --surface:    #ffffff;
  --line:       #e5e0d3;
  --line-soft:  #efeade;

  --gold:       #c8992f;
  --gold-dark:  #9c7420;
  --gold-soft:  #f5e6bd;

  --text:       #191b22;
  --muted:      #6c7086;
  --muted-2:    #9a9db0;

  --success:    #2f8f5b;
  --success-soft: #e2f3ea;
  --danger:     #c4433a;
  --danger-soft: #fbe9e7;
  --warn:       #c9791c;
  --warn-soft:  #fbecd6;
  --info:       #3568c8;
  --info-soft:  #e7edfb;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20,22,31,.06);
  --shadow: 0 6px 20px rgba(20,22,31,.08);
  --shadow-lg: 0 20px 48px rgba(20,22,31,.16);

  --topbar-h: 64px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin:0;
  font-family:'Manrope', system-ui, sans-serif;
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4{ margin: 0; font-weight: 700; letter-spacing: .01em; }
p{ margin: 0; }
a{ color: inherit; }
button{ font-family: inherit; }
ul{ margin:0; padding:0; list-style:none; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.display{
  font-family:'Bebas Neue', sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-weight: 400;
}
.page-title{ font-size: 26px; line-height: 1; }
.section-title{ font-size: 18px; line-height: 1; }

/* =========================== Student app shell =========================== */
.erp-topbar{
  height: var(--topbar-h);
  background: var(--ink);
  color: #eceaf6;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 22px;
  position: sticky; top:0; z-index: 30;
  gap: 16px;
}
.erp-brand{ display:flex; align-items:center; gap:10px; }
.erp-brand .mark{
  width:34px; height:34px; border-radius:8px;
  background: linear-gradient(155deg, var(--gold), var(--gold-dark));
  display:flex; align-items:center; justify-content:center;
  font-family:'Bebas Neue', sans-serif; font-size:18px; color: var(--ink);
  flex: none;
}
.erp-brand .name{
  font-family:'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: .04em; line-height:1.15;
  text-transform: uppercase;
}
.topbar-right{ display:flex; align-items:center; gap:14px; flex:none; }
.role-pill{
  font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  background: rgba(200,153,47,.16); color: var(--gold);
  padding: 4px 10px; border-radius: 999px;
}
.user-chip{ display:flex; align-items:center; gap:10px; }
.avatar{
  width: 32px; height:32px; border-radius:50%;
  background: linear-gradient(155deg, var(--gold), var(--gold-dark)); color: var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-family:'Bebas Neue',sans-serif; font-size:14px; flex:none;
}
.user-chip .who{ line-height:1.2; }
.user-chip .who .n{ font-weight:700; font-size:13px; color:#fff; }
.user-chip .who .r{ font-size:11px; color:#9a9db0; }

.erp-shell{ max-width: 1000px; margin: 0 auto; padding: 26px 20px 60px; }

/* =========================== Tabs =========================== */
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:18px; flex-wrap:wrap; }
.tab{
  padding: 10px 16px; font-size:13px; font-weight:700; color:var(--muted);
  cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;
}
.tab:hover{ color:var(--text); }
.tab.active{ color: var(--ink); border-color: var(--gold); }

/* =========================== Buttons =========================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius: 8px; border: 1px solid transparent;
  padding: 9px 16px; font-size: 13.5px; font-weight: 700;
  cursor:pointer; white-space:nowrap; line-height:1;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-gold{ background: var(--gold); color: var(--ink); }
.btn-gold:hover{ background: var(--gold-dark); color:#fff; }
.btn-ghost{ background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover{ background: var(--paper); }
.btn-sm{ padding: 6px 11px; font-size:12.5px; border-radius:7px; }
.btn[disabled]{ opacity:.5; cursor:not-allowed; }

/* =========================== Cards / grid =========================== */
.card{
  background: var(--surface); border:1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad{ padding: 20px; }
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft); gap:12px; flex-wrap:wrap;
}
.card-head h3{ font-size:15px; }

.stat-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; margin-bottom: 18px; }
.stat-card{
  background: var(--surface); border:1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-sm); position:relative; overflow:hidden;
}
.stat-card .label{ font-size:11.5px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.stat-card .value{ font-family:'Bebas Neue',sans-serif; font-size:28px; margin-top:6px; letter-spacing:.01em; }
.stat-card .bar{ position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--gold); }
.stat-card.tone-success .bar{ background: var(--success); }
.stat-card.tone-danger .bar{ background: var(--danger); }

.grid-2{ display:grid; grid-template-columns: 1.4fr 1fr; gap:16px; }

/* =========================== Tables =========================== */
.table-wrap{ overflow-x:auto; }
table.data{ width:100%; border-collapse: collapse; font-size:13.5px; }
table.data th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color: var(--muted); font-weight:700; padding: 10px 16px; border-bottom:1px solid var(--line);
  background: var(--paper); white-space:nowrap;
}
table.data td{ padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align:middle; }
table.data tbody tr:hover{ background: var(--paper); }
.cell-main{ font-weight:700; }
.cell-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

/* =========================== Badges =========================== */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:700; padding: 4px 9px; border-radius:999px;
  text-transform:capitalize; white-space:nowrap;
}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge-gray{ background:#eef0f4; color:#616580; }
.badge-success{ background: var(--success-soft); color: var(--success); }
.badge-danger{ background: var(--danger-soft); color: var(--danger); }
.badge-warn{ background: var(--warn-soft); color: var(--warn); }

/* =========================== Fee bar / progress =========================== */
.fee-bar-row{ display:flex; justify-content:space-between; font-size:13px; font-weight:700; margin-bottom:8px; }
.progress-track-lg{ height:10px; border-radius:999px; background: var(--line-soft); overflow:hidden; }
.progress-track-lg .fill{ height:100%; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }

/* =========================== Forms =========================== */
.form-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:14px 16px; }
.form-grid.cols-1{ grid-template-columns: 1fr; }
.form-grid.cols-3{ grid-template-columns: 1fr 1fr 1fr; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:12.5px; font-weight:700; color: var(--text); }
.field .hint{ font-size:11.5px; color: var(--muted); }
.field-input, select.field-input, textarea.field-input{
  border:1px solid var(--line); background: var(--surface); border-radius:8px;
  padding: 9px 12px; font-size:13.5px; font-family:inherit; color:var(--text); width:100%;
}
.field-input:focus{ outline:none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,153,47,.15); }
.form-actions{
  display:flex; justify-content:flex-end; gap:10px; margin-top: 20px;
  padding-top:16px; border-top:1px solid var(--line-soft);
}

/* =========================== Auth screen =========================== */
.auth-screen{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: var(--ink);
  background-image: radial-gradient(circle at 15% 20%, rgba(200,153,47,.18), transparent 40%),
                     radial-gradient(circle at 85% 80%, rgba(200,153,47,.12), transparent 45%);
  padding: 24px;
}
.auth-card{
  width:100%; max-width: 400px; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 32px 30px;
}
.auth-brand{ display:flex; align-items:center; gap:12px; margin-bottom: 22px; }
.auth-brand .mark{
  width:42px; height:42px; border-radius:10px;
  background: linear-gradient(155deg, var(--gold), var(--gold-dark));
  display:flex; align-items:center; justify-content:center;
  font-family:'Bebas Neue',sans-serif; font-size:22px; color: var(--ink); flex:none;
}
.auth-brand .t{ font-family:'Bebas Neue',sans-serif; font-size:20px; letter-spacing:.03em; text-transform:uppercase; }
.auth-brand .t small{ display:block; font-family:'Manrope',sans-serif; text-transform:none; font-size:11.5px; color:var(--muted); font-weight:600; letter-spacing:0; }
.auth-error{
  background: var(--danger-soft); color: var(--danger); border-radius:8px;
  padding: 10px 12px; font-size:13px; font-weight:600; margin-bottom:14px; display:none;
}
.auth-foot{ margin-top:18px; font-size:12px; color: var(--muted-2); text-align:center; }

/* =========================== Misc =========================== */
.empty-state{ text-align:center; padding: 54px 20px; color: var(--muted); }
.empty-state .glyph{ font-size:30px; margin-bottom:10px; }
.empty-state .title{ font-weight:700; color:var(--text); margin-bottom:4px; }
.loading-row{ padding: 40px; text-align:center; color: var(--muted); font-size:13px; }

.kv{ display:grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size:13.5px; }
.kv dt{ color: var(--muted); font-weight:600; }
.kv dd{ margin:0; font-weight:600; }

.text-muted{ color: var(--muted); }
.text-danger{ color: var(--danger); }
.text-success{ color: var(--success); }

.toast-stack{
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display:flex; flex-direction:column; gap:8px; align-items:flex-end;
}
.toast{
  background: var(--ink); color:#fff; padding: 11px 16px; border-radius: 9px;
  font-size:13px; font-weight:600; box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease; max-width: 340px;
}
.toast.success{ background: var(--success); }
.toast.error{ background: var(--danger); }
@keyframes toast-in{ from{ opacity:0; transform: translateY(6px);} to{opacity:1; transform:translateY(0);} }

/* =========================== Responsive =========================== */
@media (max-width: 900px){
  .stat-grid{ grid-template-columns: repeat(2,1fr); }
  .grid-2{ grid-template-columns: 1fr; }
}
@media (max-width: 620px){
  .stat-grid{ grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid.cols-3{ grid-template-columns: 1fr; }
  .erp-shell{ padding: 18px 14px 48px; }
  .user-chip .who{ display:none; }
}