:root{
  --bg:#f3f6fb;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --border:#d8e1ec;
  --text:#0f172a;
  --muted:#64748b;
  --accent:#0891b2;
  --accent-2:#0ea5e9;
  --nav:#08142d;
  --nav-soft:#10203f;
  --success:#059669;
  --danger:#dc2626;
  --shadow:0 10px 24px rgba(15,23,42,.08);
  --radius:18px;
}

html{
  margin:0;
  padding:0;
}

body.v3-body{
  margin:0;
  padding:0;
  font-family:Arial, Helvetica, sans-serif;
  font-size:15px;
  line-height:1.45;
  background:var(--bg);
  color:var(--text);
}

body.v3-body *{
  box-sizing:border-box;
}

body.v3-body a{
  text-decoration:none;
}

body.v3-body p{
  margin:0 0 12px 0;
}

body.v3-body h1,
body.v3-body h2,
body.v3-body h3{
  margin:0;
  line-height:1.2;
  color:var(--text);
}

.topbar{
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 20px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:50;
  box-shadow:0 2px 10px rgba(15,23,42,.04);
}

.topbar-left,
.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
}

.topbar-title-wrap{
  display:flex;
  flex-direction:column;
}

.topbar-title{
  font-size:20px;
  font-weight:800;
  color:var(--text);
}

.topbar-subtitle{
  font-size:12px;
  color:var(--muted);
  margin-top:3px;
}

.topbar-userbox{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
}

.topbar-username{
  font-size:14px;
  font-weight:700;
  color:var(--text);
}

.topbar-userrole{
  font-size:12px;
  color:var(--muted);
}

.menu-toggle{
  width:44px;
  height:44px;
  border:none;
  border-radius:12px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  cursor:pointer;
  font-size:18px;
  font-weight:700;
  box-shadow:0 8px 20px rgba(8,145,178,.22);
}

.logout-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:12px;
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
  font-weight:700;
}

.layout-shell{
  display:flex;
  min-height:calc(100vh - 68px);
}

.sidebar{
  width:280px;
  background:linear-gradient(180deg, var(--nav), var(--nav-soft));
  color:#fff;
  padding:22px 16px;
  flex-shrink:0;
  border-right:1px solid rgba(255,255,255,.05);
}

.sidebar-brand-wrap{
  margin-bottom:24px;
  padding:0 8px;
}

.sidebar-brand{
  font-size:28px;
  font-weight:800;
  letter-spacing:.2px;
  color:#fff;
}

.sidebar-subtitle{
  margin-top:4px;
  font-size:13px;
  color:#94a3b8;
}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.menu-group{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.menu-title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#94a3b8;
  padding:0 10px;
}

.menu-link{
  display:flex;
  align-items:center;
  min-height:44px;
  color:#e2e8f0;
  padding:11px 14px;
  border-radius:14px;
  transition:.2s ease;
  border:1px solid transparent;
  font-weight:600;
}

.menu-link:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(255,255,255,.08);
}

.menu-link.is-active{
  background:linear-gradient(135deg, rgba(8,145,178,.28), rgba(14,165,233,.16));
  border-color:rgba(14,165,233,.32);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.03);
}

.content{
  flex:1;
  padding:28px;
  max-width:calc(100vw - 280px);
}

.page-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:22px;
}

.page-header h1{
  font-size:38px;
  font-weight:800;
  margin-bottom:8px;
}

.page-header p{
  color:var(--muted);
  margin:0;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:20px;
}

.stat-card,
.card,
.auth-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}

.stat-label{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
  margin-bottom:12px;
  font-weight:700;
}

.stat-value{
  font-size:30px;
  font-weight:800;
  line-height:1.1;
  margin-bottom:6px;
}

.stat-meta{
  font-size:13px;
  color:var(--muted);
}

.card-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin-bottom:20px;
}

.card-grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.card-header h2{
  font-size:26px;
  font-weight:800;
}

.quick-links{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.quick-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:12px;
  background:#e0f2fe;
  color:#0c4a6e !important;
  border:1px solid #bae6fd;
  font-weight:700;
}

.quick-link.is-disabled{
  background:#f8fafc;
  color:#94a3b8 !important;
  border-color:#e2e8f0;
  cursor:not-allowed;
}

.status-list{
  margin:0;
  padding-left:18px;
}

.status-list li{
  margin:0 0 10px 0;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.chip{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  background:#ecfeff;
  color:#155e75;
  border:1px solid #a5f3fc;
  font-size:12px;
  font-weight:700;
}

.auth-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:linear-gradient(180deg, #eff6ff, #f8fafc);
}

.auth-card{
  width:min(100%, 440px);
}

body.v3-body label{
  display:block;
  font-size:14px;
  font-weight:700;
  margin-bottom:6px;
}

body.v3-body input,
body.v3-body button{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  margin:0 0 14px 0;
  font:inherit;
}

body.v3-body input{
  background:#fff;
  color:var(--text);
}

body.v3-body button{
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  border:none;
  cursor:pointer;
  font-weight:700;
}

.simple-page{
  padding:40px;
}

.simple-page h1{
  font-size:48px;
  margin-bottom:10px;
}

.simple-page p{
  color:var(--muted);
}

.table-wrap{
  width:100%;
  overflow-x:auto;
}

.data-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:760px;
}

.data-table thead th{
  text-align:left;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--muted);
  background:#f8fafc;
  border-bottom:1px solid var(--border);
  padding:12px 14px;
}

.data-table tbody td{
  padding:14px;
  border-bottom:1px solid #edf2f7;
  vertical-align:middle;
}

.data-table tbody tr:hover{
  background:#f8fbff;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

.badge-success{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
}

.badge-muted{
  background:#e5e7eb;
  color:#374151;
  border:1px solid #d1d5db;
}

code{
  background:#eff6ff;
  color:#1d4ed8;
  padding:2px 6px;
  border-radius:8px;
  font-size:.92em;
}

.alert{
  margin:0 0 18px 0;
  padding:14px 16px;
  border-radius:14px;
  font-weight:700;
  border:1px solid transparent;
}

.alert-success{
  background:#ecfdf5;
  color:#166534;
  border-color:#a7f3d0;
}

.alert-danger{
  background:#fef2f2;
  color:#991b1b;
  border-color:#fecaca;
}

.stack-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.form-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.form-field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-field select,
.form-field input,
.form-field textarea{
  width:100%;
  min-height:46px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font:inherit;
}

.form-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.btn-primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 16px;
  border-radius:12px;
  border:none;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  font-weight:700;
  cursor:pointer;
}

.btn-primary[disabled]{
  opacity:.55;
  cursor:not-allowed;
}

.badge-info{
  background:#e0f2fe;
  color:#0c4a6e;
  border:1px solid #bae6fd;
}

.alert-info{
  background:#eff6ff;
  color:#1d4ed8;
  border-color:#bfdbfe;
}
