/* =======================
   Professional Portal Font
   ======================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Recommended: scope to portal only (avoids changing whole site) */
#portal-root,
#portal-root *{
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Slightly more “dashboard” typography */
#portal-root{
  font-size: 14.5px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Better hierarchy */
#portal-root .h1{ letter-spacing: -0.03em; }
#portal-root .brandTitle,
#portal-root .statValue{ letter-spacing: -0.03em; }

/* Button/table feel more professional */
#portal-root .btn{ font-weight: 700; letter-spacing: -0.01em; }
#portal-root .menuBtn{ font-weight: 600; }
#portal-root .table th{ letter-spacing: .08em; } /* cleaner uppercase */

:root{
  --bg0:#ffffff;
  --bg1:#f4f7ff;
  --card:rgba(255,255,255,.92);
  --line:rgba(15,23,42,.14);
  --text:#0b1220;
  --muted:#475569;
  --blue:#3b82f6;
  --green:#22c55e;
  --red:#ef4444;
  --shadow: 0 18px 55px rgba(2,6,23,.10);
  --radius: 18px;
}

*{ box-sizing:border-box; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(59,130,246,.18), transparent 55%),
    radial-gradient(900px 600px at 90% 20%, rgba(34,197,94,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
a{ color:inherit; text-decoration:none; }
button{ font:inherit; }

.container{ max-width:1200px; margin:0 auto; padding:18px; }
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--shadow);
}
.h1{ font-size:28px; font-weight:900; letter-spacing:.2px; }
.sub{ color:var(--muted); margin-top:6px; line-height:1.35; }

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(59,130,246,.10);
  border:1px solid rgba(59,130,246,.28);
  color:#1d4ed8;
  white-space:nowrap;
}

.row{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.grid{ display:grid; gap:14px; }
.grid2{ grid-template-columns: 1.15fr .85fr; }
@media (max-width: 980px){ .grid2{ grid-template-columns:1fr; } }

.label{ font-size:12px; color:var(--muted); margin:12px 0 6px; display:block; }
.input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.16);
  background:rgba(255,255,255,.85);
  color:var(--text);
  outline:none;
}
.input:focus{ border-color: rgba(59,130,246,.65); box-shadow: 0 0 0 4px rgba(59,130,246,.12); }

.btn{
  width:100%;
  padding:12px 14px;
  border:0;
  border-radius:14px;
  background:var(--blue);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.btn:active{ transform: translateY(1px); }
.btn.secondary{
  background:transparent;
  border:1px solid rgba(15,23,42,.16);
  color:var(--text);
}

.toast{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(239,68,68,.10);
  border:1px solid rgba(239,68,68,.28);
  color:#991b1b;
}
.toast.ok{
  background:rgba(34,197,94,.10);
  border-color:rgba(34,197,94,.28);
  color:#166534;
}

/* Login layout */
.authCenter{
  min-height: calc(100vh - 48px);
  display:grid;
  place-items:center;
  padding:24px 0;
}
.portalLogo{
  width:170px;
  max-width:70%;
  height:auto;
  display:block;
  margin:0 auto;
  object-fit:contain;
}

/* Mini cards used across pages */
.miniCard{
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.80);
  padding:12px;
  box-shadow: 0 10px 28px rgba(2,6,23,.07);
}
.miniCard b{ display:block; margin-bottom:6px; }
.miniRow{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }

/* Dashboard stats */
.statsRow{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
@media (max-width: 900px){
  .statsRow{ grid-template-columns:1fr; }
}
.statCard{
  border-radius:16px;
  border:1px solid var(--line);
  padding:14px;
  box-shadow: 0 10px 28px rgba(2,6,23,.07);
}
.statValue{
  font-size:24px;
  font-weight:900;
  margin-top:6px;
}
.statCard.grad1{ background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(255,255,255,.60)); }
.statCard.grad2{ background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(255,255,255,.60)); }
.statCard.grad3{ background: linear-gradient(135deg, rgba(168,85,247,.14), rgba(255,255,255,.60)); }

/* App layout */
.app{
  display:grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
@media (max-width: 920px){
  .app{ grid-template-columns: 1fr; }
}

/* Sidebar (desktop) */
.sidebar{
  position: sticky;
  top:0;
  height:100vh;
  padding:16px;
  border-right:1px solid rgba(15,23,42,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.65));
  backdrop-filter: blur(10px);
}
@media (max-width: 920px){
  .sidebar{ display:none; } /* prevents sticky blur on mobile */
}

.brand{
  display:flex; align-items:center; gap:10px;
  padding:10px 10px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.75);
}
.brandMark{
  width:36px; height:36px; border-radius:12px;
  background: radial-gradient(circle at 30% 30%, rgba(59,130,246,.9), rgba(59,130,246,.25));
  border:1px solid rgba(59,130,246,.35);
}
.brandTitle{ font-weight:900; }
.brandSub{ font-size:12px; color:var(--muted); margin-top:2px; }

.nav{
  margin-top:14px;
  display:grid;
  gap:8px;
}
.nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
}
.nav a:hover{ border-color: rgba(59,130,246,.35); background: rgba(255,255,255,.75); }
.nav a.active{ border-color: rgba(59,130,246,.55); background: rgba(59,130,246,.08); }

/* Small button (used for actions + drawer + modal close) */
.menuBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.16);
  background: rgba(255,255,255,.85);
  color: var(--text);
  cursor:pointer;
}
.menuBtn:hover{ border-color: rgba(59,130,246,.35); }
.menuBtn:active{ transform: translateY(1px); }

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px;
  border-bottom: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(10px);
}
/* Hide only the "Menu" toggle on desktop */
.topbar #menuBtn{ display:none; }
@media (max-width: 920px){
  .topbar #menuBtn{ display:inline-flex; }
}

/* Drawer sidebar (mobile) */
.drawerOverlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,.45);
  display:none;
  z-index:9999;
}
.drawer{
  width:min(320px, 90vw);
  height:100%;
  background: rgba(255,255,255,.96);
  border-right:1px solid rgba(15,23,42,.10);
  padding:14px;
  overflow:auto;
}
.drawerOverlay.open{ display:block; }
body.drawerOpen{ overflow:hidden; }

/* Content */
.content{ min-height:100vh; }
.page{ padding:18px; }

/* Tables + responsive cards */
.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.10);
}
.table th, .table td{
  padding:12px;
  border-bottom:1px solid rgba(15,23,42,.08);
  text-align:left;
}
.table th{
  color:#334155;
  font-size:12px;
  letter-spacing:.4px;
  text-transform:uppercase;
  background: rgba(15,23,42,.03);
}
.table tr:hover td{ background: rgba(59,130,246,.05); }

.cardsMobile{ display:none; }
@media (max-width: 780px){
  .tableWrap{ overflow:auto; }
  .cardsMobile{ display:grid; gap:10px; }
  .tableHideMobile{ display:none; }
}

/* Skeleton loaders */
.skel{
  background: linear-gradient(90deg, rgba(2,6,23,.04), rgba(2,6,23,.08), rgba(2,6,23,.04));
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: 12px;
}
@keyframes sk { 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }
.skelLine{ height:12px; margin:8px 0; }
.skelBig{ height:26px; width: 55%; }
