/* ============================================================
   TK Gastos — Design System
   Consistent with QH panel style
   ============================================================ */

:root {
    --tk-primary:   #1a5276;
    --tk-secondary: #2e86c1;
    --tk-gradient:  linear-gradient(135deg, #1a5276 0%, #2e86c1 100%);
    --tk-bg:        #f0f2f5;
    --tk-white:     #ffffff;
    --tk-border:    #dee2e6;
    --tk-text:      #212529;
    --tk-muted:     #6c757d;
}

/* ---- Body ---- */
body {
    background: var(--tk-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--tk-text);
    min-height: 100vh;
}

/* ---- Layout ---- */
.tk-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.tk-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--tk-gradient);
    min-height: 100vh;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tk-brand {
    padding: 22px 20px 18px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.tk-brand .tk-brand-icon {
    font-size: 36px;
    color: #fff;
    display: block;
    margin-bottom: 8px;
}

.tk-brand h5 {
    color: #fff;
    font-weight: 700;
    margin: 0 0 2px;
    font-size: 1rem;
}

.tk-brand small {
    color: rgba(255,255,255,0.65);
    font-size: 11px;
}

/* ---- Nav ---- */
.tk-nav {
    padding: 10px 0;
    flex: 1;
}

.tk-nav .nav-link {
    color: rgba(255,255,255,0.80);
    padding: 11px 20px;
    border-radius: 0;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border-left-color 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.93rem;
}

.tk-nav .nav-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.tk-nav .nav-link:hover {
    background: rgba(255,255,255,0.10);
    color: #fff;
    border-left-color: rgba(255,255,255,0.5);
}

.tk-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #fff;
    font-weight: 600;
}

.tk-sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.tk-sidebar-footer .btn {
    font-size: 0.82rem;
    width: 100%;
    color: rgba(255,255,255,0.80);
    border-color: rgba(255,255,255,0.30);
}

.tk-sidebar-footer .btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ---- Main content area ---- */
.tk-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

/* ---- Topbar ---- */
.tk-topbar {
    background: var(--tk-white);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--tk-border);
}

.tk-topbar h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tk-primary);
}

.tk-topbar small {
    color: var(--tk-muted);
    font-size: 0.82rem;
}

/* ---- Stat cards ---- */
.tk-stat {
    background: var(--tk-white);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--tk-border);
    transition: transform 0.25s;
    height: 100%;
}

.tk-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.09);
}

.tk-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.tk-stat-icon.blue   { background: rgba(46,134,193,0.12);  color: #2e86c1; }
.tk-stat-icon.green  { background: rgba(28,177,96,0.12);   color: #1cb160; }
.tk-stat-icon.red    { background: rgba(231,76,60,0.12);   color: #e74c3c; }
.tk-stat-icon.amber  { background: rgba(243,156,18,0.12);  color: #f39c12; }
.tk-stat-icon.purple { background: rgba(142,68,173,0.12);  color: #8e44ad; }

.tk-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tk-primary);
    line-height: 1;
}

.tk-stat-label {
    font-size: 0.82rem;
    color: var(--tk-muted);
    margin-top: 4px;
}

/* ---- Content cards ---- */
.tk-card {
    background: var(--tk-white);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--tk-border);
}

/* ---- KPI (legacy alias) ---- */
.tk-kpi {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--tk-primary);
}

/* ---- Tables ---- */
.table thead th {
    background: #f4f8fc;
    color: #26435c;
    font-size: 0.83rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom-width: 1px;
}

.table tbody td {
    font-size: 0.89rem;
    vertical-align: middle;
}

/* ---- Pills / badges ---- */
.tk-pill {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    display: inline-block;
}

.tk-status-pending  { background: #fff3cd; color: #856404; }
.tk-status-approved { background: #d1e7dd; color: #0f5132; }
.tk-status-rejected { background: #f8d7da; color: #842029; }

/* ---- Login page ---- */
.tk-login-bg {
    background: var(--tk-gradient);
    min-height: 100vh;
}

.tk-login-card {
    max-width: 430px;
    background: var(--tk-white);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    padding: 32px;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .tk-layout {
        flex-direction: column;
    }
    .tk-sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        min-height: unset;
        position: relative;
        overflow: visible;
    }
    .tk-nav .nav-link {
        padding: 9px 16px;
    }
    .tk-content {
        padding: 14px;
    }
}
