:root{
  --navy:#071d35;
  --navy2:#0b2948;
  --blue:#1469d8;
  --blue2:#2f7fe0;
  --green:#16a06b;
  --bg:#f4f7fb;
  --text:#142033;
  --muted:#667085;
  --border:#e4e9f0;
  --white:#fff;
  --shadow:0 6px 22px rgba(11,27,59,.07);
}

*{box-sizing:border-box}
html{font-size:16px;scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.45;
}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}

/* APP */
.app-shell{display:flex;min-height:100vh}
.sidebar{
  width:250px;
  background:linear-gradient(180deg,var(--navy),#06182d);
  color:#d9e5f4;
  position:fixed;
  inset:0 auto 0 0;
  z-index:20;
  padding:18px 13px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
}
.side-brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 9px 24px;
  color:#fff;
}
.side-brand strong{display:block;font-size:17px;letter-spacing:.5px}
.side-brand small{
  display:block;
  color:#67d5a8;
  font-size:10px;
  letter-spacing:2px;
  margin-top:2px;
}
.logo-mark{
  width:40px;height:40px;border-radius:11px;
  background:linear-gradient(135deg,#1b76e5,#15a66f);
  display:grid;place-items:center;
  font-weight:900;color:#fff;font-size:21px;
  flex:0 0 40px;
}
.side-nav{display:flex;flex-direction:column;gap:3px}
.side-nav a,.side-bottom a{
  padding:11px 12px;
  border-radius:9px;
  display:flex;
  gap:10px;
  align-items:center;
  font-size:14px;
  color:#d9e5f4;
  transition:.15s;
}
.side-nav a:hover,.side-nav a.active,.side-bottom a:hover{
  background:#12365a;color:#fff;
}
.nav-label{
  font-size:10px;
  letter-spacing:1.5px;
  color:#7892ad;
  padding:17px 12px 5px;
}
.side-bottom{margin-top:auto;padding-top:15px}

/* MAIN */
.main-area{
  margin-left:250px;
  min-width:0;
  width:calc(100% - 250px);
}
.topbar{
  height:66px;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 30px;
  position:sticky;
  top:0;
  z-index:10;
}
.desktop-title{font-size:12px;color:var(--muted);letter-spacing:1px}
.mobile-title{display:none}
.admin-chip{font-size:13px;color:#475467}
.admin-chip:first-letter{color:var(--green)}

main{
  width:100%;
  max-width:1450px;
  margin:0 auto;
  padding:28px 30px;
}
.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:22px;
}
.page-head h1{margin:0;font-size:28px;line-height:1.2}
.sub{color:var(--muted);font-size:13px;margin-top:5px}

/* CARDS */
.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.stat-card,.panel{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow);
}
.stat-card{padding:19px;min-width:0}
.stat-label{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.2px}
.stat{font-size:29px;font-weight:800;margin:8px 0 4px;line-height:1.15}
.stat-foot{font-size:11px;color:var(--green)}
.panel{padding:20px;margin-top:18px}
.panel h3{margin:0 0 15px;font-size:16px}

