:root{
  --bg:#0b1220;
  --card:#0f1a2b;
  --text:#e7eefc;
  --muted:#9bb0d1;
  --line:rgba(255,255,255,.10);
  --brand:#6d5efc;
  --brand2:#14b8a6;
  --danger:#ef4444;
  --warning:#f59e0b;
  --ok:#22c55e;

  --shadow: 0 16px 50px rgba(0,0,0,.45);
  --radius: 16px;
  --topbar-h: 86px; /* desktop approx */
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1000px 600px at 10% 10%, rgba(109,94,252,.18), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(20,184,166,.16), transparent 55%),
    radial-gradient(700px 450px at 50% 90%, rgba(245,158,11,.10), transparent 55%),
    var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}
a:hover{opacity:.92}

h2,h3,h4{ letter-spacing:.2px; }
h3{ font-size:15px; }

hr{ border:none; border-top:1px solid var(--line); opacity:.7; }

/* =========================
   CONTAINER + LAYOUT RULES
========================= */
.container{
  margin:0 auto;
  padding:16px 18px;
  max-width:1100px; /* login/register */
}

/* logged-in screens: full width */
.container.fluid{
  max-width:none;
}

/* Desktop app layout: only main scrolls */
@media (min-width: 981px){
  body{ overflow:hidden; }
  .container{ height:100vh; }
}

/* Mobile: normal scroll */
@media (max-width: 980px){
  body{ overflow:auto; }
  .container{ height:auto; padding:14px; }
}

/* =========================
   TOPBAR
========================= */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.logo{
  width:40px;height:40px;
  border-radius:14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 12px 25px rgba(109,94,252,.25);
}
.brand h1{ margin:0; font-size:16px; letter-spacing:.3px; }
.brand small{ display:block; color:var(--muted); margin-top:2px; font-size:12px; }

.nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}



/* Hamburger for mobile */
.hamburger{
  display:none;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
}

/* Topbar responsive behavior */
@media (max-width: 900px){
  .hamburger{ display:inline-flex; align-items:center; justify-content:center; }
  .nav{ display:none; width:100%; justify-content:flex-start; }
  body.nav-open .nav{ display:flex; }
}
@media (max-width: 700px){
  .topbar{ flex-direction:column; align-items:flex-start; }
  .hamburger{ align-self:flex-end; }
}

/* =========================
   SHELL: SIDEBAR + MAIN
========================= */
.shell{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap:16px;
  margin-top:16px;
  align-items: stretch;
}

.sidebar{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
  overflow:hidden;
}

/* desktop fixed sidebar + main scroll */
@media (min-width: 981px){
  .shell{
    height: calc(100vh - var(--topbar-h) - 32px); /* minus margins */
  }
  .sidebar{
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    height: calc(100vh - var(--topbar-h) - 32px);
    overflow:auto;
  }
  .main{
    height: calc(100vh - var(--topbar-h) - 32px);
    overflow:auto;
    padding-right: 6px;
  }
}

/* mobile: stack */
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; height:auto; }
  .sidebar{ position:relative; height:auto; overflow:visible; }
  .main{ height:auto; overflow:visible; padding-right:0; }
}

.side-hd{
  padding:16px 16px 14px;
  border-bottom:1px solid var(--line);
}
.side-hd .who{
  display:flex;
  align-items:center;
  gap:10px;
}
.avatar{
  width:38px;height:38px;border-radius:14px;
  background: linear-gradient(135deg, rgba(109,94,252,.7), rgba(20,184,166,.55));
  box-shadow: 0 10px 25px rgba(109,94,252,.18);
}
.side-hd .meta b{ display:block; font-size:13px; }
.side-hd .meta small{ display:block; color:var(--muted); font-size:12px; margin-top:2px; }

.side-nav{
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.side-nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-weight:800;
  font-size:13px;
}
.side-nav a span{ color:var(--muted); font-weight:800; font-size:12px; }
.side-nav a.active{
  border-color: rgba(109,94,252,.45);
  background: rgba(109,94,252,.14);
}
.side-nav a.danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.10);
}

