:root{
 --bg:#f4f7fb;--surface:#fff;--surface-soft:#f8fafc;--border:#e5eaf1;--text:#172033;--muted:#718096;
 --primary:#4f46e5;--primary-2:#6366f1;--success:#16a34a;--warning:#d97706;--danger:#dc2626;
 --sidebar:#0d1626;--shadow:0 10px 30px rgba(15,23,42,.06);--radius:18px;--sidebar-width:252px;
}
*{box-sizing:border-box;-webkit-font-smoothing:antialiased}
html{background:var(--bg)}
body{margin:0;min-height:100vh;width:100%;font-family:Inter,"Segoe UI",Roboto,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit}button,input,select,textarea{font:inherit}

/* App shell: sidebar is fixed, content always starts beside it. */
.main-container{display:block;min-height:100vh;margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width));padding:32px 38px 52px;overflow:visible}
.dashboard-container{width:100%;max-width:1500px;margin:0 auto}
.sidebar{width:var(--sidebar-width)!important;min-width:var(--sidebar-width);position:fixed!important;left:0;top:0;height:100vh!important;z-index:1000;background:linear-gradient(180deg,var(--sidebar),#09111f)!important;border-right:1px solid rgba(255,255,255,.06);box-shadow:8px 0 30px rgba(15,23,42,.08)}
.sidebar-header{padding:28px 24px!important;min-height:84px;border-bottom:1px solid rgba(255,255,255,.06)}
.sidebar-header .logo-box{background:linear-gradient(135deg,#6366f1,#4f46e5);width:40px;height:40px;display:grid;place-items:center;padding:0;border-radius:12px;color:#fff}
.nav-links{padding:18px 14px!important}
.nav-item{padding:11px 13px!important;margin-bottom:4px!important;border-radius:11px!important;color:#aab5c7!important;font-size:13px;font-weight:650!important;gap:11px!important}
.nav-item i{width:19px;text-align:center;opacity:.8}.nav-item:hover{background:rgba(255,255,255,.06)!important;color:#fff!important}
.nav-item.active{background:linear-gradient(90deg,rgba(99,102,241,.24),rgba(99,102,241,.10))!important;color:#fff!important;box-shadow:inset 3px 0 0 #818cf8}
.sidebar-footer{background:rgba(0,0,0,.18)!important}

/* Page headers */
.hero,.dashboard-header,.hero-dashboard,.welcome-header{background:linear-gradient(135deg,#111827 0%,#273449 100%);border:0!important;border-radius:22px!important;padding:30px 34px!important;margin:0 0 22px!important;box-shadow:0 18px 40px rgba(15,23,42,.14)!important;color:#fff}
.hero h1,.welcome-header h1{font-size:30px!important;letter-spacing:-.7px;margin:0 0 8px}.hero p,.welcome-header p{color:#c7d0dc}

/* Dashboard grids */
.stats-grid,.stat-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px!important;margin:0 0 22px!important}
.main-content-layout,.content-layout,.dashboard-grid{display:grid!important;grid-template-columns:minmax(0,1.7fr) minmax(300px,1fr);gap:18px!important;align-items:stretch}
.chart-section,.activity-section{min-width:0}

.stat-card,.stat-box{border:1px solid var(--border)!important;border-radius:16px!important;background:var(--surface)!important;box-shadow:var(--shadow)!important;padding:20px 22px!important;min-height:118px;transition:transform .18s,box-shadow .18s}
.stat-card:hover{transform:translateY(-2px);box-shadow:0 16px 32px rgba(15,23,42,.09)!important}.stat-card .stat-label,.stat-label{color:#8491a4!important;font-size:10px!important;letter-spacing:.1em}.stat-value{color:var(--text)!important;font-size:27px!important}
.stat-card.status-green{background:#f0fdf4!important;border-color:#bbf7d0!important}.stat-card.status-yellow{background:#fffbeb!important;border-color:#fde68a!important}.stat-card.status-red{background:#fef2f2!important;border-color:#fecaca!important}

.card,.chart-card,.table-card,.side-card{border:1px solid var(--border)!important;border-radius:18px!important;background:var(--surface)!important;box-shadow:var(--shadow)!important;padding:26px!important;margin:0 0 18px}.card-title{color:var(--text)!important;font-size:19px!important}
.table-wrapper{border-radius:12px;overflow:auto}table{width:100%;min-width:620px;border-collapse:collapse}th{padding:13px 14px!important;color:#8a96a8!important;font-size:10px!important;letter-spacing:.08em;background:#f8fafc;text-align:left}td{padding:16px 14px!important;border-bottom:1px solid #eef2f6!important;color:#334155}

.btn,.btn-light,.btn-primary,.btn-secondary{border-radius:10px!important;min-height:40px;padding:10px 16px!important;font-weight:750!important;cursor:pointer;text-decoration:none;transition:.18s}.btn-primary{background:linear-gradient(135deg,var(--primary-2),var(--primary))!important;color:#fff!important;border:0!important;box-shadow:0 7px 16px rgba(79,70,229,.18)}.btn-primary:hover{transform:translateY(-1px);filter:brightness(1.03)}.btn-secondary{background:#fff!important;color:#344054!important;border:1px solid #dbe2ea!important}.btn-secondary:hover{background:#f8fafc!important}
.form-group label{font-size:11px!important;font-weight:750!important;color:#475467!important}.form-group input,.form-group select,.form-group textarea,input,select,textarea{border:1px solid #d8e0e9;border-radius:10px!important;background:#fff;color:#172033;padding:11px 12px!important;outline:none;transition:border .15s,box-shadow .15s}.form-group input:focus,.form-group select:focus,.form-group textarea:focus,input:focus,select:focus,textarea:focus{border-color:#818cf8;box-shadow:0 0 0 3px rgba(99,102,241,.10)}
.notice{border-radius:12px!important}.mobile-top-bar{display:none;background:#101828!important}.mobile-top-bar .logo-box{background:#4f46e5}

/* Dashboard chart */
.chart-area{height:245px;display:flex;align-items:flex-end;gap:14px;padding:20px 8px 4px;background:linear-gradient(180deg,#fff,#fafbfe);border:0!important;border-radius:12px}
.bar-container{height:100%;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:8px}.bar{width:100%;height:190px;display:flex;align-items:flex-end;justify-content:center}.bar-fill{width:min(42px,65%);min-height:0;border-radius:8px 8px 4px 4px;background:linear-gradient(180deg,#818cf8,#4f46e5);position:relative;transition:height .3s ease}.bar-val{position:absolute;top:-23px;left:50%;transform:translateX(-50%);font-size:10px;font-weight:800;color:#475467;white-space:nowrap}.day-label{font-size:11px;color:#7b8798;font-weight:700}
.progress-bg{background:#edf1f6}.progress-bar{background:linear-gradient(90deg,#6366f1,#3b82f6)}.empty-state,.details-empty{background:#fafbfc}.page-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:18px}.page-toolbar h1{margin:0;font-size:25px;letter-spacing:-.4px}.eyebrow,.section-kicker{color:#8b98aa!important;font-size:10px!important;letter-spacing:.14em!important}.customer-layout .main-container{background:var(--bg)}

@media(max-width:1200px){.stats-grid,.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.main-content-layout,.content-layout,.dashboard-grid{grid-template-columns:1fr}.main-container{padding:28px 26px 44px}}
@media(max-width:768px){body{display:block}.sidebar{position:fixed!important;left:0;top:0;width:268px!important;min-width:268px!important;transform:translateX(-100%)}.sidebar.active{transform:translateX(0)}.mobile-top-bar{display:flex!important;position:fixed;top:0;left:0;right:0;height:62px;z-index:900;align-items:center;justify-content:space-between;padding:0 14px}.main-container{margin-left:0;width:100%;padding:82px 14px 30px}.stats-grid,.stat-grid{grid-template-columns:1fr!important}.main-content-layout,.content-layout,.dashboard-grid{grid-template-columns:1fr}.hero,.dashboard-header,.hero-dashboard,.welcome-header{padding:24px 20px!important}.hero h1,.welcome-header h1{font-size:25px!important}.card,.chart-card,.table-card,.side-card{padding:20px!important}.chart-area{height:220px;gap:7px;padding-inline:2px}}

/* v59.3 sidebar refinement */
.sidebar{width:252px!important;min-width:252px!important;padding:0!important;display:flex!important;flex-direction:column!important;background:linear-gradient(180deg,#0b1424 0%,#08111f 100%)!important;border-right:1px solid rgba(148,163,184,.10)!important;box-shadow:12px 0 35px rgba(15,23,42,.08)!important}
.sidebar-brand{height:82px;display:flex;align-items:center;gap:12px;padding:0 20px;border-bottom:1px solid rgba(148,163,184,.10)}
.brand-mark{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;flex:0 0 38px;background:linear-gradient(135deg,#6366f1,#4f46e5);color:#fff;font-size:14px;font-weight:800;overflow:hidden;box-shadow:0 6px 18px rgba(79,70,229,.22)}
.brand-mark img{width:100%;height:100%;object-fit:contain;padding:5px;background:#fff}
.brand-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.brand-copy strong{font-size:14px;color:#f8fafc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand-copy span{font-size:10px;color:#718096;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.sidebar-nav{flex:1;overflow-y:auto;padding:16px 12px 20px!important}.sidebar-nav::-webkit-scrollbar{width:5px}.sidebar-nav::-webkit-scrollbar-thumb{background:rgba(148,163,184,.18);border-radius:10px}
.nav-section-title{padding:18px 11px 7px;color:#64748b;font-size:9px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}
.sidebar .nav-item{display:flex!important;align-items:center!important;gap:11px!important;width:100%!important;min-height:39px!important;margin:2px 0!important;padding:9px 11px!important;border-radius:10px!important;color:#aeb9c9!important;text-decoration:none!important;font-size:13px!important;font-weight:650!important;line-height:1.2!important;box-shadow:none!important}
.sidebar .nav-item:hover{background:rgba(255,255,255,.055)!important;color:#fff!important;text-decoration:none!important}.sidebar .nav-item.active{background:linear-gradient(90deg,rgba(99,102,241,.24),rgba(99,102,241,.08))!important;color:#fff!important;box-shadow:inset 3px 0 #818cf8!important}
.nav-icon{width:20px;height:20px;display:grid;place-items:center;flex:0 0 20px;border-radius:6px;color:#7f8da2;font-size:13px;font-weight:800}.nav-item.active .nav-icon{color:#a5b4fc;background:rgba(99,102,241,.12)}
.sidebar-bottom{flex-shrink:0;border-top:1px solid rgba(148,163,184,.12);background:rgba(3,8,18,.30)}
.security-links{display:grid;grid-template-columns:1fr 1fr;padding:10px 14px 4px;gap:4px}.nav-mini{padding:7px 5px;color:#8390a4;font-size:10px;font-weight:700;text-align:center;text-decoration:none!important;border-radius:7px}.nav-mini:hover{background:rgba(255,255,255,.05);color:#fff}.nav-mini.logout{grid-column:1/-1;color:#9ba7b8;text-align:left;padding-left:8px}.nav-mini.logout:hover{color:#fb7185}
.user-card{display:flex;align-items:center;gap:10px;padding:13px 15px 16px}.user-avatar{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border-radius:10px;background:linear-gradient(135deg,#3b82f6,#6366f1);border:1px solid rgba(255,255,255,.18);color:#fff;font-size:12px;font-weight:800}.user-copy{min-width:0;display:flex;flex-direction:column;gap:3px}.user-copy strong{color:#eef2f7;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px}.user-copy span{display:flex;align-items:center;gap:5px;color:#78869a;font-size:10px;font-weight:650}.user-copy span i{width:6px;height:6px;border-radius:50%;background:#22c55e;display:inline-block}
@media(max-width:768px){.sidebar{width:252px!important;min-width:252px!important}}


/* v59.9 — responsive application shell. Shared layout only; page styling stays in pages/*.css. */
:root{--sidebar-width:252px;--content-max:1500px;--mobile-bar:60px}
html,body{max-width:100%;overflow-x:hidden}
img,svg,video{max-width:100%;height:auto}
.main-container{min-width:0;max-width:none}
.dashboard-container,.projects-page{width:100%;max-width:var(--content-max);min-width:0}
.main-container>*{min-width:0}
.page-toolbar,.page-header,.editor-heading,.list-header,.project-card-top{min-width:0}
.project-title,.project-title h3,.brand-copy,.user-copy{min-width:0}
.table-wrapper,.table-responsive,.table-scroll,.overflow-auto{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Large laptop */
@media (max-width:1399px){
  .main-container{padding-left:30px;padding-right:30px}
  .dashboard-container,.projects-page{max-width:1320px}
  .project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Tablet landscape / small laptop */
@media (max-width:1100px){
  .main-container{padding:26px 24px 44px}
  .stats-grid,.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .main-content-layout,.content-layout,.dashboard-grid{grid-template-columns:1fr!important}
  .project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .project-form{grid-template-columns:repeat(2,minmax(0,1fr))}
  .billing-control-expanded{grid-template-columns:1fr 72px minmax(180px,1fr)!important}
  .billing-control-expanded .price-field{grid-column:span 1}
  .hero,.dashboard-header,.hero-dashboard,.welcome-header{padding:26px 28px!important}
}

/* Tablet portrait */
@media (max-width:900px){
  .sidebar{width:252px!important;min-width:252px!important}
  .main-container{margin-left:252px;width:calc(100% - 252px);padding:24px 20px 40px}
  .stats-grid,.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .project-grid{grid-template-columns:1fr}
  .project-form{grid-template-columns:1fr}
  .project-form .form-group.full-width{grid-column:auto}
  .billing-control{grid-column:1/-1}
  .billing-control-expanded{grid-template-columns:1fr 72px 1fr!important;align-items:center}
  .billing-control-expanded .price-field{grid-column:span 1}
  .page-toolbar,.page-header{align-items:flex-start}
  .page-toolbar .btn,.page-header .btn{white-space:nowrap}
  .table-card,.card,.chart-card,.table-card,.side-card{overflow:hidden}
}

/* Phone */
@media (max-width:767px){
  body{font-size:14px}
  .sidebar{width:min(300px,88vw)!important;min-width:min(300px,88vw)!important;transform:translateX(-105%)!important;transition:transform .22s ease;box-shadow:18px 0 45px rgba(0,0,0,.24)!important}
  .sidebar.active{transform:translateX(0)!important}
  .mobile-top-bar{display:flex!important;position:fixed!important;top:0;left:0;right:0;height:var(--mobile-bar);z-index:1100;align-items:center;justify-content:space-between;padding:0 14px;background:#0b1424!important;border-bottom:1px solid rgba(255,255,255,.08);box-shadow:0 5px 20px rgba(15,23,42,.15)}
  .mobile-top-bar .logo-box{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;color:#fff;font-weight:800}
  .mobile-top-bar .menu-btn{width:38px;height:38px;border:1px solid rgba(255,255,255,.14);border-radius:9px;background:rgba(255,255,255,.07);color:#fff;font-size:20px;line-height:1;cursor:pointer}
  .main-container{margin-left:0!important;width:100%!important;padding:calc(var(--mobile-bar) + 16px) 12px 28px!important}
  .dashboard-container,.projects-page{max-width:none!important}
  .hero,.dashboard-header,.hero-dashboard,.welcome-header{border-radius:16px!important;padding:22px 18px!important;margin-bottom:14px!important}
  .hero h1,.welcome-header h1{font-size:24px!important;line-height:1.15}
  .hero p,.welcome-header p{font-size:13px}
  .stats-grid,.stat-grid{grid-template-columns:1fr!important;gap:10px!important}
  .stat-card,.stat-box{min-height:92px;padding:16px 18px!important}
  .stat-value{font-size:24px!important}
  .main-content-layout,.content-layout,.dashboard-grid{grid-template-columns:1fr!important;gap:12px!important}
  .card,.chart-card,.table-card,.side-card{padding:16px!important;border-radius:14px!important;margin-bottom:12px}
  .page-toolbar,.page-header,.editor-heading,.list-header{flex-direction:column;align-items:stretch;gap:12px}
  .page-title{font-size:23px}
  .page-toolbar .btn,.page-header .btn,.editor-heading .btn{width:100%;justify-content:center}
  .form-grid,.project-form{grid-template-columns:1fr!important;gap:13px!important}
  .billing-control-expanded{grid-template-columns:1fr!important;gap:11px!important;padding:14px!important}
  .billing-control-expanded .price-field{grid-column:auto!important}
  .billing-control-expanded .switch{justify-self:start}
  .form-actions{width:100%}.form-actions .btn{width:100%}
  input,select,textarea{width:100%;max-width:100%;min-height:42px}
  .table-wrapper table,.table-responsive table{min-width:680px}
  .chart-area{height:210px!important;gap:4px!important;padding:16px 2px 3px!important}
  .bar-fill{width:min(32px,70%)!important}
  .activity-item{gap:8px}
  .project-grid{grid-template-columns:1fr!important;gap:12px!important}
  .project-card{padding:16px!important}
  .project-card-top{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px}
  .project-card-top .bill-badge{grid-column:1/-1;justify-self:start}
  .project-meta{grid-template-columns:1fr!important;gap:9px!important}
  .project-actions{flex-wrap:wrap}.project-actions .btn,.project-actions form{flex:1 1 100%}.project-actions form button{width:100%}
  .security-links{grid-template-columns:1fr 1fr}
}

/* Small phones */
@media (max-width:420px){
  .main-container{padding-left:9px!important;padding-right:9px!important}
  .hero h1,.welcome-header h1{font-size:21px!important}
  .card,.chart-card,.table-card,.side-card{padding:13px!important}
  .page-title{font-size:21px}
  .btn{width:100%;min-height:42px}
  .filter-actions{width:100%}.filter-actions .btn{width:100%}
}
