:root {
    --ink: #172033;
    --muted: #6d778a;
    --line: #e6e9ef;
    --surface: #ffffff;
    --canvas: #f5f7fa;
    --nav: #101827;
    --nav-muted: #94a0b5;
    --primary: #176b5b;
    --primary-strong: #0d5749;
    --primary-soft: #e4f4ef;
    --danger: #b33b47;
    --danger-soft: #fcebed;
    --warning: #a76513;
    --warning-soft: #fff3dd;
    --info: #315fc4;
    --info-soft: #eaf0ff;
    --shadow: 0 14px 36px rgba(29, 40, 62, .07);
    --radius: 14px;
}
* { box-sizing: border-box; }
html { font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 254px; display: flex; flex-direction: column; color: #eef2f8; background: var(--nav); border-right: 1px solid #273246; }
.brand { display: flex; align-items: center; gap: 12px; height: 82px; padding: 0 22px; border-bottom: 1px solid #263145; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; color: #fff; font-size: 20px; font-weight: 800; background: linear-gradient(145deg, #28a087, #176b5b); border-radius: 11px; box-shadow: 0 8px 20px rgba(23,107,91,.32); }
.brand strong, .brand small, .user-chip strong, .user-chip small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .1px; }
.brand small { margin-top: 2px; color: var(--nav-muted); font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; }
.main-nav { flex: 1; padding: 18px 12px; overflow-y: auto; }
.nav-label { margin: 18px 12px 7px; color: #637089; font-size: 10px; font-weight: 700; letter-spacing: 1.35px; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 44px; margin-bottom: 3px; padding: 9px 12px; color: #b8c1d1; font-size: 14px; font-weight: 550; border-radius: 9px; transition: .16s ease; }
.nav-link:hover { color: #fff; background: #1a2639; }
.nav-link.active { color: #fff; background: #1d3d3b; box-shadow: inset 3px 0 #38b79c; }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; color: #aab6c9; font-size: 11px; font-weight: 800; border: 1px solid #3a4659; border-radius: 7px; }
.nav-link.active .nav-icon { color: #83ddca; border-color: #3c7d72; }
.sidebar-footer { padding: 16px; border-top: 1px solid #263145; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar { display: grid; width: 37px; height: 37px; flex: none; place-items: center; color: #c8fff2; font-weight: 750; background: #21453f; border: 1px solid #37665e; border-radius: 50%; }
.user-chip strong { max-width: 145px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.user-chip small { margin-top: 2px; color: var(--nav-muted); font-size: 11px; }
.main-area { min-height: 100vh; margin-left: 254px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 14px 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar h1 { margin: 1px 0 0; font-size: 22px; letter-spacing: -.4px; }
.eyebrow { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.server-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.server-status i { width: 8px; height: 8px; background: #20a875; border-radius: 50%; box-shadow: 0 0 0 4px #e0f6ec; }
.menu-toggle { display: none; width: 40px; height: 40px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.content { max-width: 1540px; margin: 0 auto; padding: 28px 30px 46px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading h2 { margin: 0; font-size: 20px; }
.page-heading p { max-width: 700px; margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { position: relative; min-height: 132px; padding: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card::after { content: ""; position: absolute; right: -25px; bottom: -35px; width: 90px; height: 90px; background: var(--primary-soft); border-radius: 50%; opacity: .8; }
.stat-card.accent::after { background: #dff3ed; }
.stat-card.warn::after { background: var(--warning-soft); }
.stat-card.danger::after { background: var(--danger-soft); }
.stat-label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-value { display: block; font-size: 29px; font-weight: 760; letter-spacing: -1px; }
.stat-meta { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.75fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.card-header h3 { margin: 0; font-size: 15px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 19px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 14px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .7px; text-align: left; text-transform: uppercase; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 13px 14px; font-size: 13px; vertical-align: middle; border-bottom: 1px solid #edf0f4; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfd; }
.cell-title { display: block; font-weight: 680; }
.cell-subtitle { display: block; max-width: 310px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 3px 9px; font-size: 10px; font-weight: 750; letter-spacing: .25px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.badge-success { color: #14745d; background: #e2f5ef; }
.badge-muted { color: #657083; background: #eef1f5; }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
.btn { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 680; background: #fff; border: 1px solid #dce1e8; border-radius: 9px; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); border-color: #bdc6d3; box-shadow: 0 5px 14px rgba(23,32,51,.08); }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-danger { color: var(--danger); background: #fff; border-color: #efcbd0; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-warning { color: var(--warning); border-color: #efd8af; }
.btn-ghost { color: #aeb8c8; background: transparent; border-color: #344156; }
.btn-sm { min-height: 31px; padding: 5px 9px; font-size: 11px; border-radius: 7px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-label { display: block; margin-bottom: 7px; color: #374155; font-size: 12px; font-weight: 680; }
.form-control { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #dce1e8; border-radius: 9px; outline: none; transition: .15s ease; }
textarea.form-control { min-height: 90px; resize: vertical; }
.form-control:focus { border-color: #4e9f8e; box-shadow: 0 0 0 3px rgba(23,107,91,.11); }
.form-control::placeholder { color: #a9b0bc; }
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: 11px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.form-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.filter-bar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.filter-bar .form-group { min-width: 180px; flex: 1; }
.filter-bar .form-group.search { flex: 2; }
.alert { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 14px; font-size: 12px; border: 1px solid; border-radius: 10px; }
.alert button { cursor: pointer; font-size: 19px; background: none; border: 0; opacity: .55; }
.alert-success { color: #155e4c; background: #e8f7f2; border-color: #c3e9dd; }
.alert-error { color: #8f2f3a; background: #fff0f1; border-color: #f0c7cc; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.detail-item { min-height: 90px; padding: 16px; background: #fff; }
.detail-item label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.detail-item strong { display: block; font-size: 13px; }
.detail-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.section-stack { display: grid; gap: 20px; }
details.inline-editor { margin-top: 7px; }
details.inline-editor summary { cursor: pointer; color: var(--primary); font-size: 11px; font-weight: 680; list-style: none; }
details.inline-editor summary::-webkit-details-marker { display: none; }
.inline-editor-panel { margin-top: 10px; padding: 14px; background: #f8fafb; border: 1px solid var(--line); border-radius: 9px; }
.progress-list { display: grid; gap: 15px; }
.progress-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }
.progress-track { height: 7px; overflow: hidden; background: #edf0f4; border-radius: 99px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: inherit; }
.activity-list { display: grid; gap: 0; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 11px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 4px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 4px var(--primary-soft); }
.activity-item p { margin: 0; font-size: 12px; line-height: 1.45; }
.activity-item small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.license-key-box { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; padding: 18px; background: #10251f; border-radius: 12px; color: #e8fff8; }
.license-key-box code { font-size: 17px; letter-spacing: 1.1px; word-break: break-all; }
.license-key-box p { margin: 5px 0 0; color: #9cc9bd; font-size: 11px; }
.license-key-box form { display: flex; align-items: center; gap: 8px; margin: 0; }
.license-key-box .form-control { min-width: 280px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; overflow-x: auto; background: #eef1f4; border-radius: 10px; }
.tab { padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 680; background: transparent; border: 0; border-radius: 7px; white-space: nowrap; }
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(23,32,51,.07); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.feature-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 9px; align-items: end; margin-bottom: 9px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 11px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #21483f 0, transparent 32%), linear-gradient(135deg, #0d1421, #15243a); }
.login-wrap { width: min(100%, 430px); }
.login-brand { display: flex; justify-content: center; align-items: center; gap: 11px; margin-bottom: 24px; color: #fff; }
.login-brand .brand-mark { width: 46px; height: 46px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { margin-top: 3px; color: #98a8bc; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.login-card { padding: 30px; background: rgba(255,255,255,.98); border: 1px solid rgba(255,255,255,.35); border-radius: 18px; box-shadow: 0 28px 70px rgba(0,0,0,.3); }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.login-card > p { margin: 8px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-card .form-group { margin-bottom: 15px; }
.login-footer { margin: 18px 0 0; color: #93a1b4; font-size: 10px; line-height: 1.5; text-align: center; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); }
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 25; display: none; background: rgba(7,13,22,.55); }
    .sidebar-overlay.open { display: block; }
    .main-area { margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .topbar { justify-content: flex-start; gap: 12px; padding: 12px 16px; }
    .topbar-actions { margin-left: auto; }
    .server-status { display: none; }
    .topbar-actions .btn { display: none; }
    .content { padding: 20px 15px 36px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .license-key-box { align-items: stretch; flex-direction: column; }
    .license-key-box form { align-items: stretch; flex-direction: column; }
    .license-key-box .form-control { min-width: 0; }
    .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
    .feature-row { grid-template-columns: 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
}
@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .login-card { padding: 23px; }
}