.main{ min-width: 0; }

/* nice scrollbars */
.main, .sidebar{ scrollbar-width: thin; }
.main::-webkit-scrollbar,
.sidebar::-webkit-scrollbar{ width:10px; }
.main::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.14); border-radius:999px; }
.main::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track{ background: rgba(255,255,255,.05); }

/* =========================
   GRID + CARD
========================= */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:16px;
  margin-top:16px;
}

.card{
  grid-column: span 12;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
  overflow:hidden;
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover{ transform: translateY(-1px); border-color: rgba(109,94,252,.25); }

.card .hd{
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.card .hd h2{ margin:0; font-size:16px; }
.card .hd p{ margin:6px 0 0; color:var(--muted); font-size:12px; }
.card .bd{ padding:16px 18px; }

.kpis{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.kpi{
  grid-column: span 4;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  padding:14px;
}
.kpi .label{ color:var(--muted); font-size:12px; }
.kpi .val{ font-size:26px; font-weight:800; margin-top:8px; }

@media (max-width: 900px){ .kpi{ grid-column: span 6; } }
@media (max-width: 600px){ .kpi{ grid-column: span 12; } }

/* =========================
   BUTTONS + FORMS
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight:800;
  cursor:pointer;
}
.btn.primary{
  border-color: rgba(109,94,252,.45);
  background: linear-gradient(135deg, rgba(109,94,252,.35), rgba(20,184,166,.20));
}
.btn.danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.10);
}
button.btn{ appearance:none; }

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(10,16,30,.45);
  color: var(--text);
  outline:none;
}
input::placeholder{ color: rgba(155,176,209,.7); }
label{ display:block; margin:12px 0 6px; color: var(--muted); font-size:12px; }

.row{ display:flex; gap:12px; }
.row > div{ flex:1; }
@media (max-width: 600px){ .row{ flex-direction:column; } }

/* =========================
   TABLE
========================= */
.table{
  width:100%;
  border-collapse: collapse;
  border:1px solid var(--line);
  border-radius: 16px;
  overflow:hidden;
}
.table th, .table td{
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:13px;
}
.table th{
  color: var(--muted);
  font-weight:900;
  background: rgba(255,255,255,.03);
  position: sticky;
  top: 0;
  z-index: 1;
}
.table tr:hover td{ background: rgba(255,255,255,.02); }
.table .btn{ padding:8px 10px; border-radius:12px; font-size:12px; }

/* mobile table scroll */
@media (max-width: 980px){
  .table{ display:block; overflow-x:auto; white-space:nowrap; }
}

/* =========================
   BADGES + ALERTS
========================= */
.badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  font-size:12px;
  font-weight:900;
  background: rgba(255,255,255,.03);
}
.badge.ok{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); }
.badge.warn{ border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.10); }
.badge.danger{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }

.alert{
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  margin:12px 0;
  color: var(--text);
}
.alert.danger{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }
.alert.ok{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10); }

