/* EDU-GATE Accounting — theme taken from registration.edu-gate.pro */
:root {
  --eg-ink: #0F1B2D;
  --eg-muted: #6B7A8D;
  --eg-paper: #F4F6FA;
  --eg-card: #FFFFFF;
  --eg-line: rgba(27, 58, 107, .10);
  --eg-primary: #1B3A6B;
  --eg-primary-2: #2C5AA0;
  --eg-primary-light: #3B6DB5;
  --eg-gold: #D4A843;
  --eg-gold-light: #E8C76A;
  --eg-gold-dark: #B8922E;
  --eg-silver: #8C9BAA;
  --eg-green: #2A9D6E;
  --eg-red: #C2453A;
  --eg-shadow: 0 24px 70px rgba(27, 58, 107, .12);
  --eg-soft-shadow: 0 14px 36px rgba(27, 58, 107, .07);
  --eg-gold-glow: 0 18px 40px rgba(212, 168, 67, .18);
  --eg-radius: 18px;
  --bs-primary: #1B3A6B;
  --bs-primary-rgb: 27, 58, 107;
  --bs-link-color: #2C5AA0;
  --bs-link-color-rgb: 44, 90, 160;
  --bs-body-font-family: "Plus Jakarta Sans", Tajawal, system-ui, sans-serif;
}
html[dir="rtl"] { --bs-body-font-family: Tajawal, "Plus Jakarta Sans", system-ui, sans-serif; }

