:root{
  --primary:#123B70; --primary-2:#1769C2; --bg:#f4f6fa; --card:#fff; --text:#1f2937; --muted:#6b7280;
  --border:#e5e7eb; --success:#16a34a; --warning:#d97706; --danger:#dc2626; --info:#0891b2; --radius:10px;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);font-size:15px;line-height:1.5;display:flex;flex-direction:column;min-height:100vh}
a{color:var(--primary-2);text-decoration:none} a:hover{text-decoration:underline}
h1{font-size:1.6rem;margin:0 0 1rem} h2{font-size:1.2rem;margin:0 0 .8rem}
.container{max-width:1200px;width:100%;margin:0 auto;padding:24px 20px;flex:1}
.footer{text-align:center;color:var(--muted);font-size:13px;padding:20px}

/* Topbar */
.topbar{background:#fff;color:var(--primary);display:flex;align-items:center;gap:20px;padding:0 20px;min-height:76px;position:sticky;top:0;z-index:10;border-bottom:3px solid var(--primary-2);box-shadow:0 2px 8px rgba(18,59,112,.08)}
.brand{display:flex;align-items:center;gap:8px;white-space:nowrap} .brand:hover{text-decoration:none}
.brand img{height:54px;width:auto;display:block}
.brand small{background:#fbbf24;color:#1f2937;font-size:.7rem;font-weight:700;padding:2px 6px;border-radius:4px}
.mainnav{display:flex;gap:4px;flex:1;align-items:center}
.mainnav a{color:var(--primary);padding:8px 12px;border-radius:6px;white-space:nowrap;font-weight:500}
.mainnav a:hover,.mainnav a.active{background:#e8f1fc;color:var(--primary-2);text-decoration:none}
.mainnav .logout{margin-left:auto}
.cart-count{background:#fbbf24;color:#1f2937;border-radius:10px;padding:0 7px;font-size:.8rem;font-weight:700}
.burger{display:none;margin-left:auto;background:none;border:0;color:var(--primary);font-size:1.6rem;cursor:pointer}
@media (max-width:860px){
  .burger{display:block}
  .mainnav{display:none;position:absolute;top:76px;left:0;right:0;background:#fff;border-bottom:3px solid var(--primary-2);box-shadow:0 8px 16px rgba(18,59,112,.12);flex-direction:column;align-items:stretch;padding:10px}
  .brand img{height:38px}
  .nav-open .mainnav{display:flex} .mainnav .logout{margin-left:0}
}

/* Cards / grid */
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:20px;margin-bottom:20px}
.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:20px}
.stat{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px}
.stat .label{color:var(--muted);font-size:.85rem}
.stat .value{font-size:1.6rem;font-weight:700;margin-top:4px}
.stat .sub{color:var(--muted);font-size:.8rem}
.page-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.page-head h1{margin:0}

/* Buttons & forms */
.btn{display:inline-block;background:var(--primary-2);color:#fff;border:0;border-radius:6px;padding:9px 16px;font-size:.95rem;cursor:pointer;line-height:1.3}
.btn:hover{background:var(--primary);text-decoration:none;color:#fff}
.btn-sm{padding:5px 10px;font-size:.85rem}
.btn-light{background:#e5e7eb;color:var(--text)} .btn-light:hover{background:#d1d5db;color:var(--text)}
.btn-success{background:var(--success)} .btn-danger{background:var(--danger)} .btn-success:hover,.btn-danger:hover{filter:brightness(.9)}
.btn-block{display:block;width:100%;text-align:center}
label{display:block;font-weight:600;font-size:.9rem;margin:10px 0 4px}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=tel],input[type=search],select,textarea{
  width:100%;padding:9px 11px;border:1px solid #cbd5e1;border-radius:6px;font:inherit;background:#fff}
input:focus,select:focus,textarea:focus{outline:2px solid #93c5fd;border-color:var(--primary-2)}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px} @media(max-width:600px){.form-row{grid-template-columns:1fr}}
.inline-form{display:inline}
.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.filters input,.filters select{width:auto;min-width:180px}
.filters input[type=checkbox]{min-width:0}

/* Auth pages */
.auth-logo{text-align:center;margin:20px auto 4px}
.auth-logo img{width:100%;max-width:440px;height:auto}
.auth{max-width:440px;margin:16px auto 30px}
.auth.wide{max-width:720px}
.auth h1{text-align:center}

/* Tables */
.table-wrap{overflow-x:auto}
table.table{width:100%;border-collapse:collapse;background:#fff}
.table th,.table td{padding:10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}
.table th{background:#f9fafb;font-size:.82rem;text-transform:uppercase;color:var(--muted);letter-spacing:.02em}
.table tr:hover td{background:#fafbff}
.num{text-align:right!important;white-space:nowrap}
.thumb{width:48px;height:48px;object-fit:cover;border-radius:6px;background:#f3f4f6}

/* Badges & alerts */
.badge{display:inline-block;padding:3px 9px;border-radius:12px;font-size:.78rem;font-weight:600;white-space:nowrap}
.badge-info{background:#cffafe;color:#155e75} .badge-warning{background:#fef3c7;color:#92400e}
.badge-primary{background:#dbeafe;color:#1e40af} .badge-success{background:#dcfce7;color:#166534}
.badge-danger{background:#fee2e2;color:#991b1b} .badge-secondary{background:#e5e7eb;color:#374151}
.alert{padding:12px 16px;border-radius:8px;margin-bottom:16px;border:1px solid}
.alert-success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.alert-danger,.alert-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.alert-warning{background:#fffbeb;border-color:#fde68a;color:#92400e}
.alert-info{background:#ecfeff;border-color:#a5f3fc;color:#155e75}
.muted{color:var(--muted)}

/* Catalogue */
.catalog{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.product{background:#fff;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column}
.product .img{aspect-ratio:1/1;background:#f3f4f6;display:flex;align-items:center;justify-content:center;color:#9ca3af;font-size:2.5rem}
.product .img img{width:100%;height:100%;object-fit:contain;background:#fff}
.product .body{padding:12px 14px;display:flex;flex-direction:column;gap:4px;flex:1}
.product .cat{font-size:.75rem;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
.product .name{font-weight:600}
.product .ref{font-size:.8rem;color:var(--muted)}
.product .price{font-size:1.2rem;font-weight:700;color:var(--primary);margin-top:auto}
.product .price small{font-size:.75rem;color:var(--muted);font-weight:400}
.product form{display:flex;gap:6px;padding:0 14px 14px}
.product form input{width:70px}
.product form .btn{flex:1}
.qty{width:80px!important}

/* Charts (CSS bars) */
.bars{display:flex;align-items:flex-end;gap:6px;height:200px;padding-top:20px;border-bottom:1px solid var(--border)}
.bars .bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0}
.bars .bar span.fill{width:100%;max-width:42px;background:linear-gradient(180deg,var(--primary-2),var(--primary));border-radius:4px 4px 0 0;min-height:2px;position:relative}
.bars .bar .v{font-size:.68rem;color:var(--muted);white-space:nowrap;margin-bottom:3px}
.bars-labels{display:flex;gap:6px} .bars-labels span{flex:1;text-align:center;font-size:.72rem;color:var(--muted);padding-top:4px;min-width:0;overflow:hidden;white-space:nowrap}
.hbar{background:#eef2ff;border-radius:4px;height:8px;margin-top:4px} .hbar span{display:block;height:8px;background:var(--primary-2);border-radius:4px}
.timeline{list-style:none;padding:0;margin:0} .timeline li{padding:8px 0 8px 18px;border-left:2px solid var(--border);position:relative}
.timeline li:before{content:"";position:absolute;left:-6px;top:14px;width:10px;height:10px;border-radius:50%;background:var(--primary-2)}
.text-right{text-align:right}
.mt{margin-top:16px}
@media print{.topbar,.footer,.btn,form,.filters{display:none!important}.card{border:0;padding:0}body{background:#fff}}
