/* Premium Dashboard UI - Bynzo Billing */
:root{
  --brand-navy:#102A4A;
  --brand-deep:#0F243C;
  --brand-blue:#05589B;
  --brand-cyan:#0A9FD9;
  --brand-teal:#0EA29F;
  --brand-aqua:#18DBE3;
  --brand-green:#1FA058;
  --brand-lightgreen:#5BD25F;
  --text:#ffffff;
  --muted:rgba(255,255,255,.72);
  --card:rgba(255,255,255,.06);
  --card-2:rgba(255,255,255,.04);
  --card-border:rgba(255,255,255,.14);
  --shadow: 0 18px 45px rgba(0,0,0,.38);
  --radius:18px;
}

.page-wrap{
  padding: 18px 16px 34px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-title{
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 22px;
  margin: 10px 0 16px;
  letter-spacing: .2px;
}

.grid-cards{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.grid-cards .kpi-card{
  grid-column: span 3;
  background: var(--card);
  border:1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
}

@media (max-width: 1100px){ .grid-cards .kpi-card{ grid-column: span 6; } }
@media (max-width: 680px){ .grid-cards .kpi-card{ grid-column: span 12; } }

.kpi-card .kpi{
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0 4px;
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.kpi-card .label{
  font-size: 13px;
  color: var(--muted);
  margin:0;
}

.kpi-card .chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.9);
  font-size: 12px;
}

.kpi-card .chip .dot{
  width:8px;height:8px;border-radius:99px;
  background: linear-gradient(135deg, var(--brand-aqua), var(--brand-lightgreen));
  box-shadow: 0 0 0 4px rgba(24,219,227,.12);
}

.table-premium{
  width:100%;
  border-collapse: collapse;
  background: var(--card-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-premium th, .table-premium td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  font-size: 13px;
  color: rgba(255,255,255,.92);
}

.table-premium th{
  text-align:left;
  color: rgba(255,255,255,.88);
  background: rgba(0,0,0,.18);
  font-weight: 700;
}

.table-premium tr:hover td{
  background: rgba(255,255,255,.04);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
}

.btn-primary{
  border:none;
  color:#06111f;
  background: linear-gradient(135deg, var(--brand-aqua), var(--brand-lightgreen));
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}

.btn:hover{ transform: translateY(-1px); }

.alert, .alert-danger, .alert-success, .error, .err{
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.95);
}

.alert-danger, .error, .err{
  background: rgba(255, 82, 82, .14);
  border-color: rgba(255, 82, 82, .22);
}

.alert-success{
  background: rgba(31, 160, 88, .14);
  border-color: rgba(31, 160, 88, .22);
}

.form-control, input[type="text"], input[type="email"], input[type="password"], select, textarea{
  border-radius: 12px !important;
}


/* --- Mobile Responsive Polish --- */
img, svg { max-width: 100%; height: auto; }

/* Prevent horizontal scroll */
html, body { overflow-x: hidden; }

/* Forms: better tap targets on mobile */
input, select, textarea, button {
  min-height: 44px;
  font-size: 16px; /* avoids iOS zoom */
}

/* Containers */
.page-wrap { padding-left: 14px; padding-right: 14px; }

/* Tables: scroll on small screens */
.table-responsive, .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius, 14px);
}
.table-responsive table, .table-wrap table { min-width: 680px; }

/* Buttons: full width on small screens when needed */
@media (max-width: 520px){
  .actions { width:100%; }
  .actions .btn-primary, .actions button[type="submit"], .actions input[type="submit"] {
    width: 100%;
  }
  .actions a.link, .actions a { width: 100%; text-align:center; }
}

/* Login */
@media (max-width: 520px){
  .login-page{ padding: 26px 12px; }
  .login-hero{ padding: 22px; }
  .login-card{ padding: 20px; }
  .hero-h1{ font-size: 28px; }
  .brand-title{ font-size: 20px; }
}

/* KPI cards grid */
@media (max-width: 520px){
  .grid-cards{ gap: 12px; }
  .card{ padding: 14px; }
  .card .kpi{ font-size: 24px; }
}

