:root {
    --sidebar-width: 235px;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --body-bg: #f3f4f6;
    --card-border: #e5e7eb;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--body-bg);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;
    color: #1f2937;
}

.admin-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    margin-top: 5px;
    font-size: 12px;
    color: #9ca3af;
}

.sidebar-nav {
    padding: 15px 10px;
}

.sidebar-nav a {
    display: block;
    padding: 11px 15px;
    margin-bottom: 4px;
    border-radius: 7px;
    color: #d1d5db;
    text-decoration: none;
    transition: all .15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--sidebar-hover);
    color: #fff;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    min-height: 70px;
    padding: 14px 25px;
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.content-area {
    padding: 25px;
}

.panel-card,
.stat-card {
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.stat-card {
    height: 100%;
    padding: 22px;
    background: #fff;
    border-radius: 10px;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
}

.stat-value {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 700;
}

.status-row,
.setting-item {
    padding: 14px 0;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-row:last-child,
.setting-item:last-child {
    border-bottom: 0;
}

.setting-label {
    color: #6b7280;
}

.setting-value {
    font-weight: 600;
}

.task-content {
    min-width: 160px;
    max-width: 320px;
    margin: 0;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.login-page {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, #111827 0%, #1d4ed8 100%);
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 38px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.login-header {
    margin-bottom: 30px;
    text-align: center;
}

.login-header h2 {
    font-size: 23px;
    font-weight: 700;
}

.login-header p {
    margin: 8px 0 0;
    color: #6b7280;
}

.flash-wrapper {
    margin-bottom: 15px;
}

.table th {
    white-space: nowrap;
    font-size: 13px;
    color: #4b5563;
}

.table td {
    font-size: 14px;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: 100%;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        padding: 12px 16px;
    }

    .content-area {
        padding: 15px;
    }
}
