/* ============================================================
   LIMIT Muhasebe Sistemi - Custom Styles
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --sidebar-hover: #334155;
    --topbar-height: 60px;
    --color-income: #10b981;
    --color-expense: #ef4444;
    --color-blocked: #f59e0b;
    --color-balance: #3b82f6;
    --color-danger: #dc2626;
    --color-success: #10b981;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: #f1f5f9;
    margin: 0;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-brand i {
    font-size: 1.8rem;
    color: var(--sidebar-active);
}

.sidebar-brand small {
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--sidebar-text);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
}

.sidebar-nav .nav-header {
    padding: 18px 20px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

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

.sidebar-nav .nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

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

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

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.user-info i { font-size: 1.2rem; }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ---- Top Bar ---- */
.top-bar {
    height: var(--topbar-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.top-bar-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    color: #64748b;
    font-size: 0.85rem;
}

.filter-group .form-select {
    min-width: 160px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* ---- Content Area ---- */
.content-wrapper {
    padding: 24px;
}

/* ---- KPI Cards ---- */
.kpi-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.income::before { background: var(--color-income); }
.kpi-card.expense::before { background: var(--color-expense); }
.kpi-card.blocked::before { background: var(--color-blocked); }
.kpi-card.balance::before { background: var(--color-balance); }
.kpi-card.danger::before { background: var(--color-danger); }
.kpi-card.success::before { background: var(--color-success); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.kpi-icon.income { background: rgba(16,185,129,0.1); color: var(--color-income); }
.kpi-icon.expense { background: rgba(239,68,68,0.1); color: var(--color-expense); }
.kpi-icon.blocked { background: rgba(245,158,11,0.1); color: var(--color-blocked); }
.kpi-icon.balance { background: rgba(59,130,246,0.1); color: var(--color-balance); }

.kpi-label {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 4px 0;
}

.kpi-value.text-income { color: var(--color-income); }
.kpi-value.text-expense { color: var(--color-expense); }
.kpi-value.text-blocked { color: var(--color-blocked); }
.kpi-value.text-balance { color: var(--color-balance); }
.kpi-value.text-danger { color: var(--color-danger); }

.kpi-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ---- Cards / Panels ---- */
.panel {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.panel-body {
    padding: 20px;
}

.panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ---- Tables ---- */
.table-container {
    overflow-x: auto;
}

.table {
    font-size: 0.88rem;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    padding: 10px 12px;
}

.table tbody td {
    vertical-align: middle;
    padding: 10px 12px;
    color: #334155;
}

.table tbody tr:hover {
    background: #f1f5f9;
}

.table .money {
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
    font-weight: 600;
    white-space: nowrap;
}

.money-positive { color: var(--color-income); }
.money-negative { color: var(--color-expense); }
.money-warning { color: var(--color-blocked); }

/* ---- Chart Container ---- */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container-sm {
    height: 200px;
}

/* ---- Badges ---- */
.badge { font-weight: 500; font-size: 0.75rem; }

/* ---- Login Page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .brand i {
    font-size: 2.5rem;
    color: var(--sidebar-active);
}

.login-card .brand h2 {
    margin: 8px 0 4px;
    font-weight: 700;
    color: #1e293b;
}

.login-card .brand p {
    color: #64748b;
    font-size: 0.85rem;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .top-bar-filters {
        gap: 6px;
    }
    .filter-group .form-select {
        min-width: 120px;
    }
    .kpi-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 16px;
    }
    .top-bar {
        padding: 0 12px;
    }
    .filter-label {
        display: none;
    }
}

/* ---- Status indicators ---- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online { background: var(--color-success); }
.status-dot.offline { background: var(--color-danger); }
.status-dot.pending { background: var(--color-blocked); }

/* ---- Projection ---- */
.projection-bar {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.projection-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ---- Animated counter ---- */
.counter-animate {
    transition: all 0.5s ease;
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ---- Modern Dashboard & Quick Action Bar ---- */
.quick-action-bar {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.quick-action-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-action-title h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
}

.quick-action-title p {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
}

.quick-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-quick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    border: none;
    text-decoration: none;
}

.btn-quick:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.btn-quick-expense {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff !important;
}

.btn-quick-income {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff !important;
}

.btn-quick-salary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff !important;
}

.btn-quick-cash {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff !important;
}

.btn-quick-light {
    background: #f8fafc;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}

.btn-quick-light:hover {
    background: #f1f5f9;
}

/* ---- Modern KPI Cards ---- */
.kpi-card-modern {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.kpi-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

.kpi-card-modern.c-balance::before { background: #3b82f6; }
.kpi-card-modern.c-blocked::before { background: #f59e0b; }
.kpi-card-modern.c-income::before { background: #10b981; }
.kpi-card-modern.c-expense::before { background: #ef4444; }
.kpi-card-modern.c-net::before { background: #8b5cf6; }

.kpi-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.kpi-title-sub {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.kpi-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.badge-balance { background: #eff6ff; color: #3b82f6; }
.badge-blocked { background: #fffbeb; color: #f59e0b; }
.badge-income { background: #ecfdf5; color: #10b981; }
.badge-expense { background: #fef2f2; color: #ef4444; }
.badge-net { background: #f5f3ff; color: #8b5cf6; }

.kpi-main-val {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 6px;
}

.kpi-footnote {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Tabs inside panel */
.panel-tabs .nav-link {
    font-weight: 600;
    color: #64748b;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
}

.panel-tabs .nav-link.active {
    color: #3b82f6;
    background: #eff6ff;
}

/* Print */
@media print {
    .sidebar, .top-bar, .sidebar-overlay, .quick-action-bar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { padding: 0 !important; }
    .panel { box-shadow: none; border: 1px solid #ddd; }
}