/* =========================
   PAGEBAR + FOOTER
========================= */
.pagebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 4px 0 16px;
}
.pagebar h2{ margin:0; font-size:18px; }
.pagebar p{ margin:6px 0 0; color:var(--muted); font-size:12px; }
.page-actions{ display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
@media (max-width: 600px){ .page-actions{ width:100%; justify-content:flex-start; } }

.footer{
  margin: 16px 0 0;
  color: var(--muted);
  font-size:12px;
  text-align:center;
  opacity:.9;
}
/* =========================
   MOBILE DRAWER SIDEBAR (HIDE/SHOW)
========================= */

/* Mobile layout: sidebar drawer */
@media (max-width: 980px){

  /* topbar sticky ok */
  .topbar{
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* shell becomes normal (main only) */
  .shell{
    grid-template-columns: 1fr;
    position: relative;
  }

  /* sidebar becomes off-canvas drawer */
  .sidebar{
    position: fixed;
    top: 86px;              /* topbar height approx */
    left: 12px;
    right: 12px;
    height: calc(100vh - 98px);
    z-index: 999;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
    overflow: auto;
  }

  /* open drawer when nav-open */
  body.nav-open .sidebar{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* main content always visible */
  .main{
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  /* nav links (topbar) also toggle */
  .nav{
    display:none;
    width:100%;
    justify-content:flex-start;
    gap:8px;
  }
  body.nav-open .nav{
    display:flex;
  }

  /* allow page scroll on mobile */
  body{ overflow:auto; }
}

/* Small phones: topbar stacks nicely */
@media (max-width: 700px){
  .topbar{
    flex-direction: column;
    align-items: flex-start;
  }
  .hamburger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    align-self:flex-end;
  }


/* Overlay background when drawer open */
@media (max-width: 980px){
  body.nav-open::before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 998;
  }
}
/* =========================
   PRO MOBILE HEADER + DRAWER
========================= */

/* Brand text container */
.brand-txt{ display:flex; flex-direction:column; line-height:1.1; }

/* Desktop: keep current look */
@media (min-width: 981px){
  .hamburger{ display:none; }
}

/* Mobile polish */
@media (max-width: 980px){

  /* topbar: single clean row */
  .topbar{
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 12px !important;
    border-radius: 18px !important;
  }

  .brand{ gap:10px; }
  .logo{ width:36px; height:36px; border-radius:14px; }
  .brand h1{ font-size:14px; }
  .brand small{ font-size:11px; }

  /* hide top nav on mobile (links already in sidebar) */
  .nav{
    display:none !important;
  }

  /* hamburger always visible */
  .hamburger{
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    border-radius: 16px;
    font-size:18px;
  }

  /* Overlay */
  body.nav-open::before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.60);
    z-index: 998;
  }

  /* Drawer: full width bottom sheet style */
  .sidebar{
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 72px !important;          /* topbar height */
    bottom: 12px !important;
    height: auto !important;
    z-index: 999 !important;
    border-radius: 20px !important;

    transform: translateY(18px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform .18s ease, opacity .18s ease;
  }

  body.nav-open .sidebar{
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Sidebar header bigger */
  .side-hd{ padding:14px 14px 12px; }
  .avatar{ width:40px; height:40px; border-radius:16px; }
  .side-hd .meta b{ font-size:14px; }
  .side-hd .meta small{ font-size:12px; }

  /* menu buttons touch-friendly */
  .side-nav{ padding:12px; gap:10px; }
  .side-nav a{
    padding:14px 14px;
    border-radius: 16px;
    font-size:14px;
  }

  /* main normal flow */
  .shell{ grid-template-columns: 1fr !important; }
  .main{ height:auto !important; overflow:visible !important; padding-right:0 !important; }

  /* allow scroll */
  body{ overflow:auto !important; }
  .container{ height:auto !important; }
}

/* super small phones */
@media (max-width: 420px){
  .brand small{ display:none; } /* cleaner */
  .topbar{ padding: 11px 11px !important; }
}
/* =========================
   AUTH (LOGIN / REGISTER) UI
========================= */
.auth-wrap{
  min-height: calc(100vh - 120px);
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top: 18px;
}

.auth-card{
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  grid-column: span 12;
}

/* cleaner headings */
.auth-card .hd{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 18px 18px 14px;
}
.auth-card .hd h2{
  font-size: 18px;
  margin: 0;
  letter-spacing: .2px;
}

/* form spacing */
.auth-card .bd{
  padding: 16px 18px 18px;
}
.auth-card label{
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .15px;
}
.auth-card input{
  margin-top: 6px;
}

/* input focus premium */
input:focus, select:focus, textarea:focus{
  border-color: rgba(109,94,252,.55);
  box-shadow: 0 0 0 4px rgba(109,94,252,.18);
}

/* full width button */
.auth-card .btn{
  width:100%;
}

/* small footer text */
.auth-card p{
  margin: 14px 0 0;
  text-align:center;
  color: var(--muted);
  font-size: 13px;
}
.auth-card p a{
  color: var(--text);
}
.auth-card p a b{
  color: var(--text);
}

/* mobile spacing */
@media (max-width: 600px){
  .auth-wrap{ min-height: auto; padding: 10px 0; }
  .auth-card{ max-width: 100%; }
  .auth-card .bd{ padding: 14px; }
  .auth-card .hd{ padding: 16px 14px 12px; }
}
/* =========================
   DASHBOARD ADVANCED
========================= */
.chip{
  display:inline-flex;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size:12px;
  font-weight:900;
}

/* KPIs more responsive */
.kpis-advanced{
  grid-template-columns: repeat(12, 1fr);
}
.kpi-advanced{
  grid-column: span 4;
  padding:14px;
  border-radius: 16px;
}
.kpi-top{
  display:flex;
  gap:12px;
  align-items:center;
}
.kpi-ico{
  width:42px;height:42px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-size:18px;
}
.kpi-meta .label{ margin:0; }
.kpi-sub{ margin-top:10px; display:flex; justify-content:flex-start; gap:8px; }

/* two column dashboard */
.dash-two{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}
.dash-col{ min-width:0; }

.subhd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.subhd h3{ margin:0; font-size:14px; }
.sub-actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* quick action list */
.quick{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}
.quick-item{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px 12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.quick-item:hover{
  border-color: rgba(109,94,252,.25);
  background: rgba(109,94,252,.08);
}
.qi-ico{
  width:44px;height:44px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
  font-size:18px;
}
.qi-txt b{ display:block; font-size:13px; }
.qi-txt small{ display:block; color: var(--muted); font-size:12px; margin-top:2px; }

@media (max-width: 980px){
  .dash-two{ grid-template-columns: 1fr; }
  .kpi-advanced{ grid-column: span 6; }
}
@media (max-width: 600px){
  .kpi-advanced{ grid-column: span 12; }
}
.modal{ position:fixed; inset:0; display:none; z-index:9999; }
.modal.show{ display:block; }
.modal-backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.65); }

.modal-box{
  position:relative;
  width:min(920px, 92vw);
  max-height: 86vh;
  margin: 6vh auto;
  border:1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15,26,43,.98), rgba(15,26,43,.92));
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal-hd{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modal-x{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color:#fff;
  border-radius: 12px;
  padding:8px 10px;
  cursor:pointer;
}
.modal-bd{ padding:14px; overflow:auto; }
.modal-bd img{
  width:100%;
  height:auto;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
}
.modal-ft{
  padding:12px 14px;
  border-top:1px solid rgba(255,255,255,.10);
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.btn.disabled{
  opacity:.45;
  pointer-events:none;
}
/* =========================
   TOPBAR NAV LINKS (ONLY DIRECT)
========================= */


/* =========================
   TOPBAR USER DROPDOWN + BALANCE (CLEAN)
========================= */

/* allow dropdown to overflow */
.topbar, .nav{
  overflow: visible;
}

/* ===== Topbar dropdown (clean) ===== */
.topbar, .nav { overflow: visible; }

.top-balance{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}

.user-dd{ position:relative; display:inline-flex; }

.user-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight:900;
  font-size:13px;
  cursor:pointer;
}

.user-btn .caret{ opacity:.9; }

.user-menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:200px;
  background: rgba(15,26,43,.98);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  padding:6px;
  display:none;
  z-index:99999;
}

.user-dd.open .user-menu{ display:block; }

.user-menu a{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  font-weight:800;
  font-size:13px;
}

.user-menu a:hover{
  background: rgba(255,255,255,.06);
}

.user-menu a.danger{ color:#ff6b6b; }

.menu-sep{
  height:1px;
  background: rgba(255,255,255,.10);
  margin:6px 6px;
}
.pw-wrap{
  display:flex;
  gap:10px;
  align-items:center;
}
.pw-wrap input{
  flex:1;
}
.pw-toggle{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.pw-toggle:hover{ opacity:.9; }
/* datetime-local calendar/clock icon - Chrome/Edge/Safari */
input[type="datetime-local"]::-webkit-calendar-picker-indicator{
  filter: invert(1);        /* icon white-ish */
  opacity: 1;
  cursor: pointer;
}

/* optional: input ka text bhi white */
input[type="datetime-local"]{
  color: #fff;
  background: transparent;
}