/* QUICK ACTIONS */
.quick{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.quick a{
  padding:14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fbfcfe;
  transition:.15s;
}
.quick a:hover{border-color:#b8cee8;transform:translateY(-1px)}
.quick strong{display:block;margin-bottom:4px}
.quick span{font-size:12px;color:var(--muted)}

/* COLUMNS / TABLES */
.two-col{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);
  gap:18px;
}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;min-width:600px}
th,td{
  padding:12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  font-size:13px;
  white-space:nowrap;
}
th{
  font-size:11px;
  text-transform:uppercase;
  color:#667085;
  background:#fafbfc;
}
.badge{
  display:inline-block;
  padding:5px 9px;
  border-radius:999px;
  background:#edf2f7;
  font-size:11px;
}
.badge.green{background:#e5f7ef;color:#08764f}
.badge.blue{background:#e8f1ff;color:#1258ad}
.badge.orange{background:#fff4df;color:#9a6500}
.badge.red{background:#ffe9e9;color:#b42318}

/* BUTTONS */
.btn,button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:9px;
  padding:10px 14px;
  background:var(--blue);
  color:#fff;
  cursor:pointer;
  font-weight:600;
  font-size:13px;
  min-height:40px;
  transition:.15s;
}
.btn:hover,button:hover{filter:brightness(.96);transform:translateY(-1px)}
.btn.green,button.green{background:var(--green)}
.btn.dark{background:var(--navy)}
.btn.light{background:#eef4fb;color:#194e83}
.actions{display:flex;gap:7px;flex-wrap:wrap}

/* FORMS */
input,select,textarea{
  width:100%;
  padding:11px 12px;
  margin:6px 0 13px;
  border:1px solid #ccd5e0;
  border-radius:8px;
  background:#fff;
  color:var(--text);
  outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:#6aa0e8;
  box-shadow:0 0 0 3px rgba(20,105,216,.09);
}
textarea{min-height:90px;resize:vertical}
label{font-size:12px;color:#475467}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 14px;
}
.form-grid .full{grid-column:1/-1}
.searchbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
}
.amount{font-size:30px;font-weight:800;color:var(--green)}
.error,.success{padding:10px;border-radius:8px}
.error{background:#fee4e2;color:#9b1c1c}
.success{background:#e7f7ef;color:#086a48}

/* CHART */
.chart-bars{
  height:220px;
  display:flex;
  align-items:end;
  gap:10px;
  padding:20px 0 28px;
  overflow:hidden;
}
.bar{
  flex:1;
  background:linear-gradient(180deg,#2677db,#7aa9ed);
  border-radius:7px 7px 0 0;
  min-height:8px;
  position:relative;
}
.bar span{
  position:absolute;
  bottom:-23px;
  width:100%;
  text-align:center;
  font-size:10px;
  color:var(--muted);
}
footer{text-align:center;padding:25px;color:#8a94a6;font-size:12px}

/* INVOICE */
.invoice-paper{
  background:#fff;
  border:1px solid var(--border);
  padding:30px;
  max-width:900px;
  margin:auto;
}
.invoice-head{
  display:flex;
  justify-content:space-between;
  gap:20px;
  border-bottom:2px solid var(--navy);
  padding-bottom:18px;
}
.invoice-total{font-size:26px;font-weight:800}
.hide-print{}

/* LARGE LAPTOP / SMALL DESKTOP */
@media(max-width:1200px){
  .sidebar{width:225px}
  .main-area{margin-left:225px;width:calc(100% - 225px)}
  main{padding:24px 22px}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .quick{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* TABLET */
@media(max-width:900px){
  .sidebar{width:76px;padding:14px 8px}
  .side-brand{justify-content:center;padding:5px 0 22px}
  .side-brand>div:not(.logo-mark),
  .side-nav span,.side-bottom span,.nav-label{display:none}
  .side-nav a,.side-bottom a{justify-content:center;padding:12px 8px}
  .main-area{margin-left:76px;width:calc(100% - 76px)}
  .topbar{padding:0 18px}
  .desktop-title{display:none}
  .mobile-title{display:inline;font-size:12px;font-weight:700}
  .two-col{grid-template-columns:1fr}
}

/* MOBILE */
@media(max-width:650px){
  .topbar{height:58px;padding:0 12px}
  main{padding:18px 12px}
  .page-head{flex-direction:column}
  .page-head h1{font-size:23px}
  .grid{grid-template-columns:1fr 1fr;gap:10px}
  .stat-card{padding:14px}
  .stat{font-size:23px}
  .quick{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}
  .form-grid .full{grid-column:auto}
  .searchbar{grid-template-columns:1fr}
  .searchbar button,.searchbar .btn{width:100%}
  .invoice-paper{padding:18px}
  .invoice-head{flex-direction:column}
}

/* VERY SMALL PHONES */
@media(max-width:430px){
  .sidebar{width:62px}
  .main-area{margin-left:62px;width:calc(100% - 62px)}
  .grid{grid-template-columns:1fr}
  .stat-card{padding:16px}
  .topbar{padding:0 10px}
  .admin-chip{font-size:11px}
  .chart-bars{height:180px}
}

/* PRINT */
@media print{
  .sidebar,.topbar,footer,.hide-print{display:none!important}
  .main-area{margin:0;width:100%}
  main{padding:0}
  .invoice-paper{border:0;box-shadow:none}
}
