:root {
    --primary: #1e3a8a;
    --primary-hover: #1d4ed8;
    --secondary: #475569;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background: var(--bg-main); color: var(--text-main); display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-brand {
    padding: 24px 20px;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #38bdf8;
}
.sidebar-menu { list-style: none; padding: 15px 0; }
.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar-item.active a, .sidebar-item a:hover {
    background: #1e293b;
    color: #ffffff;
    border-left: 4px solid #38bdf8;
}
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #1e293b;
    font-size: 0.85rem;
    color: #64748b;
}

/* Main Content */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.top-nav {
    background: #ffffff;
    height: 65px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}
.page-title { font-size: 1.25rem; font-weight: 700; color: #1e293b; }
.user-menu { display: flex; align-items: center; gap: 15px; font-size: 0.9rem; }
.user-name { font-weight: 600; color: #334155; }
.logout-btn { color: var(--danger); text-decoration: none; font-weight: 600; font-size: 0.85rem; padding: 6px 12px; border: 1px solid #fecaca; border-radius: 6px; }
.logout-btn:hover { background: #fee2e2; }

.content-body { padding: 30px; }

/* Cards & Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: #ffffff;
    padding: 22px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 1.85rem; font-weight: 700; color: #0f172a; }
.stat-sub { font-size: 0.8rem; margin-top: 6px; color: var(--text-muted); }

/* Table Container */
.card-box {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    overflow: hidden;
}
.card-box-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-box-title { font-size: 1.1rem; font-weight: 600; color: #1e293b; }
.card-box-body { padding: 24px; }

/* Tables */
table.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; }
table.data-table th { background: #f8fafc; padding: 12px 16px; font-weight: 600; color: #475569; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover { background: #f1f5f9; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; font-size: 0.75rem; font-weight: 600; border-radius: 9999px; text-transform: uppercase; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #ffffff; }
.btn-danger { background: var(--danger); color: #ffffff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--secondary); }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: #334155; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,138,0.15); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; font-weight: 500; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Code Blocks */
.code-block {
    background: #0f172a;
    color: #38bdf8;
    padding: 16px;
    border-radius: 6px;
    font-family: Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
    user-select: all;
    margin-bottom: 15px;
}
