:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --primary: #056293;
    --primary-hover: #044a6e;
    --primary-light: #e0f2fe;
    --bg-body: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --card-hover-shadow: 0 4px 12px rgba(0,0,0,.1);
    --border-color: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text);
    overflow-x: hidden;
}

/* Auth Pages */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #056293 0%, #033b58 100%);
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.auth-header .text-muted {
    color: var(--text-muted);
    font-size: .9rem;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform .2s;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: center;
}

.sidebar-nav {
    list-style: none;
    padding: .5rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: #fff;
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav .nav-link.text-danger {
    color: #f87171;
}

.sidebar-nav .nav-link.text-danger:hover {
    color: #f87171;
    background: var(--sidebar-hover);
    border-left-color: #f87171;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    flex: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: box-shadow .2s;
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-header h6 {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i { font-size: 1.3rem; }

.stat-icon.bg-primary-subtle { background: var(--primary-light); color: var(--primary); }
.stat-icon.bg-success-subtle { background: #dcfce7; color: #16a34a; }
.stat-icon.bg-warning-subtle { background: #fef3c7; color: #d97706; }
.stat-icon.bg-info-subtle { background: #e0f2fe; color: #0284c7; }

.stat-icon i.text-primary,
.stat-icon i.text-success,
.stat-icon i.text-warning,
.stat-icon i.text-info { color: inherit; }

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-info span {
    font-size: .8rem;
    color: var(--text-muted);
}

/* Tables */
.table { font-size: .9rem; margin: 0; }

.table th {
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: .75rem 1rem;
    background: transparent;
}

.table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tr:hover td { background: #f8fafc; }

/* Buttons */
.btn {
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    padding: 8px 18px;
    border: 1px solid transparent;
    transition: all .15s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

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

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text);
    border-color: var(--border-color);
    background: #fff;
}

.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text);
}

.btn-outline-danger {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fff;
}

.btn-outline-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-sm { font-size: .8rem; padding: 4px 12px; }
.btn-lg { font-size: .95rem; padding: 12px 24px; }

.btn-link {
    border: none;
    color: var(--primary);
    background: transparent;
}

.btn-link:hover { text-decoration: underline; }

.btn-group .btn:not(:last-child) { border-right: 1px solid rgba(0,0,0,.08); }

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,98,147,.12);
}

.input-group-text {
    background: #f8fafc;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: .9rem;
    padding: 10px 14px;
}

.input-group .form-control { border-left: none; }
.input-group .form-control:focus { border-left: none; }
.input-group-text[type="button"] { cursor: pointer; border-left: none; }

/* Badges */
.badge {
    border-radius: 6px;
    font-weight: 600;
    font-size: .7rem;
    padding: 3px 10px;
}

.badge.bg-success { background: #16a34a !important; }
.badge.bg-danger { background: #dc2626 !important; }
.badge.bg-secondary { background: #64748b !important; }
.badge.bg-light { background: #f1f5f9 !important; color: var(--text) !important; }

/* Pagination */
.page-link {
    color: var(--text);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: .8rem;
    padding: 6px 14px;
    margin: 0 2px;
    background: #fff;
}

.page-link:hover {
    background: #f1f5f9;
    color: var(--text);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    font-size: .9rem;
    padding: 12px 16px;
}

.alert-danger { background: #fef2f2; color: #dc2626; }
.alert-success { background: #f0fdf4; color: #16a34a; }
.alert-info { background: #e0f2fe; color: #0284c7; }

/* Auth footer */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .85rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

/* Headings */
h4 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.3px; }

.form-label {
    font-weight: 600;
    font-size: .8rem;
    margin-bottom: .35rem;
}

/* Progress */
.progress {
    border-radius: 8px;
    background: #e2e8f0;
}

.progress-bar { background: var(--primary); }

/* QR Preview */
.qr-preview {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    border: 2px dashed var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 1rem; }
    .auth-card { padding: 1.5rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