body { background: var(--eg-paper); color: var(--eg-ink); font-family: var(--bs-body-font-family); }
a { color: var(--eg-primary-2); }
.text-muted, .eg-muted { color: var(--eg-muted) !important; }
.fw-800 { font-weight: 800; }
.tabular { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary { background: var(--eg-primary); border-color: var(--eg-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--eg-primary-2); border-color: var(--eg-primary-2); }
.btn-gold { background: linear-gradient(135deg, var(--eg-gold-light), var(--eg-gold)); color: var(--eg-ink); border: 0; box-shadow: var(--eg-gold-glow); }
.btn-gold:hover { background: var(--eg-gold-dark); color: #fff; }
.btn-outline-primary { color: var(--eg-primary); border-color: var(--eg-primary); }
.btn-outline-primary:hover { background: var(--eg-primary); border-color: var(--eg-primary); }
.form-control, .form-select { border-radius: 12px; border-color: rgba(27,58,107,.18); }
.form-control:focus, .form-select:focus { border-color: var(--eg-primary-light); box-shadow: 0 0 0 .2rem rgba(44,90,160,.15); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--eg-primary); }

/* ---------- Splash ---------- */
.eg-splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, #2C5AA0 0%, #1B3A6B 45%, #0F1B2D 100%);
  color: #fff; transition: opacity .7s ease, visibility .7s ease;
}
.eg-splash.hide { opacity: 0; visibility: hidden; }
.eg-splash-inner { text-align: center; padding: 24px; }
.eg-splash-logo {
  width: 150px; height: 150px; border-radius: 36px; background: #fff; display: grid; place-items: center;
  margin: 0 auto 28px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.35);
  animation: egPop .9s cubic-bezier(.2,.9,.3,1.3) both;
}
.eg-splash-logo img { width: 112px; height: auto; }
.eg-splash-logo::after {
  content: ""; position: absolute; inset: -12px; border-radius: 44px; border: 2px solid var(--eg-gold);
  opacity: .0; animation: egRing 1.8s ease-out .5s infinite;
}
.eg-splash h1 { font-weight: 800; letter-spacing: -.02em; font-size: clamp(1.8rem, 4vw, 2.8rem); animation: egUp .8s .3s both; }
.eg-splash h1 span { color: var(--eg-gold); }
.eg-splash p { color: rgba(255,255,255,.75); max-width: 520px; margin: 0 auto; animation: egUp .8s .45s both; }
.eg-splash-steps { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 22px 0 26px; animation: egUp .8s .6s both; }
.eg-splash-steps span { font-size: .78rem; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.eg-progress { width: 260px; max-width: 70vw; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); margin: 0 auto; overflow: hidden; }
.eg-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--eg-gold-light), var(--eg-gold)); animation: egLoad 2.4s ease forwards; }
@keyframes egPop { from { transform: scale(.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes egRing { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes egUp { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes egLoad { to { width: 100%; } }

/* ---------- Module tiles ---------- */
.eg-topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; backdrop-filter: blur(14px);
  background: rgba(244,246,250,.82); border-bottom: 1px solid var(--eg-line);
}
.eg-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--eg-primary); text-decoration: none; }
.eg-brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; }
.eg-hero h1 { font-weight: 800; letter-spacing: -.03em; font-size: clamp(2rem, 4.5vw, 3.2rem); }
.eg-hero h1 .gold { color: var(--eg-gold); }
.eg-pill { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; background: rgba(212,168,67,.14); color: var(--eg-gold-dark); font-weight: 600; font-size: .85rem; }
.eg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.eg-tile {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px; min-height: 210px;
  background: var(--eg-card); border: 1px solid var(--eg-line); border-radius: 22px; box-shadow: var(--eg-soft-shadow);
  color: var(--eg-ink); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  opacity: 0; animation: egUp .6s ease forwards;
}
.eg-tile:hover { transform: translateY(-6px); box-shadow: var(--eg-shadow); border-color: rgba(44,90,160,.3); color: var(--eg-ink); }
.eg-tile .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; background: var(--eg-primary); }
.eg-tile h3 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.eg-tile .dom { font-size: .8rem; color: var(--eg-muted); }
.eg-tile p { font-size: .88rem; color: var(--eg-muted); margin: 0; flex: 1; }
.eg-tile .go { font-weight: 700; font-size: .85rem; color: var(--eg-primary-2); }
.eg-tile.featured { background: linear-gradient(160deg, #1B3A6B, #0F1B2D); color: #fff; border: 0; box-shadow: var(--eg-shadow); }
.eg-tile.featured p, .eg-tile.featured .dom { color: rgba(255,255,255,.72); }
.eg-tile.featured .ico { background: linear-gradient(135deg, var(--eg-gold-light), var(--eg-gold)); color: var(--eg-ink); }
.eg-tile.featured .go { color: var(--eg-gold-light); }
.eg-tile.featured:hover { color: #fff; }
.eg-tile.disabled { cursor: default; opacity: .62 !important; }
.eg-tile.disabled:hover { transform: none; box-shadow: var(--eg-soft-shadow); }
.eg-tile .tag { position: absolute; top: 18px; inset-inline-end: 18px; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(140,155,170,.18); color: var(--eg-muted); }
.eg-tile.featured .tag { background: rgba(212,168,67,.2); color: var(--eg-gold-light); }

/* ---------- Login ---------- */
.eg-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.eg-auth-side { background: radial-gradient(circle at 20% 10%, #2C5AA0, #1B3A6B 50%, #0F1B2D); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.eg-auth-side h2 { font-weight: 800; font-size: 2.2rem; letter-spacing: -.02em; }
.eg-auth-side h2 span { color: var(--eg-gold); }
.eg-auth-side li { margin-bottom: 10px; color: rgba(255,255,255,.8); }
.eg-auth-side li i { color: var(--eg-gold); }
.eg-auth-form { display: grid; place-items: center; padding: 32px 20px; }
.eg-auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 36px; box-shadow: var(--eg-shadow); }
@media (max-width: 900px) { .eg-auth { grid-template-columns: 1fr; } .eg-auth-side { display: none; } }

/* ---------- App shell ---------- */
.eg-shell { display: flex; min-height: 100vh; }
.eg-side {
  width: 264px; flex: 0 0 264px; background: linear-gradient(180deg, #1B3A6B, #0F1B2D); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px 24px;
}
.eg-side .eg-brand { color: #fff; padding: 6px 8px 18px; }
.eg-side .eg-brand small { display: block; font-weight: 500; color: var(--eg-gold-light); font-size: .72rem; }
.eg-nav-h { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.45); margin: 18px 10px 6px; }
.eg-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: rgba(255,255,255,.78); text-decoration: none; font-size: .9rem; font-weight: 500; }
.eg-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.eg-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.eg-nav a.active { background: linear-gradient(135deg, var(--eg-gold-light), var(--eg-gold)); color: var(--eg-ink); font-weight: 700; }
.eg-nav .count { margin-inline-start: auto; background: var(--eg-gold); color: var(--eg-ink); font-size: .7rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.eg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eg-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: rgba(244,246,250,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--eg-line); padding: 12px 28px; display: flex; align-items: center; gap: 14px; }
.eg-head h1 { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--eg-primary); }
.eg-content { padding: 26px 28px 60px; }
.eg-user { display: flex; align-items: center; gap: 10px; }
.eg-avatar { width: 36px; height: 36px; border-radius: 12px; background: var(--eg-primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.eg-burger { display: none; }
@media (max-width: 992px) {
  .eg-side { position: fixed; z-index: 200; inset-inline-start: -280px; transition: inset-inline-start .25s; }
  .eg-side.open { inset-inline-start: 0; }
  .eg-burger { display: inline-flex; }
  .eg-content { padding: 18px 16px 50px; }
  .eg-head { padding: 10px 16px; }
}

/* Cards and KPIs */
.eg-card { background: var(--eg-card); border: 1px solid var(--eg-line); border-radius: var(--eg-radius); box-shadow: var(--eg-soft-shadow); }
.eg-card > .hd { padding: 16px 20px; border-bottom: 1px solid var(--eg-line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eg-card > .hd h2, .eg-card > .hd h3 { font-size: 1rem; font-weight: 800; margin: 0; color: var(--eg-primary); }
.eg-card > .bd { padding: 20px; }
.eg-kpi { padding: 18px 20px; }
.eg-kpi .lbl { font-size: .78rem; color: var(--eg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.eg-kpi .num { font-size: 1.6rem; font-weight: 800; color: var(--eg-primary); font-variant-numeric: tabular-nums; }
.eg-kpi .sub { font-size: .8rem; color: var(--eg-muted); }
.eg-kpi.gold { border-top: 4px solid var(--eg-gold); }
.eg-kpi.blue { border-top: 4px solid var(--eg-primary-2); }
.eg-kpi.green { border-top: 4px solid var(--eg-green); }
.eg-kpi.red { border-top: 4px solid var(--eg-red); }

/* Tables */
.eg-table { margin: 0; font-size: .88rem; }
.eg-table thead th { background: #F7F9FC; color: var(--eg-primary); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--eg-line); white-space: nowrap; }
.eg-table td, .eg-table th { padding: .62rem .8rem; vertical-align: middle; border-color: var(--eg-line); }
.eg-table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eg-table tr.total td { font-weight: 800; background: #F7F9FC; border-top: 2px solid var(--eg-primary); }
.eg-table tr.sub td { font-weight: 700; background: rgba(212,168,67,.08); }
.eg-table tr.hdr td { font-weight: 800; color: var(--eg-primary); background: #fff; padding-top: 1rem; }
.table-wrap { overflow-x: auto; }
.eg-badge { font-weight: 600; border-radius: 8px; }
.eg-plat { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; color: #fff; background: var(--eg-silver); letter-spacing: .03em; }
.eg-plat-reg { background: var(--eg-primary); }
.eg-plat-smart { background: var(--eg-primary-2); }
.eg-plat-evt { background: var(--eg-gold-dark); }
.eg-plat-pcb { background: var(--eg-green); }
.eg-plat-public { background: #5F6F82; }
.eg-plat-gl { background: var(--eg-ink); }
.eg-plat-careers { background: #8C9BAA; }

.eg-filter { background: #fff; border: 1px solid var(--eg-line); border-radius: var(--eg-radius); padding: 14px 16px; margin-bottom: 18px; }
.eg-filter .form-control, .eg-filter .form-select { font-size: .85rem; }
.eg-note { border-inline-start: 4px solid var(--eg-gold); background: rgba(212,168,67,.08); padding: 12px 16px; border-radius: 10px; font-size: .9rem; }
.eg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--eg-line); border-radius: 12px; background: #fff; color: var(--eg-ink); text-decoration: none; font-size: .86rem; font-weight: 500; margin: 0 6px 8px 0; }
.eg-chip:hover, .eg-chip.active { border-color: var(--eg-primary); color: var(--eg-primary); background: rgba(27,58,107,.05); }
.eg-chip.active { font-weight: 700; box-shadow: inset 0 -3px 0 var(--eg-gold); }
.eg-ctl { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--eg-line); }
.eg-ctl:last-child { border-bottom: 0; }
.eg-ctl .ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(42,157,110,.12); color: var(--eg-green); font-size: 1.2rem; }
.eg-ctl .ic.off { background: rgba(194,69,58,.1); color: var(--eg-red); }
.eg-flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eg-flow .node { padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--eg-line); font-weight: 700; font-size: .85rem; }
.eg-flow .node.gl { background: var(--eg-primary); color: #fff; }
.eg-flow i { color: var(--eg-gold-dark); }
.bar { height: 8px; border-radius: 8px; background: #E8EDF5; overflow: hidden; min-width: 80px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--eg-primary-2), var(--eg-primary)); }
.bar.gold > div { background: linear-gradient(90deg, var(--eg-gold-light), var(--eg-gold)); }
.bar.red > div { background: var(--eg-red); }
.lines-table select, .lines-table input { font-size: .82rem; min-width: 110px; }
.lines-table .acct { min-width: 230px; }
pre.json { background: var(--eg-ink); color: #E8C76A; padding: 16px; border-radius: 14px; font-size: .8rem; max-height: 480px; overflow: auto; }

@media print {
  .eg-side, .eg-head, .eg-filter, .no-print { display: none !important; }
  .eg-content { padding: 0; }
  .eg-card { box-shadow: none; border: 0; }
  body { background: #fff; }
}
