:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #059669;
    --border: #dce3ee;
    --sidebar: #111827;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { background: var(--sidebar); color: #fff; padding: 22px 14px; }
.brand { font-size: 17px; font-weight: 700; padding: 0 10px 20px; }
.nav a { display: block; color: #cbd5e1; padding: 10px 12px; border-radius: 8px; margin-bottom: 3px; }
.nav a:hover,.nav a.active { color: #fff; background: #263244; text-decoration: none; }
.nav .section { color: #6b7280; font-size: 12px; padding: 15px 12px 5px; text-transform: uppercase; }
.main { min-width: 0; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.content { padding: 26px 28px 50px; max-width: 1500px; }
h1 { font-size: 24px; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 0 0 16px; }
.grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat,.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 2px 10px rgba(15,23,42,.035); }
.stat { padding: 18px; }
.stat .value { font-size: 27px; font-weight: 750; }
.stat .label { color: var(--muted); margin-top: 4px; }
.panel { padding: 20px; margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
label { display: block; font-weight: 600; margin: 0 0 6px; }
input[type=text],input[type=password],input[type=number],select,textarea { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: var(--text); font: inherit; }
textarea { min-height: 130px; resize: vertical; }
input:focus,select:focus,textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field { margin-bottom: 16px; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 7px; padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 600; background: #e5e7eb; color: #1f2937; }
.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: #fff; border-color: #cbd5e1; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th,td { padding: 11px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; white-space: nowrap; }
th { color: #475569; background: #f8fafc; font-size: 12px; }
td.wrap { white-space: normal; min-width: 240px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: #e5e7eb; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.alert { padding: 12px 15px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.filters { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pagination a,.pagination span { padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pagination .current { background: var(--primary); color: #fff; }
.progress { height: 11px; background: #e5e7eb; border-radius: 20px; overflow: hidden; min-width: 170px; }
.progress > i { display: block; height: 100%; background: var(--primary); }
.log { background: #0b1020; color: #d1e7ff; padding: 16px; border-radius: 8px; min-height: 430px; max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 Consolas,monospace; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg,#eff6ff,#f8fafc); }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: 0 18px 50px rgba(15,23,42,.10); }
.muted { color: var(--muted); }
.mono { font-family: Consolas,monospace; }
.danger-text { color: var(--danger); }
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .nav { display: grid; grid-template-columns: repeat(2,1fr); }
    .nav .section { grid-column: 1/-1; }
    .grid { grid-template-columns: repeat(2,1fr); }
    .form-grid,.filters { grid-template-columns: 1fr; }
    .content { padding: 20px 14px; }
}
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
