/* ============================================================
   DigiEdu — Global Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Sora:wght@700;800;900&display=swap');

:root {
  /* Colors */
  --ink:    #08122a;
  --ink2:   #1a2642;
  --ink3:   #2d3f65;
  --muted:  #6b7fa3;
  --blue:   #1a6dff;
  --blue2:  #0d52d4;
  --blue3:  #e6f0ff;
  --green:  #00c896;
  --green2: #009e78;
  --amber:  #ffaa00;
  --red:    #ff4560;
  --purple: #7c3aed;
  --bg:     #f4f7ff;
  --white:  #ffffff;
  --border: #dde4f5;
  --card:   #ffffff;

  /* Typography */
  --font:      'Plus Jakarta Sans', sans-serif;
  --font-head: 'Sora', sans-serif;

  /* Spacing & shape */
  --r:    16px;
  --rs:   10px;
  --rss:  7px;

  /* Shadows */
  --sh:   0 2px 20px rgba(26,109,255,.08);
  --sh2:  0 8px 40px rgba(26,109,255,.14);
  --sh3:  0 20px 60px rgba(26,109,255,.20);
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); overflow-x: hidden; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
ul { list-style: none; }

/* ---- TYPOGRAPHY ---- */
h1,h2,h3,h4,h5 { font-family: var(--font-head); line-height: 1.15; }
.hl { background: linear-gradient(135deg, var(--blue), var(--green)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ---- BUTTON ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border: none; border-radius: var(--rs); font-size: 14px; font-weight: 700; transition: all .22s; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,109,255,.32); }
.btn-secondary { background: var(--green); color: #fff; }
.btn-secondary:hover { background: var(--green2); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue3); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn-lg { padding: 15px 34px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: var(--rs); background: var(--white); border: 1.5px solid var(--border); color: var(--muted); font-size: 16px; }
.btn-icon:hover { border-color: var(--blue); color: var(--blue); background: var(--blue3); }

/* ---- CARD ---- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 18px 22px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 800; }
.card-body { padding: 20px 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); }

/* ---- BADGE ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 800; }
.badge-blue   { background: var(--blue3); color: var(--blue); }
.badge-green  { background: #d1fae5; color: #059669; }
.badge-amber  { background: #fef3c7; color: #d97706; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-purple { background: #ede9fe; color: var(--purple); }
.badge-muted  { background: var(--bg); color: var(--muted); }

/* ---- FORM ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 800; color: var(--ink); margin-bottom: 6px; letter-spacing: .2px; }
.form-input, .form-select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--rs); font-size: 13.5px; font-weight: 600; color: var(--ink); background: #fbfcff; outline: none; transition: all .2s; }
.form-input:focus, .form-select:focus { border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 3px rgba(26,109,255,.09); }
.form-input.has-icon { padding-left: 42px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }

/* ---- PROGRESS ---- */
.progress-bar { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .8s cubic-bezier(.4,0,.2,1); }

/* ---- TOGGLE ---- */
.toggle { width: 40px; height: 22px; background: var(--border); border-radius: 100px; position: relative; cursor: pointer; transition: background .22s; flex-shrink: 0; border: none; }
.toggle.on { background: var(--green); }
.toggle-knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left .22s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.toggle.on .toggle-knob { left: 21px; }

/* ---- SIDEBAR (shared) ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 238px; flex-shrink: 0; background: var(--ink); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 11px; }
.sidebar-logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg,var(--blue),var(--green)); border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.sidebar-logo-name { font-family: var(--font-head); font-size: 17px; font-weight: 800; color: #fff; }
.sidebar-logo-sub { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.3); letter-spacing: 1.4px; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }
.nav-section { font-size: 9px; font-weight: 800; letter-spacing: 1.6px; color: rgba(255,255,255,.22); text-transform: uppercase; padding: 10px 10px 5px; margin-top: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.5); font-size: 13px; font-weight: 700; transition: all .2s; margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.nav-item.active { background: linear-gradient(135deg, rgba(26,109,255,.5), rgba(0,200,150,.25)); color: #fff; }
.nav-item-ic { font-size: 17px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 9px; font-weight: 900; padding: 2px 7px; border-radius: 100px; }
.sidebar-user { padding: 16px 14px; border-top: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; background: linear-gradient(135deg,var(--blue),var(--purple)); }
.sidebar-username { color: #fff; font-size: 13px; font-weight: 800; }
.sidebar-role { color: rgba(255,255,255,.35); font-size: 10px; font-weight: 600; }

/* ---- TOPBAR (shared) ---- */
.main-area { flex: 1; margin-left: 238px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--white); height: 62px; display: flex; align-items: center; padding: 0 26px; gap: 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 80; box-shadow: 0 1px 10px rgba(26,109,255,.05); }
.topbar-title { font-family: var(--font-head); font-size: 18px; font-weight: 800; flex: 1; }
.topbar-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 14px; width: 220px; }
.topbar-search input { border: none; background: none; outline: none; font-size: 13px; font-weight: 600; color: var(--ink); width: 100%; font-family: var(--font); }
.topbar-search input::placeholder { color: var(--muted); }
.page-content { flex: 1; padding: 26px; }

/* ---- TABLE ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 11px 15px; text-align: left; font-size: 11px; font-weight: 800; color: var(--muted); background: var(--bg); letter-spacing: .3px; white-space: nowrap; }
.tbl td { padding: 13px 15px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8faff; }

/* ---- MODAL ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(8,18,42,.65); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s ease; }
.modal { background: var(--white); border-radius: 22px; padding: 32px; width: 500px; max-width: 100%; box-shadow: 0 24px 80px rgba(8,18,42,.25); animation: slideUp .3s cubic-bezier(.34,1.4,.64,1); }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 5px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* ---- LANG SWITCHER ---- */
.lang-switch { display: flex; gap: 3px; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--rs); padding: 3px; }
.lang-btn { padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 800; cursor: pointer; border: none; background: none; color: var(--muted); transition: all .18s; }
.lang-btn.active { background: var(--white); color: var(--blue); box-shadow: 0 1px 6px rgba(26,109,255,.12); }

/* ---- STAT CARD ---- */
.stat-card { background: var(--white); border-radius: var(--r); padding: 20px; box-shadow: var(--sh); border: 1px solid var(--border); transition: all .25s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh2); }
.stat-icon { width: 50px; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 14px; flex-shrink: 0; }

/* ---- ANIMATIONS ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .5; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }

/* ---- UTILITY ---- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.text-muted { color: var(--muted); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green2); }
.text-red { color: var(--red); }
.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.p-relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }
.rounded { border-radius: var(--r); }
.rounded-sm { border-radius: var(--rs); }
.border-top { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

/* Divider line */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}
