:root {
    --sgc-bg: #f4f6f9;
    --sgc-sidebar: #111827;
    --sgc-sidebar-2: #1f2937;
    --sgc-primary: #2563eb;
    --sgc-text: #111827;
    --sgc-muted: #6b7280;
    --sgc-border: #e5e7eb;
    --sgc-card: #ffffff;
    --sgc-danger: #dc2626;
    --sgc-success: #16a34a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--sgc-bg);
    color: var(--sgc-text);
}

a { color: inherit; text-decoration: none; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #111827, #1d4ed8);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.auth-card h1 { margin: 0 0 6px; font-size: 26px; }
.auth-card p { margin: 0 0 22px; color: var(--sgc-muted); }

.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--sgc-border);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    background: #fff;
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--sgc-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.btn-secondary { background: #374151; }
.btn-danger { background: var(--sgc-danger); }
.btn-light { background: #e5e7eb; color: #111827; }
.btn-sm { padding: 7px 10px; font-size: 12px; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.sidebar {
    background: var(--sgc-sidebar);
    color: #fff;
    padding: 22px 16px;
}

.brand {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 26px;
    letter-spacing: -.5px;
}

.brand span { display: block; color: #93c5fd; font-size: 12px; font-weight: 600; margin-top: 4px; }

.nav-group { margin-bottom: 22px; }
.nav-title {
    color: #9ca3af;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .7px;
    margin: 0 0 8px 10px;
}

.nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #d1d5db;
    margin-bottom: 4px;
    font-size: 14px;
}

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

.main {
    min-width: 0;
}

.topbar {
    height: 68px;
    background: #fff;
    border-bottom: 1px solid var(--sgc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.content {
    padding: 28px;
}

.page-title {
    margin: 0 0 20px;
    font-size: 26px;
    letter-spacing: -.5px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--sgc-card);
    border: 1px solid var(--sgc-border);
    border-radius: 16px;
    padding: 18px;
}

.card h3 { margin: 0 0 6px; font-size: 14px; color: var(--sgc-muted); }
.card .metric { font-size: 30px; font-weight: 800; }

.table-card {
    background: #fff;
    border: 1px solid var(--sgc-border);
    border-radius: 16px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--sgc-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--sgc-border);
    text-align: left;
    font-size: 14px;
}

th {
    font-size: 12px;
    color: var(--sgc-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #f3f4f6; color: #374151; }

.form-card {
    max-width: 760px;
    background: #fff;
    border: 1px solid var(--sgc-border);
    border-radius: 16px;
    padding: 22px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; }
    .cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .cards, .grid-2 { grid-template-columns: 1fr; }
    .content { padding: 18px; }
    .topbar { padding: 0 18px; }
}

.alert-warning{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;padding:12px 14px;border-radius:12px;margin:12px 0}
.btn-danger{background:#dc2626;color:#fff}
.btn-danger:hover{background:#b91c1c}
code{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;padding:2px 6px;font-size:12px}
@media print{.sidebar,.topbar,.actions,.btn,form{display:none!important}.main{margin:0!important}.content{padding:0!important}.table-card,.form-card{box-shadow:none!important;border:0!important}}
