*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; font-size: 14px; background: #f0f4f8; color: #1e293b; }

.header {
    position: fixed; top: 0; left: 0; right: 0; height: 56px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    display: flex; align-items: center; padding: 0 20px;
    color: white; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.header .user-info { margin-left: auto; font-size: 13px; display: flex; align-items: center; gap: 12px; }
.header .user-info a { color: rgba(255,255,255,.75); text-decoration: none; font-size: 12px; }
.header .user-info a:hover { color: white; }

.sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0; width: 220px;
    background: white; border-right: 1px solid #e2e8f0;
    overflow-y: auto; z-index: 50; padding: 12px 0;
}
.sidebar .section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: #94a3b8; padding: 14px 16px 4px; letter-spacing: .08em;
}
.sidebar a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; color: #475569; text-decoration: none;
    font-size: 13.5px; border-left: 3px solid transparent; transition: all .15s;
}
.sidebar a:hover { background: #f8fafc; color: #1e3a8a; }
.sidebar a.active { background: #eff6ff; color: #1d4ed8; border-left-color: #1d4ed8; font-weight: 600; }

.content { margin-left: 220px; margin-top: 56px; padding: 24px; min-height: calc(100vh - 56px); }

.card { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.card-title { font-size: 15px; font-weight: 600; color: #1e293b; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 8px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-top: 3px solid #1d4ed8; }
.stat-card .value { font-size: 30px; font-weight: 700; color: #1e3a8a; line-height: 1; }
.stat-card .label { font-size: 12px; color: #64748b; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; padding: 10px 12px; text-align: left; border-bottom: 1px solid #e2e8f0; }
td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-yellow { background: #fef9c3; color: #854d0e; }

.btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; transition: all .15s; }
.btn-primary { background: #1d4ed8; color: white; }
.btn-primary:hover { background: #1e3a8a; color: white; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: #166534; }
.btn-success:hover { background: #bbf7d0; }
.btn-warning { background: #fef9c3; color: #854d0e; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 13px; background: white; color: #1e293b; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: #94a3b8; margin-top: 3px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: white; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.12); width: 380px; overflow: hidden; }
.login-header { background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%); padding: 28px 32px; color: white; }
.login-header h1 { font-size: 20px; font-weight: 700; }
.login-header p { font-size: 13px; opacity: .8; margin-top: 4px; }
.login-body { padding: 28px 32px; }

.log-area { background: #0f172a; color: #94a3b8; padding: 16px; border-radius: 6px; font-family: 'Courier New', monospace; font-size: 12px; max-height: 500px; overflow-y: auto; white-space: pre-wrap; line-height: 1.5; }
.mono { font-family: 'Courier New', monospace; font-size: 12px; }
.actions { display: flex; gap: 6px; }
.text-muted { color: #94a3b8; font-size: 12px; }
.text-right { text-align: right; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.mt-4 { margin-top: 16px; }
.page-title { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 20px; }
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:200; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal { background:white; border-radius:10px; padding:24px; width:480px; max-width:95vw; box-shadow:0 8px 32px rgba(0,0,0,.2); }
.modal h3 { font-size:16px; font-weight:600; margin-bottom:16px; }