/* Navbar / header links: stack nicely if present */
@media (max-width: 720px){
  nav, .navbar, .topbar, header{
    flex-wrap: wrap;
  }
  .navbar-nav, .nav, .menu{
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Modals / cards spacing */
@media (max-width: 520px){
  .card, .login-hero, .login-card{
    border-radius: 16px;
  }
}


/* === Premium Sidebar + Topbar + Contrast (Dark UI) === */
:root{
  --bg-0: #071522;
  --bg-1: rgba(255,255,255,.06);
  --bg-2: rgba(255,255,255,.04);
  --stroke: rgba(255,255,255,.14);
  --stroke-2: rgba(255,255,255,.10);
  --text-0: rgba(255,255,255,.96);
  --text-1: rgba(255,255,255,.78);
  --text-2: rgba(255,255,255,.62);
}

body{ background-color: var(--bg-0); color: var(--text-0); }

/* Shell layout */
.app-shell{
  display:grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}
@media (max-width: 980px){
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{ position: sticky; top: 0; z-index: 50; }
}

/* Sidebar */
.sidebar{
  background: linear-gradient(180deg, rgba(15,36,60,.92), rgba(7,21,34,.92));
  border-right: 1px solid var(--stroke);
  padding: 16px 14px;
}
.sidebar .brand{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke-2);
}
.sidebar .brand img{ width: 34px; height: 34px; object-fit: contain; }
.sidebar .brand .t1{
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 800;
  font-size: 14px;
  margin: 0;
}
.sidebar .brand .t2{ margin:0; font-size: 12px; color: var(--text-2); }

.side-nav{ margin-top: 14px; display:grid; gap: 6px; }
.side-nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration:none;
  color: var(--text-0);
  background: rgba(255,255,255,.03);
  border: 1px solid transparent;
}
.side-nav a:hover{
  border-color: rgba(24,219,227,.35);
  background: rgba(255,255,255,.06);
}
.side-nav a.active{
  background: linear-gradient(135deg, rgba(24,219,227,.14), rgba(91,210,95,.12));
  border-color: rgba(24,219,227,.25);
}

/* Topbar */
.main{
  display:flex;
  flex-direction:column;
  min-width: 0;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(0,0,0,.16);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.topbar .title{
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 800;
  font-size: 16px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .subtitle{
  margin:0;
  font-size: 12px;
  color: var(--text-2);
}
.topbar .right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.search{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke-2);
  background: rgba(0,0,0,.18);
}
.search input{
  border: none !important;
  outline: none;
  background: transparent !important;
  color: var(--text-0) !important;
  padding: 0 !important;
  min-height: auto !important;
  font-size: 14px !important;
}
.search input::placeholder{ color: rgba(255,255,255,.45); }

.user-chip{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke-2);
  background: rgba(255,255,255,.04);
  color: var(--text-0);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
}

/* Readability: tables */
table{ color: var(--text-0); }
.table-premium, table.table, table.dataTable, table{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
}
.table-premium th, .table-premium td,
table th, table td{
  border-bottom: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
}
.table-premium th, table th{
  background: rgba(0,0,0,.24);
  color: rgba(255,255,255,.90);
}
table tr:nth-child(even) td{ background: rgba(255,255,255,.02); }
table tr:hover td{ background: rgba(255,255,255,.05); }

/* Readability: forms */
label{ color: rgba(255,255,255,.86); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea,
.form-control{
  background: rgba(0,0,0,.22) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.96) !important;
}
select option{ color: #0b1a26; } /* dropdown list text */
input::placeholder, textarea::placeholder{ color: rgba(255,255,255,.48) !important; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(24,219,227,.55) !important;
  box-shadow: 0 0 0 4px rgba(24,219,227,.12) !important;
}

/* Alerts */
.alert, .alert-danger, .alert-success, .error, .err{
  background: rgba(0,0,0,.22) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.95) !important;
}


/* === App-like Mobile Sidebar Drawer === */
.hamburger{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.95);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

@media (min-width: 981px){
  .hamburger{ display:none; }
}

