:root {
    --bg: #0a0e1a;
    --surface: #111827;
    --surface-2: #1f2937;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #fbbf24;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #374151;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    flex-shrink: 0;
}

.sidebar h2 {
    margin: 0 0 24px;
    font-size: 18px;
    color: var(--accent);
}

.sidebar nav a {
    display: block;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 6px;
    transition: .2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--surface-2);
    color: var(--text);
}

.main {
    flex: 1;
    padding: 32px;
    overflow-x: auto;
}

h1 {
    margin: 0 0 24px;
    font-size: 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

input[type="text"],
input[type="datetime-local"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
}

input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: .2s;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn.danger {
    background: var(--danger);
}

.btn.success {
    background: var(--success);
}

.btn.warning {
    background: var(--warning);
    color: #000;
}

.btn.secondary {
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

tr:hover td {
    background: rgba(255,255,255,.02);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.badge.pending { background: rgba(245, 158, 11, .15); color: var(--warning); }
.badge.success { background: rgba(34, 197, 94, .15); color: var(--success); }
.badge.danger  { background: rgba(239, 68, 68, .15); color: var(--danger); }
.badge.skip    { background: rgba(156, 163, 175, .15); color: var(--text-muted); }

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
}

.empty {
    color: var(--text-muted);
    text-align: center;
    padding: 48px 0;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,.3);
    z-index: 1000;
    animation: slideIn .3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

pre {
    background: var(--surface-2);
    padding: 12px;
    border-radius: var(--radius);
    overflow: auto;
    max-height: 200px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat .value {
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
}

.stat .label {
    color: var(--text-muted);
    font-size: 14px;
}

@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .main { padding: 20px; }
}
