/* =========================
   VSOL – refreshed UI theme
   (HTML/JS unchanged)
   ========================= */

/* ------- Theme tokens ------- */
:root{
  --bg: #f5fcff;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --brand-500:#0d8ae6;
  --brand-600:#0c7cd5;
  --brand-700:#0a6dbd;

  --nav-800:#0b2d52;
  --nav-900:#082644;

  --ink-900:#0b2540;
  --ink-700:#234a7c;

  --line:#e6eef7;
  --card:#eaf5ff;
  --shadow: 0 8px 18px rgba(13,138,230,.12), 0 3px 6px rgba(13,138,230,.08);
  --soft-shadow: 0 8px 20px rgba(9, 30, 66, .08);
}

/* ------- Base ------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  color:var(--ink-900);
  background: var(--bg);
}

/* ------- Header (gradient bar) ------- */
#header{
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  color:#fff;
  text-align:center;
  padding:22px 20px 26px;
  position:sticky;
  top:0;
  z-index:10;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
#header h1{margin:.2rem 0 .1rem 0; font-size:32px; letter-spacing:.3px}
#header p{margin:0; opacity:.9}
#logout-btn{background:#fff;color:var(--brand-700); box-shadow: var(--soft-shadow)}
#logout-btn:hover{filter:brightness(.96)}

/* ------- App split layout ------- */
#app-container{
  display:flex;
  gap:16px;
  padding:18px;
  max-width:1200px;
  margin:0 auto;
  height: calc(100vh - 120px);
}

/* ------- Sidebar ------- */
#sidebar{
  width:260px;
  background: linear-gradient(180deg, var(--nav-900), var(--nav-800));
  color:#e6f2ff;
  border-radius: 18px;
  padding:14px 10px;
  box-shadow: var(--soft-shadow);
  overflow:auto;
}
#sidebar ul{list-style:none; margin:0; padding:6px}
#sidebar .nav-item{
  padding:14px 16px;
  margin:6px 6px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  letter-spacing:.2px;
  color:#e7f2ff;
  position:relative;
  transition: background .18s ease, transform .06s ease;
}
#sidebar .nav-item:hover{
  background: rgba(255,255,255,.06);
}
#sidebar .nav-item.active{
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
#sidebar .nav-item.active::before{
  content:"";
  position:absolute;
  left:-6px; top:10px; bottom:10px;
  width:6px;
  border-radius:6px;
  background: linear-gradient(180deg, #ffd84d, #ffbb0d); /* thin accent like screenshot */
}

/* ------- Main content panel ------- */
#content{
  flex:1;
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border-radius: 20px;
  padding:22px;
  overflow:auto;
  box-shadow: var(--soft-shadow);
}

/* Section heading */
.section h2{
  color: var(--brand-700);
  margin: 6px 4px 16px;
  font-size: 28px;
}

/* Route switching (unchanged behaviour) */
.section{display:none}
.active-section{display:block}

/* ------- KPI Cards (Dashboard) ------- */
.cards{
  display:grid;
  grid-template-columns: 1fr;
  gap:22px;
  margin-top:10px;
}
.card{
  background: var(--card);
  border-radius: 18px;
  padding:22px;
  box-shadow: var(--shadow);
  border:1px solid rgba(13,138,230,.10);
}
.card h3{margin:0 0 6px 0; color:var(--ink-700)}
.card .value{font-size:28px; font-weight:800; color:var(--brand-700);}

/* ------- Tables ------- */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
  box-shadow: var(--soft-shadow);
  border:1px solid var(--line);
}
thead th{
  background:#eaf2fd;
  color:#0d47a1;
  text-align:left;
  padding:12px 14px;
  font-weight:700;
  border-bottom:1px solid var(--line);
}
tbody td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:#f8fbff}

/* ------- Buttons ------- */
.primary-btn{
  background: var(--brand-500);
  color:#fff;
  border:none;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  box-shadow: 0 6px 14px rgba(13,138,230,.18);
  transition: transform .06s ease, filter .18s ease;
}
.primary-btn:hover{filter:brightness(.96)}
.primary-btn:active{transform: translateY(1px)}
.primary-btn.small{padding:6px 10px; font-size:13px}

/* ------- Forms (modals & settings) ------- */
label{display:block; margin:10px 0 6px 0; font-weight:700; color:var(--ink-700)}
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="password"], select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid #90caf9;
  border-radius:10px;
  background:#fff;
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(13,138,230,.15);
}

/* ------- Invoice subsections / notes ------- */
.invoice-subsection{margin-top:18px}
.invoice-subsection h3{
  color:var(--brand-700);
  margin:10px 0;
}
.note{
  margin:6px 0 12px;
  padding:10px 12px;
  background:#f3f8ff;
  border:1px dashed #cfe3ff;
  border-radius:10px;
  color:#345;
}

/* ------- Modal ------- */
.modal-overlay{
  position:fixed; inset:0;
  background:rgba(10,25,41,.45);
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  z-index:1000;
}
.modal-content{
  background:#fff;
  width:min(760px, 100%);
  max-height:90vh;
  overflow:auto;
  border-radius:16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
  padding:18px;
}

/* ------- Utilities ------- */
.hidden{display:none}

/* ------- Responsive tweaks ------- */
@media (min-width: 900px){
  .cards{grid-template-columns: 1fr}
}
@media (max-width: 1024px){
  #app-container{gap:12px}
  #sidebar{width:220px}
}
@media (max-width: 820px){
  #app-container{flex-direction:column; height:auto}
  #sidebar{width:100%; display:flex; overflow:auto; padding:8px}
  #sidebar ul{display:flex; flex-wrap:nowrap; gap:4px}
  #sidebar .nav-item{white-space:nowrap; margin:4px}
  #sidebar .nav-item.active::before{display:none}
}