@media (max-width: 980px){
  .sidebar{
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 86vw;
    max-width: 320px;
    transform: translateX(-110%);
    transition: transform .25s ease;
    box-shadow: 0 30px 80px rgba(0,0,0,.55);
  }
  body.sidebar-open .sidebar{ transform: translateX(0); }
  body.sidebar-open:before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 45;
  }
  .sidebar{ z-index: 60; }
  .topbar{ z-index: 55; }
  .main{ min-height: 100vh; }
}

/* Better content spacing */
.main .page-wrap{ padding-top: 16px; }
.page-title{ font-size: 20px; }
.card{ box-shadow: 0 14px 34px rgba(0,0,0,.35); }


/* === bootstrap-lite (so UI works even if CDN blocked) === */
.row{display:flex;flex-wrap:wrap;margin-left:-8px;margin-right:-8px;}
.row>*{padding-left:8px;padding-right:8px;}
.g-3{row-gap:16px;}
.mb-4{margin-bottom:24px;}
.mb-3{margin-bottom:16px;}
.mb-2{margin-bottom:10px;}
.col-md-3{flex:0 0 25%;max-width:25%;}
@media (max-width: 980px){.col-md-3{flex:0 0 50%;max-width:50%;}}
@media (max-width: 520px){.col-md-3{flex:0 0 100%;max-width:100%;}}
.card{background: rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14);border-radius:18px;box-shadow:0 18px 45px rgba(0,0,0,.35);} 
.card-body{padding:16px;}
.text-muted{color: rgba(255,255,255,.62)!important;font-size:13px;}
.fs-3{font-size:26px;font-weight:800;line-height:1.1;}
.d-flex{display:flex;}
.justify-content-between{justify-content:space-between;}
.align-items-center{align-items:center;}
.text-end{text-align:right;}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.18);color:rgba(255,255,255,.92);text-decoration:none;font-weight:700;font-size:13px;}
.btn-primary{border:none;color:#06111f;background:linear-gradient(135deg, var(--brand-aqua), var(--brand-lightgreen));box-shadow:0 14px 28px rgba(0,0,0,.28);}
.btn-outline-secondary{border:1px solid rgba(255,255,255,.18);background:transparent;}
.btn-outline-primary{border:1px solid rgba(24,219,227,.35);background:transparent;}
.btn-sm{padding:7px 10px;font-size:12px;border-radius:10px;}
.table{width:100%;border-collapse:collapse;}
.table thead th{background:rgba(0,0,0,.24);}
.table-striped tbody tr:nth-child(even) td{background:rgba(255,255,255,.02);}
.table td,.table th{padding:12px;border-bottom:1px solid rgba(255,255,255,.10);}

/* === Bootstrap-lite (offline-safe) === */
.row{display:flex;flex-wrap:wrap;margin-left:-8px;margin-right:-8px}
.row>*{padding-left:8px;padding-right:8px}
.g-3{row-gap:16px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}
.d-flex{display:flex}.justify-content-between{justify-content:space-between}.align-items-center{align-items:center}
.text-end{text-align:right}
.fs-3{font-size:28px;font-weight:800;font-family:Poppins,Inter,system-ui,sans-serif}
.text-muted{color:var(--text-2)!important}

.col-md-3{flex:0 0 25%;max-width:25%}
@media (max-width: 980px){.col-md-3{flex:0 0 50%;max-width:50%}}
@media (max-width: 520px){.col-md-3{flex:0 0 100%;max-width:100%}}

.card{background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);box-shadow:var(--shadow);}
.card-body{padding:16px}

.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:12px 12px;border-bottom:1px solid rgba(255,255,255,.10)}
.table thead th{background:rgba(0,0,0,.24);color:rgba(255,255,255,.90);text-align:left}
.table-striped tbody tr:nth-child(even) td{background:rgba(255,255,255,.02)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.18);color:rgba(255,255,255,.92);text-decoration:none;font-weight:700;font-size:13px}
.btn-sm{padding:8px 10px;font-size:12px;border-radius:10px}
.btn-primary{border:none;color:#06111f;background:linear-gradient(135deg,var(--brand-aqua),var(--brand-lightgreen));box-shadow:0 14px 28px rgba(0,0,0,.28)}
.btn-outline-secondary{background:transparent;border:1px solid rgba(255,255,255,.18)}
.btn-outline-primary{background:transparent;border:1px solid rgba(24,219,227,.35)}
