/* COMPLETO: Login + Dashboard + Admin + Tabs */

:root {
    --c-bg: #0d1117;
    --c-card: #161b22;
    --c-border: #30363d;
    --c-text: #e6edf3;
    --c-muted: #8b949e;
    --c-accent: #2f81f7;
    --c-success: #3fb950;
    --c-warning: #d29922;
    --c-danger: #f85149;
    --c-info: #58a6ff;
    --c-gold: #d4af37;
}

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

body {
    font-family: 'Work Sans', -apple-system, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
}

/* ============ LOGIN PAGE ============ */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-left {
    background: linear-gradient(135deg, #1e2936 0%, #0d1117 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    margin-bottom: 3rem;
}

.brand-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.login-brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-brand p {
    color: var(--c-muted);
    font-size: 1.1rem;
}

.login-promo h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--c-text);
}

.login-promo p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--c-muted);
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.login-stat {
    text-align: center;
}

.login-stat .val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-accent);
}

.login-stat .lbl {
    font-size: 0.9rem;
    color: var(--c-muted);
    margin-top: 0.25rem;
}

.login-right {
    background: var(--c-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-form-wrap {
    width: 100%;
    max-width: 420px;
}

.login-form-wrap h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-form-wrap .sub {
    color: var(--c-muted);
    margin-bottom: 2rem;
}

.login-demo-hint {
    background: rgba(47, 129, 247, 0.1);
    border: 1px solid var(--c-accent);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.w-100 { width: 100%; }

/* ============ DASHBOARD ============ */
.welcome-banner {
    background: linear-gradient(135deg, var(--c-card) 0%, #1e2936 100%);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-banner h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    color: var(--c-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon.blue { background: rgba(47, 129, 247, 0.15); }
.stat-icon.green { background: rgba(63, 185, 80, 0.15); }
.stat-icon.gold { background: rgba(212, 175, 55, 0.15); }
.stat-icon.red { background: rgba(248, 81, 73, 0.15); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-top: 0.25rem;
}

.pending-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pending-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pending-item {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pending-item-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.pending-item-info span {
    font-size: 0.85rem;
    color: var(--c-muted);
}

.pending-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--c-card);
    border-right: 1px solid var(--c-border);
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon { font-size: 2rem; }

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--c-muted);
}

.sidebar-section {
    padding: 1rem 0.5rem;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin: 0.125rem 0;
    color: var(--c-muted);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.nav-link:hover {
    background: rgba(47, 129, 247, 0.1);
    color: var(--c-text);
}

.nav-link.active {
    background: rgba(47, 129, 247, 0.15);
    color: var(--c-accent);
    font-weight: 500;
}

.nav-icon {
    font-size: 1.25rem;
    width: 1.25rem;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--c-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.4rem;
    border-radius: 10px;
    min-width: 1.25rem;
    text-align: center;
}

.sidebar-user {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
    color: var(--c-muted);
}

.user-logout {
    background: transparent;
    border: none;
    color: var(--c-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.user-logout:hover {
    color: var(--c-danger);
}

/* ============ MAIN LAYOUT ============ */
.main-wrap {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--c-card);
    border-bottom: 1px solid var(--c-border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--c-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ============ CARDS ============ */
.card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-top: 0.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    color: var(--c-text);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.req { color: var(--c-danger); }

/* ============ BUTTONS ============ */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--c-accent);
    color: white;
}

.btn-primary:hover {
    background: #1f71e7;
}

.btn-secondary {
    background: var(--c-border);
    color: var(--c-text);
}

.btn-secondary:hover {
    background: #484f58;
}

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

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

.btn-warning {
    background: var(--c-warning);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ============ TABLES ============ */
.table-wrap {
    overflow-x: auto;
    border-radius: 8px;
}

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

thead {
    background: var(--c-bg);
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--c-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--c-border);
}

tbody tr:hover {
    background: rgba(47, 129, 247, 0.05);
}

.text-sm { font-size: 0.9rem; }
.text-xs { font-size: 0.8rem; }
.text-muted { color: var(--c-muted); }
.text-center { text-align: center; }

/* ============ BADGES ============ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(63, 185, 80, 0.15);
    color: var(--c-success);
}

.badge-warning {
    background: rgba(210, 153, 34, 0.15);
    color: var(--c-warning);
}

.badge-danger {
    background: rgba(248, 81, 73, 0.15);
    color: var(--c-danger);
}

.badge-info {
    background: rgba(88, 166, 255, 0.15);
    color: var(--c-info);
}

.badge-muted {
    background: rgba(139, 148, 158, 0.15);
    color: var(--c-muted);
}

/* ============ ALERTS ============ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(63, 185, 80, 0.1);
    border-color: var(--c-success);
    color: var(--c-success);
}

.alert-danger {
    background: rgba(248, 81, 73, 0.1);
    border-color: var(--c-danger);
    color: var(--c-danger);
}

.alert-warning {
    background: rgba(210, 153, 34, 0.1);
    border-color: var(--c-warning);
    color: var(--c-warning);
}

.alert-info {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--c-info);
    color: var(--c-info);
}

/* ============ EMPTY STATES ============ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--c-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--c-text);
    margin-bottom: 0.5rem;
}

/* ============ TOOLBAR ============ */
.toolbar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-wrap {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    font-size: 1rem;
}

.search-wrap input {
    padding-left: 2.5rem;
}

/* ============ TABS ============ */
.tabs-wrap {
    background: var(--c-card);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1rem;
}

.tabs-header {
    display: flex;
    gap: 0;
    background: var(--c-bg);
    border-bottom: 2px solid var(--c-border);
    overflow-x: auto;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--c-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--c-text);
    background: rgba(47, 129, 247, 0.05);
}

.tab-button.active {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
    background: var(--c-card);
}

.tab-panel {
    display: none;
    padding: 1.5rem;
}

.tab-panel.active {
    display: block;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    
    .login-left {
        display: none;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-wrap {
        margin-left: 0;
    }
    
    .topbar-toggle {
        display: block;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
