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

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary-color: #004e89;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

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

.nav-item {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 107, 53, 0.2);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

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

.nav-label {
    flex: 1;
}

.nav-group {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-group-label {
    padding: 0.5rem 1.25rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
}
.nav-item-sub {
    padding: 0.6rem 1.25rem 0.6rem 2.5rem;
    font-size: 0.9rem;
}
.nav-item-sub .nav-icon {
    font-size: 1.1rem;
    width: 20px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.sidebar-logout:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
}

.sidebar-logout .icon {
    font-size: 1.1rem;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-filters input,
.header-filters select,
.header .header-filters input,
.header .header-filters select {
    padding: 0.5rem 0.75rem !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
    min-width: 120px !important;
}

.header-filters input::placeholder,
.header .header-filters input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.header-filters input:focus,
.header-filters select:focus,
.header .header-filters input:focus,
.header .header-filters select:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1) !important;
}

.header-filters select,
.header .header-filters select {
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    padding-right: 2.5rem !important;
}

.header-filters .btn,
.header .header-filters .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    color: white !important;
    font-weight: 500 !important;
}


/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    overflow-x: hidden;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid #e7edf5;
    padding: 1.5rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e7edf5;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

/* Table wrap: desktop overflow */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    position: relative;
    border-radius: 8px;
}

.table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to left, var(--card-bg), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-wrap.scrollable::after {
    opacity: 1;
}

/* Responsive list: mobile cards vs desktop table */
.list-responsive {
    width: 100%;
}

.list-mobile-only {
    display: none;
}

.list-desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .list-mobile-only {
        display: block;
    }
    .list-desktop-only {
        display: none;
    }
}

/* Mobile card list (< 768px) */
.list-cards-mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.list-card-grid {
    display: grid;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.list-card-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.list-card-label {
    font-size: 0.75rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.list-card-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
    word-break: break-word;
}

.list-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.list-card-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--card-bg);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.list-card-btn:hover {
    background: var(--bg-color);
    border-color: var(--text-secondary);
}

.list-card-btn.btn-edit,
.list-card-btn.btn-primary {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #0d47a1;
}

.list-card-btn.btn-danger {
    background: #ffebee;
    border-color: #e53935;
    color: #b71c1c;
}

.list-card-btn.btn-success {
    background: #e8f5e9;
    border-color: #43a047;
    color: #1b5e20;
}

.list-card-btn.btn-warning {
    background: #fff3e0;
    border-color: #fb8c00;
    color: #e65100;
}

.list-cards-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.dashboard-period {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-toggle-amounts {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.btn-toggle-amounts:hover {
    background: var(--border-color);
    border-color: var(--text-secondary);
}

.dashboard-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

.dashboard-kpi-layout {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.dashboard-kpi-section {
    background: #f8fafc;
    border: 1px solid #e7edf5;
    border-radius: 12px;
    padding: 0.75rem;
}

.dashboard-kpi-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0 0 0.5rem 0.15rem;
}

.kpi-grid.kpi-grid-compact {
    margin-bottom: 0;
}

.dashboard-kpi-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.dashboard-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-insight-card,
.dashboard-priority-card {
    border-radius: 12px;
    overflow: hidden;
}

.cashflow-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.cashflow-tag-in { background: #e8f5e9; color: #2e7d32; }
.cashflow-tag-out { background: #ffebee; color: #c62828; }

.alert-level {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.alert-level-medium { background: #fff3e0; color: #e65100; }
.alert-level-high { background: #fbe9e7; color: #d84315; }
.alert-level-critical { background: #ffebee; color: #b71c1c; }

.alert-action-status {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.alert-action-status-new { background: #eceff1; color: #455a64; }
.alert-action-status-tracked { background: #e8f5e9; color: #2e7d32; }
.alert-action-status-snoozed { background: #e3f2fd; color: #1565c0; }

.alert-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.risk-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
}

.risk-score.risk-low { background: #fff8e1; color: #8d6e63; }
.risk-score.risk-medium { background: #fff3e0; color: #ef6c00; }
.risk-score.risk-high { background: #ffebee; color: #c62828; }

.payment-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.payment-modal-info {
    margin-bottom: 0.8rem;
    padding: 0.7rem;
    border: 1px solid #e7edf5;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-primary);
}

.payment-modal-actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

#vePaymentModal.open {
    display: flex;
}

.kpi-pill {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #e7edf5;
    background: #fff;
}

.kpi-pill-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 600;
}

.kpi-pill-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-pill-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Dashboard list cards – modernized overdue, collections, payments */
.dashboard-list-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dashboard-list-card .dashboard-list-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.dashboard-list-card .dashboard-list-icon {
    font-size: 1.5rem;
    line-height: 1;
}
.dashboard-list-card .card-title {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.dashboard-list-card .card-badge-count {
    background: var(--text-secondary);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}
.dashboard-list-overdue .dashboard-list-card-header { border-left: 4px solid var(--warning-color); }
.dashboard-list-collections .dashboard-list-card-header { border-left: 4px solid var(--success-color); }
.dashboard-list-payments .dashboard-list-card-header { border-left: 4px solid var(--info-color); }

.dashboard-list-card .table-wrap {
    border-radius: 0 0 12px 12px;
}
.dashboard-list-card .list-responsive {
    padding-bottom: 1rem;
}
.dashboard-list-card .table-dashboard {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.dashboard-list-card .table-dashboard thead th {
    background: #f8f9fa;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}
.dashboard-list-card .table-dashboard tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}
.dashboard-list-card .table-dashboard tbody tr:hover {
    background: #f8f9fa;
}
.dashboard-list-card .table-dashboard tbody tr:last-child {
    border-bottom: none;
}
.dashboard-list-card .table-dashboard td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    text-overflow: unset;
}
.dashboard-list-card .table-dashboard td[data-currency] {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}
.dashboard-list-card .table-dashboard .table-actions {
    text-align: right;
    white-space: nowrap;
    padding-right: 1rem;
}
.dashboard-list-card .list-cards-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
    margin: 0 -1.5rem -1.5rem;
}
.dashboard-list-card .list-card {
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.dashboard-list-card .list-card-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}
.dashboard-list-card .list-card-value {
    font-size: 1rem;
    font-weight: 600;
}
.dashboard-list-card .list-card-value[data-currency] {
    color: var(--primary-color);
}

/* Geciken Ödemeler table – column widths */
.card-overdue .table-dashboard.table-overdue { min-width: 0; width: 100%; table-layout: fixed; }
.card-overdue .table-dashboard.table-overdue th:nth-child(1),
.card-overdue .table-dashboard.table-overdue td:nth-child(1) { width: 34%; }
.card-overdue .table-dashboard.table-overdue th:nth-child(2),
.card-overdue .table-dashboard.table-overdue td:nth-child(2) { width: 24%; }
.card-overdue .table-dashboard.table-overdue th:nth-child(3),
.card-overdue .table-dashboard.table-overdue td:nth-child(3) { width: 13%; }
.card-overdue .table-dashboard.table-overdue th:nth-child(4),
.card-overdue .table-dashboard.table-overdue td:nth-child(4) { width: 13%; }
.card-overdue .table-dashboard.table-overdue th:nth-child(5),
.card-overdue .table-dashboard.table-overdue td:nth-child(5) { width: 16%; white-space: nowrap; }

/* Category badge in dashboard tables */
.dashboard-list-card .category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e8e8e8;
    color: var(--text-primary);
}
.dashboard-list-card .category-badge.category-kredi-kartı-taksiti { background: #e3f2fd; color: #1565c0; }
.dashboard-list-card .category-badge.category-sabit-gider { background: #fff3e0; color: #e65100; }
.dashboard-list-card .category-badge.category-personel { background: #f3e5f5; color: #6a1b9a; }
.dashboard-list-card .category-badge.category-proje-masrafı { background: #e8f5e9; color: #2e7d32; }
.dashboard-list-card .overdue-days {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: #fff3e0;
    color: #e65100;
    font-weight: 700;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s ease;
}

.kpi-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.kpi-card.success {
    border-left-color: var(--success-color);
}

.kpi-card.danger {
    border-left-color: var(--danger-color);
}

.kpi-card.warning {
    border-left-color: var(--warning-color);
}

.kpi-card.overdue-kpi {
    border-left-color: #e65100;
}
.kpi-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.cashflow-calculator {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.cashflow-calculator .card-title {
    margin: 0;
}

.cashflow-calculator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.cashflow-calculator-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.cashflow-calculator-header:focus {
    outline: none;
}

.cashflow-calculator-toggle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cashflow-calculator-body {
    padding: 0 1.5rem 1.5rem;
}

.cashflow-calculator.cashflow-calculator-collapsed .cashflow-calculator-body {
    display: none;
}

.cashflow-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cashflow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cashflow-row:last-of-type {
    border-bottom: none;
}

.cashflow-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cashflow-value {
    font-weight: 600;
    font-size: 1rem;
}

.cashflow-summary {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border-color);
    font-weight: 600;
}

.cashflow-warning {
    color: var(--danger-color);
    background: rgba(244, 67, 54, 0.08);
    padding: 0.75rem;
    border-radius: 6px;
    border-top-color: var(--danger-color);
}

.cashflow-ok {
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.08);
    padding: 0.75rem;
    border-radius: 6px;
    border-top-color: var(--success-color);
}

.kpi-card.info {
    border-left-color: var(--info-color);
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.amount-value.hidden {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.2em;
}

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

.summary-item {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 3px solid var(--warning-color);
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.summary-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Detail panel (Proje Geliri Detayı) - Popup Modal */
.detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.detail-panel.open {
    display: flex;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.detail-content {
    position: relative;
    max-width: 720px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.detail-header {
    display: none;
}

.detail-panel.open {
    display: block;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.detail-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.detail-body {
    font-size: 0.95rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

.detail-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d5deea;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    background: #fbfdff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: #fff;
}

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

/* Project revenue entry form */
.revenue-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.revenue-form-header {
    padding: 0.85rem 1rem;
    border: 1px solid #e7edf5;
    border-radius: 10px;
    background: linear-gradient(120deg, #f8fbff 0%, #f8faff 60%, #fff8f4 100%);
}

.revenue-form-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #334155;
}

.revenue-form-subtitle {
    margin-top: 0.18rem;
    font-size: 0.82rem;
    color: #64748b;
}

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

.revenue-form-grid-finance {
    padding: 0.75rem;
    border: 1px solid #e8edf6;
    border-radius: 10px;
    background: #fcfdff;
}

.revenue-inline-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.revenue-customer-wrap {
    position: relative;
}

.revenue-customer-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 220px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid #d5deea;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    z-index: 70;
    display: none;
}

.revenue-customer-dropdown.revenue-dropdown-open {
    display: block;
}

.revenue-customer-option {
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    color: #334155;
    font-size: 0.9rem;
}

.revenue-customer-option:hover {
    background: #eff6ff;
    color: #1e3a8a;
}

.revenue-inline-btn {
    width: auto;
    min-height: 38px;
    padding: 0.45rem 0.65rem;
    background: #eef4ff;
    border: 1px solid #cfe0fa;
    color: #1d4ed8;
}

.revenue-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.revenue-quick-btn {
    border: 1px solid #d5e2f4;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    padding: 0.28rem 0.62rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.revenue-quick-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.revenue-calc-card {
    margin-bottom: 0;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid #e7edf5;
    background: #f8fafc;
}

.revenue-calc-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.35rem;
}

.revenue-calc-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    color: #334155;
    font-size: 0.9rem;
}

.revenue-advance-card {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid #cfe3ff;
    background: #f0f7ff;
}

.revenue-advance-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.revenue-advance-toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.revenue-advance-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 0.7rem;
}

.revenue-advance-fields .form-group {
    flex: 1;
    min-width: 170px;
    margin-bottom: 0;
}

.revenue-help-text {
    color: #64748b;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.25rem;
}

.revenue-warning-card {
    margin-bottom: 0;
    padding: 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
}

.revenue-form-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.revenue-form-actions .btn {
    width: auto;
    min-width: 120px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #d5deea;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    background: #f3f6fb;
    color: #334155;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #f97316 100%);
    border-color: #f97316;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-weight: 500;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white !important;
}

.header .btn-secondary {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
}

.header .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
    border-color: #f59e0b;
    color: #1f2937;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #111827;
}

.btn-sm {
    padding: 0.42rem 0.7rem;
    font-size: 0.84rem;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
}

.btn-sm.btn-icon {
    padding: 0;
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 1rem;
}

.btn-edit {
    background: var(--info-color);
    color: white;
    border: none;
}

.btn-edit:hover {
    background: #1976d2;
    color: white;
}

.status-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.status-toggle:hover {
    background: #eee;
    opacity: 0.9;
}

/* Tables */
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    border-radius: 8px;
}

/* Scroll indicator */
.table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to left, var(--card-bg), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-container.scrollable::after {
    opacity: 1;
}

table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    font-size: 0.9rem;
    min-width: 100%;
}

table thead {
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 0.85rem;
    line-height: 1.5;
}

table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: left;
}

/* Text overflow handling */
table td:not(.table-actions):not([data-currency]) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobilde uzun metinler için word-break */
@media (max-width: 768px) {
    table td:not(.table-actions):not([data-currency]) {
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }
}

table td.table-actions {
    white-space: nowrap;
    width: 1%;
    padding: 0.5rem;
}

/* Sabit Gelirler tablosu – hizalama */
.table-fixed-incomes {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.table-fixed-incomes th,
.table-fixed-incomes td {
    padding: 0.65rem 0.6rem;
    vertical-align: middle;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
}

.table-fixed-incomes thead th {
    border-bottom: 2px solid var(--border-color);
}

.table-fixed-incomes th {
    text-align: left;
    font-weight: 600;
}

.table-fixed-incomes td {
    text-align: left;
}

.table-fixed-incomes th.table-actions,
.table-fixed-incomes td.table-actions {
    text-align: right;
    padding-right: 0.75rem;
}

.table-fixed-incomes td.table-actions {
    white-space: nowrap;
}

.table-fixed-incomes .action-buttons {
    justify-content: flex-end;
}

.table-fixed-incomes th[data-currency],
.table-fixed-incomes td[data-currency] {
    text-align: right;
}

.table-fixed-incomes th:nth-child(1),
.table-fixed-incomes th:nth-child(2),
.table-fixed-incomes th:nth-child(3),
.table-fixed-incomes th:nth-child(5),
.table-fixed-incomes td:nth-child(1),
.table-fixed-incomes td:nth-child(2),
.table-fixed-incomes td:nth-child(3),
.table-fixed-incomes td:nth-child(5) {
    min-width: 0;
    max-width: none;
}

.table-fixed-incomes td:nth-child(5) {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

/* Sabit Giderler tablosu – hizalama (Personel + Diğer) */
.table-fixed-expenses {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.table-fixed-expenses th,
.table-fixed-expenses td {
    padding: 0.65rem 0.6rem;
    vertical-align: middle;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
}

.table-fixed-expenses thead th {
    border-bottom: 2px solid var(--border-color);
}

.table-fixed-expenses th {
    text-align: left;
    font-weight: 600;
}

.table-fixed-expenses td {
    text-align: left;
}

.table-fixed-expenses th.th-odeme,
.table-fixed-expenses td.td-odeme {
    text-align: center;
}

.table-fixed-expenses td.td-odeme {
    overflow: visible;
}

.table-fixed-expenses th.table-actions,
.table-fixed-expenses td.table-actions {
    text-align: right;
    padding-right: 0.75rem;
}

.table-fixed-expenses td.table-actions {
    white-space: nowrap;
}

.table-fixed-expenses .action-buttons {
    justify-content: flex-end;
}

.table-fixed-expenses th[data-currency],
.table-fixed-expenses td[data-currency] {
    text-align: right;
}

.table-fixed-expenses th:nth-child(1),
.table-fixed-expenses td:nth-child(1),
.table-fixed-expenses th:nth-child(2),
.table-fixed-expenses td:nth-child(2),
.table-fixed-expenses th:nth-child(3),
.table-fixed-expenses td:nth-child(3),
.table-fixed-expenses th:nth-child(4),
.table-fixed-expenses td:nth-child(4),
.table-fixed-expenses th:nth-child(5),
.table-fixed-expenses td:nth-child(5),
.table-fixed-expenses th:nth-child(6),
.table-fixed-expenses td:nth-child(6),
.table-fixed-expenses th:nth-child(7),
.table-fixed-expenses td:nth-child(7),
.table-fixed-expenses th:nth-child(8),
.table-fixed-expenses td:nth-child(8) {
    min-width: 0;
    max-width: none;
}

/* Personel tablosu – Ödeme/İşlemler sütunları geniş, butonlar iç içe geçmesin */
.table-fixed-expenses-personel {
    min-width: 680px;
}

.table-fixed-expenses-personel th.th-odeme,
.table-fixed-expenses-personel td.td-odeme {
    min-width: 52px;
    width: 14%;
}

.table-fixed-expenses-personel th.table-actions,
.table-fixed-expenses-personel td.table-actions {
    min-width: 120px;
    width: 24%;
    padding-left: 0.5rem;
    padding-right: 0.75rem;
}

.table-fixed-expenses-personel .action-buttons {
    gap: 0.4rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.table-fixed-expenses-personel .action-btn {
    flex-shrink: 0;
}

.table-fixed-expenses-personel td.td-odeme {
    text-align: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.table-fixed-expenses-personel th.th-odeme,
.table-fixed-expenses-personel th.table-actions {
    white-space: nowrap;
}

/* Sabit gelir tablosu aksiyon butonu */
.table-fixed-incomes .btn-primary {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.table-fixed-incomes .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

table tbody tr:hover {
    background: var(--bg-color);
}

/* Responsive column widths */
table th:nth-child(1),
table td:nth-child(1) {
    min-width: 100px;
    max-width: 120px;
}

table th:nth-child(2),
table td:nth-child(2) {
    min-width: 120px;
    max-width: 180px;
}

table th:nth-child(3),
table td:nth-child(3) {
    min-width: 150px;
    max-width: 250px;
}

/* Currency columns */
table td[data-currency] {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table th[data-currency] {
    text-align: right;
}

/* Para birimi sütunları için th */
table th:nth-child(4):not(.table-actions),
table th:nth-child(5):not(.table-actions),
table th:nth-child(6):not(.table-actions) {
    text-align: right;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--bg-color);
    color: var(--text-primary);
}

.category-reklam {
    background: #fff3e0;
    color: #e65100;
}

.category-nakliye {
    background: #e3f2fd;
    color: #1565c0;
}

.category-bakım {
    background: #f3e5f5;
    color: #6a1b9a;
}

.category-other {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.category-kredi-kartı-taksiti {
    background: #e3f2fd;
    color: #1565c0;
}

.category-kredi-kartı-ödemesi {
    background: #fff3e0;
    color: #e65100;
}

.category-proje-masrafı {
    background: #fce4ec;
    color: #c2185b;
}

/* Kredi Kartı Özeti - Desktop Tablo */
.card-summary-desktop {
    width: 100%;
    overflow-x: auto;
}

.card-summary-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.card-summary-table th {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    background: #f5f5f5;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.card-summary-table th[style*="text-align: right"] {
    text-align: right;
}

.card-summary-table th small {
    display: block;
    font-size: 0.7rem;
    font-weight: normal;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.2;
}

.card-summary-table td {
    white-space: normal;
    word-wrap: break-word;
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.card-summary-table tbody tr:hover {
    background: #f9f9f9;
}

/* Kredi Kartı Özeti - Mobil Kart Görünümü */
.card-summary-mobile {
    display: none;
}

@media (min-width: 769px) {
    .card-summary-mobile {
        display: none !important;
    }
    
    .card-summary-desktop {
        display: block !important;
    }
}

.card-summary-item,
.card-summary-total {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-summary-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
}

.card-summary-total .card-summary-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card-summary-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-summary-body {
    padding: 1rem;
}

.card-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.card-summary-row:last-child {
    border-bottom: none;
}

.card-summary-row.card-summary-warning {
    background: #fff3e0;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 4px;
}

.card-summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex: 1;
}

.card-summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

@media (max-width: 768px) {
    .card-summary-desktop {
        display: none !important;
    }
    
    .card-summary-mobile {
        display: block !important;
        width: 100%;
    }
    
    .show-mobile-only {
        display: block !important;
    }
    
    .hide-mobile {
        display: none !important;
    }
    
    /* Table cell için özel */
    table .show-mobile-only {
        display: table-cell !important;
    }
}

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

/* Minimal action buttons (icon only) */
.action-buttons {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

/* Masaüstü: ikon butonları için kompakt İşlemler sütunu, sayfa taşmasın */
table th.table-actions,
table td.table-actions {
    width: 120px;
    max-width: 120px;
    box-sizing: border-box;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    background: transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    opacity: 0.9;
}

.action-btn:active {
    opacity: 0.8;
}

/* Success (Alındı) */
.action-btn-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.action-btn-success:hover {
    background: #c8e6c9;
}

/* Warning (Geri Al) */
.action-btn-warning {
    background: #fff3e0;
    color: #e65100;
}

.action-btn-warning:hover {
    background: #ffe0b2;
}

/* Edit */
.action-btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.action-btn-edit:hover {
    background: #bbdefb;
}

/* Danger (Sil) */
.action-btn-danger {
    background: #ffebee;
    color: #c62828;
}

.action-btn-danger:hover {
    background: #ffcdd2;
}

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

.stat-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid var(--success-color);
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--danger-color);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Sidebar Overlay Backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    /* Sidebar Mobil Stilleri */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* Main Wrapper Mobil */
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Menu Toggle Butonu */
    .menu-toggle {
        display: flex;
    }

    /* Header Mobil Stilleri */
    .header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-title {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .header-title h2 {
        font-size: 1.25rem;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .header-filters {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0;
    }

    .header-filters input,
    .header-filters select,
    .header .header-filters input,
    .header .header-filters select {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        font-size: 0.8rem !important;
        padding: 0.5rem !important;
    }

    /* Main Content Mobil */
    .main-content {
        padding: 1rem;
    }

    /* Form Stilleri Mobil */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .revenue-form-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .revenue-form-header {
        padding: 0.75rem 0.8rem;
    }

    .revenue-inline-input {
        flex-direction: column;
        align-items: stretch;
    }

    .revenue-inline-btn {
        width: 100%;
    }

    .revenue-quick-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .revenue-quick-btn {
        width: 100%;
        text-align: center;
        padding: 0.42rem 0.25rem;
        font-size: 0.74rem;
    }

    .revenue-calc-values {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .revenue-advance-card {
        padding: 0.75rem 0.8rem;
    }

    .revenue-advance-fields .form-group {
        min-width: 100%;
    }

    .revenue-form-actions {
        flex-direction: column;
    }

    .revenue-form-actions .btn {
        width: 100%;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 16px; /* iOS zoom önleme */
    }

    /* Butonlar Mobil */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        min-height: 44px;
        width: 100%;
    }

    .btn-sm {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }

    .table-actions {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .action-buttons {
        gap: 0.4rem;
    }

    .action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .status-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* KPI Grid Mobil */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .kpi-card {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 1.35rem;
    }

    /* Dashboard Mobil Stilleri */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .dashboard-title {
        font-size: 1.25rem;
    }

    .dashboard-period {
        font-size: 0.8rem;
    }

    .dashboard-tables {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-kpi-section {
        padding: 0.65rem;
    }

    .dashboard-kpi-section-title {
        font-size: 0.75rem;
    }

    .dashboard-kpi-secondary {
        grid-template-columns: 1fr;
    }

    .dashboard-insights-grid {
        grid-template-columns: 1fr;
    }

    .cashflow-calculator {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        margin-bottom: 1.5rem;
    }

    /* Tablolar Mobil – yatay kaydırma, üst üste binme önleme */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        width: 100%;
        max-width: 100%;
    }

    table {
        min-width: 100%;
        font-size: 0.8rem;
        table-layout: fixed;
    }

    /* Sabit gelirler / sabit giderler: dar ekranda yatay scroll, üst üste binme yok */
    .table-fixed-incomes {
        min-width: 400px;
    }

    /* Sabit gelirler: mobilde butonlar alt alta, min-width yeterli */
    .table-fixed-incomes th.table-actions,
    .table-fixed-incomes td.table-actions {
        min-width: 56px !important;
    }

    /* Durum sütunu (Alındı/Beklemede + tarih) sıkışmasın */
    .table-fixed-incomes td:nth-child(5) {
        max-width: none !important;
        min-width: 80px !important;
    }

    .table-fixed-expenses {
        min-width: 420px;
    }

    .table-fixed-expenses-personel {
        min-width: 680px;
    }

    table th,
    table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    table th {
        font-size: 0.75rem;
        padding: 0.625rem 0.5rem;
        line-height: 1.5;
    }

    /* Ödeme + İşlemler sütunları */
    table th.th-odeme,
    table td.td-odeme {
        min-width: 52px !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* İşlemler: mobilde butonlar alt alta, sütun dar */
    table th.table-actions,
    table td.table-actions {
        min-width: 56px !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Mobilde aksiyon butonları alt alta – iç içe geçme olmaz */
    table td.table-actions .action-buttons {
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0.35rem !important;
        flex-wrap: nowrap !important;
    }

    table td.table-actions .action-btn {
        flex-shrink: 0 !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1.1rem !important;
    }

    /* Tutar sütunu: taşma olmasın, İşlemlere yapışmasın */
    table td[data-currency] {
        padding-right: 0.5rem !important;
        white-space: nowrap;
    }

    /* Hide mobile class - mobilde gizle */
    .hide-mobile {
        display: none !important;
    }
    
    /* Show mobile only - sadece mobilde göster */
    .show-mobile-only {
        display: block !important;
    }
    
    /* Table cell için özel */
    .show-mobile-only[class*="table"],
    table .show-mobile-only {
        display: table-cell !important;
    }
    
    /* Colgroup için de aynı kurallar */
    col.hide-mobile {
        display: none !important;
    }
    
    col.show-mobile-only {
        display: table-column !important;
    }

    /* Text overflow – Tutar sütunu hariç; İşlemler yanındaki sütunlar sıkışmasın */
    table td:not(.table-actions):not(.td-odeme) {
        max-width: 140px;
    }

    /* İşlemler sütunu her zaman görünür */
    table th.table-actions,
    table td.table-actions {
        display: table-cell !important;
        position: sticky;
        right: 0;
        background: var(--card-bg);
        z-index: 5;
        box-shadow: -2px 0 4px rgba(0,0,0,0.05);
    }
    
    table td.table-actions {
        white-space: normal;
        padding: 0.5rem;
    }
    
    table td.table-actions .action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .table-fixed-incomes td.table-actions {
        white-space: nowrap;
    }
    
    .table-fixed-incomes tr:nth-child(even) td.table-actions {
        background: rgba(0, 0, 0, 0.02);
    }
    
    .table-fixed-incomes tr:hover td.table-actions {
        background: var(--bg-color);
    }
    
    .table-fixed-expenses td.table-actions {
        white-space: nowrap;
    }
    
    .table-fixed-expenses tr:nth-child(even) td.table-actions {
        background: rgba(0, 0, 0, 0.02);
    }
    
    .table-fixed-expenses tr:hover td.table-actions {
        background: var(--bg-color);
    }
    
    .table-fixed-expenses-personel td:not(.table-actions) {
        max-width: none;
    }

    /* Hide mobile class - desktop'ta göster */
    .hide-mobile {
        display: table-cell;
    }
    
    /* Show mobile only - desktop'ta gizle */
    .show-mobile-only {
        display: none !important;
    }
    
    /* Colgroup için de aynı kurallar */
    col.hide-mobile {
        display: table-column !important;
    }
    
    col.show-mobile-only {
        display: none !important;
    }

    /* Card Stilleri Mobil */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding-bottom: 0.75rem;
    }

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

    /* Stats Grid Mobil */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Login Mobil */
    .login-box {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    /* Sidebar Mobil İyileştirmeleri */
    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-header h1 {
        font-size: 1.25rem;
    }

    .nav-item {
        padding: 1rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar-logout {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

/* Küçük Ekranlar (480px ve altı) */
@media (max-width: 480px) {
    .header {
        padding: 0.625rem 0.75rem;
    }

    .header-title h2 {
        font-size: 1.1rem;
    }

    .header-filters input,
    .header-filters select,
    .header .header-filters input,
    .header .header-filters select {
        min-width: 100%;
        font-size: 0.75rem !important;
    }

    .main-content {
        padding: 0.75rem;
    }

    .card {
        padding: 0.875rem;
    }

    .dashboard-title {
        font-size: 1.1rem;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    table {
        font-size: 0.75rem;
        table-layout: fixed;
    }

    table th,
    table td {
        padding: 0.45rem 0.3rem;
        font-size: 0.75rem;
        line-height: 1.3;
    }

    table th {
        font-size: 0.7rem;
        padding: 0.5rem 0.3rem;
        line-height: 1.4;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Müşteri Paneli ---- */
.customer-panel { margin-bottom: 1.5rem; }
.customer-panel-card { max-width: 100%; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.customer-panel-empty { text-align: center; padding: 2rem; color: var(--text-secondary); }
.customer-panel-empty .btn { margin-top: 1rem; }
.customer-panel-filters { padding: 1rem 1.1rem; background: #f8fafc; border-radius: 12px; margin-bottom: 1rem; border: 1px solid #e9eef5; box-shadow: inset 0 1px 0 rgba(255,255,255,0.6); }
.customer-panel-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.customer-panel-filter-row label { min-width: 5rem; font-weight: 600; color: #6b7280; font-size: 0.86rem; letter-spacing: 0.01em; }
.customer-panel-filters .btn { width: auto; min-height: 38px; }
.cp-select { padding: 0.5rem 0.75rem; border: 1px solid #d8e0ea; border-radius: 8px; min-width: 160px; background: #fff; }
.cp-select:focus { outline: none; border-color: #ffb190; box-shadow: 0 0 0 3px rgba(255,107,53,0.15); }
.cp-input-search { min-width: 240px; }
.cp-combobox-wrap { position: relative; display: inline-block; }
.cp-customer-dropdown { position: absolute; left: 0; top: 100%; margin-top: 2px; min-width: 100%; max-height: 220px; overflow-y: auto; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 100; display: none; }
.cp-customer-dropdown.cp-dropdown-open { display: block; }
.cp-customer-option { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.9rem; white-space: nowrap; }
.cp-customer-option:hover { background: #f0f0f0; }
.cp-date { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; }
.cp-date-sep { margin: 0 0.25rem; color: var(--text-secondary); }
.customer-panel-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.customer-panel-quick .btn-sm { padding: 0.45rem 0.85rem; font-size: 0.84rem; border-radius: 8px; background: #fff; border: 1px solid #d8e0ea; color: #374151; }
.customer-panel-quick .btn-sm:hover { background: #fff7f2; border-color: #ffc7ad; }
.customer-panel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.customer-panel-kpi { background: #fff; padding: 0.9rem 1rem; border-radius: 10px; border: 1px solid #e9eef5; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.customer-panel-kpi-label { display: block; font-size: 0.78rem; color: #6b7280; margin-bottom: 0.3rem; }
.customer-panel-kpi-value { font-size: 1.2rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; }
.customer-panel-kpi-value.kpi-received { color: var(--success-color); }
.customer-panel-kpi-value.kpi-pending { color: var(--warning-color); }
.customer-panel-kpi-value.kpi-risk-score { color: #c62828; }
.customer-panel-summary-strip { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin: 0 0 1rem; padding: 0.75rem 1rem; background: #f8fafc; border: 1px solid #e9eef5; border-radius: 10px; color: var(--text-secondary); font-size: 0.9rem; }
.customer-panel-summary-strip strong { color: var(--text-primary); font-weight: 600; }
.customer-panel-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.customer-panel-chart-wrap { position: relative; height: 280px; background: #fff; border-radius: 10px; padding: 1rem; border: 1px solid #e9eef5; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.customer-panel-chart-donut { max-width: 320px; }
.customer-panel-chart-empty { margin-bottom: 1.5rem; padding: 1rem 1.25rem; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 0.9rem; }
.customer-panel-table-section { margin-top: 1rem; }
.customer-panel-table-title { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-primary); }
.customer-panel-table-wrap { overflow-x: auto; }
.customer-panel-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.customer-panel-table th, .customer-panel-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.customer-panel-table th.text-right, .customer-panel-table td.text-right { text-align: right; }
.customer-panel-totals { background: #f0f0f0; font-weight: 600; }
.customer-panel-table-empty { padding: 1.5rem; text-align: center; color: var(--text-secondary); }
.customer-panel-paid-months { font-size: 0.85rem; max-width: 280px; word-break: break-word; white-space: normal; }
.customer-panel-paid-months .text-muted { color: var(--text-secondary); }
.status-badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.status-badge.status-received { background: #e8f5e9; color: #2e7d32; }
.status-badge.status-pending { background: #fff3e0; color: #e65100; }
.customer-panel-table-mobile { display: none; }
.customer-panel-table-desktop { display: block; }
/* Geciken Ödemeler */
.card-overdue { margin-bottom: 1.5rem; }
.card-overdue .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.overdue-controls { padding: 0 0 1rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
.overdue-cutoff-info { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.overdue-toggle { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.overdue-toggle-label { font-size: 0.9rem; color: var(--text-secondary); margin-right: 0.25rem; }
.overdue-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.overdue-select { padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9rem; min-width: 120px; }
.overdue-search { padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9rem; min-width: 180px; }
.overdue-days { font-weight: 600; color: var(--warning-color); }
@media (max-width: 767px) {
    .overdue-filters { flex-direction: column; align-items: stretch; }
    .overdue-search { min-width: 100%; }
}
/* Birleşik Müşteri sayfası sekmeleri */
.customers-page { margin-bottom: 1.5rem; }
.customers-page-tabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 2px solid var(--border-color); }
.customers-tab-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; background: #f0f0f0; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: color 0.2s, background 0.2s, border-color 0.2s; }
.customers-tab-btn:hover { background: #e8e8e8; color: var(--text-primary); }
.customers-tab-btn.active { background: var(--card-bg); color: var(--primary-color); border-bottom-color: var(--primary-color); }
.customers-tab-icon { font-size: 1.1rem; }
.customers-tab-pane { display: none; }
.customers-tab-pane.active { display: block; }
/* Yönetici sayfası sekmeleri */
.manager-page { margin-bottom: 1.5rem; }
.manager-page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.manager-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.95rem;
    border-radius: 10px;
    border: 1px solid #dce5f1;
    background: #fff;
    color: #475569;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}
.manager-tab-btn:hover {
    background: #f8fbff;
    border-color: #c9d9eb;
}
.manager-tab-btn.active {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.manager-tab-icon { font-size: 1rem; line-height: 1; }
.manager-page-content { min-height: 180px; }
/* Müşteri adı linki (Proje Gelirleri vb.) */
a.customer-name-link { color: var(--info-color); text-decoration: none; }
a.customer-name-link:hover { text-decoration: underline; }
@media (max-width: 767px) {
    .customer-panel-charts { grid-template-columns: 1fr; }
    .customer-panel-chart-donut { max-width: 100%; }
    .customer-panel-table-desktop { display: none; }
    .customer-panel-table-mobile { display: block; }
    .customer-panel-kpis { grid-template-columns: 1fr 1fr; }
    .customer-panel-filters { padding: 0.85rem; border-radius: 10px; }
    .customer-panel-filter-row { gap: 0.5rem; margin-bottom: 0.65rem; }
    .customer-panel-filter-row label { min-width: auto; width: 100%; margin-bottom: 0.1rem; }
    .cp-combobox-wrap { width: 100%; }
    .cp-select, .cp-input-search, .cp-date { width: 100%; min-width: 0; }
    .cp-date-sep { display: none; }
    .customer-panel-quick { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .customer-panel-quick .btn-sm { width: 100%; text-align: center; }
    .customer-panel-filter-row .btn-primary { width: 100%; }
    .manager-page-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .manager-tab-btn { width: 100%; justify-content: center; font-size: 0.84rem; }
}

/* ---- Dashboard V2 Redesign ---- */
.dashboard-v2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.5rem;
    padding: 0.35rem;
    border-radius: 16px;
    background:
        radial-gradient(1200px 320px at 6% -12%, rgba(186, 230, 253, 0.45), transparent 56%),
        radial-gradient(900px 300px at 95% -8%, rgba(221, 214, 254, 0.42), transparent 52%),
        radial-gradient(780px 260px at 50% -18%, rgba(254, 226, 226, 0.35), transparent 50%),
        #fcfdff;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid #e5ecf4;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.dashboard-hero-main .dashboard-title {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.dashboard-hero-main .dashboard-period {
    margin-top: 0.2rem;
    color: #64748b;
    font-weight: 500;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.42rem 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f0f9ff 0%, #f5f3ff 100%);
    border: 1px solid #dbe7f4;
    color: #334155;
    font-size: 0.82rem;
    white-space: nowrap;
}

.dashboard-hero-chip strong {
    font-weight: 800;
}

.dashboard-hero .btn-toggle-amounts {
    background: #ffffff;
    border-color: #cfdceb;
    color: #334155;
}

.dashboard-hero .btn-toggle-amounts:hover {
    background: #f8fbff;
    border-color: #b7c9df;
}

.dashboard-kpi-layout-v2 .dashboard-kpi-section {
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e7edf5;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.dashboard-kpi-layout-v2 .dashboard-kpi-section:nth-child(1) {
    background: linear-gradient(180deg, #eff8ff 0%, #ffffff 26%);
}

.dashboard-kpi-layout-v2 .dashboard-kpi-section:nth-child(2) {
    background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 26%);
}

.dashboard-kpi-layout-v2 .dashboard-kpi-section:nth-child(3) {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 26%);
}

.dashboard-kpi-layout-v2 .kpi-card {
    border-left: none;
    border: 1px solid #e9eef5;
    border-radius: 12px;
    box-shadow: none;
    background: #ffffff;
}

.dashboard-kpi-layout-v2 .kpi-card:hover {
    transform: translateY(-1px);
}

.dashboard-kpi-layout-v2 .kpi-card.success {
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 80%);
    border-color: #bbf7d0;
}

.dashboard-kpi-layout-v2 .kpi-card.info {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 80%);
    border-color: #bfdbfe;
}

.dashboard-kpi-layout-v2 .kpi-card.warning {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 80%);
    border-color: #fed7aa;
}

.dashboard-kpi-layout-v2 .kpi-card.danger {
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 80%);
    border-color: #fecaca;
}

.dashboard-section-title {
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 0 0.2rem;
}

.dashboard-panel {
    border-radius: 14px;
    border: 1px solid #e7edf5;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.dashboard-panel .card-header {
    background: #fcfdff;
    border-bottom: 1px solid #edf2f7;
}

.dashboard-v2 .dashboard-insight-card:first-child .card-header {
    background: linear-gradient(90deg, #ecfeff 0%, #f0f9ff 100%);
}

.dashboard-v2 .dashboard-insight-card:last-child .card-header {
    background: linear-gradient(90deg, #fff7ed 0%, #fff1f2 100%);
}

.dashboard-v2 .dashboard-priority-card .card-header {
    background: linear-gradient(90deg, #fef2f2 0%, #f5f3ff 100%);
}

.dashboard-v2 .dashboard-list-overdue .dashboard-list-card-header {
    background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 100%);
}

.dashboard-v2 .dashboard-list-collections .dashboard-list-card-header {
    background: linear-gradient(90deg, #ecfdf5 0%, #dcfce7 100%);
}

.dashboard-v2 .dashboard-list-payments .dashboard-list-card-header {
    background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
}

.dashboard-v2 .dashboard-insights-grid {
    gap: 0.9rem;
}

.dashboard-v2 .dashboard-v2-lists {
    gap: 0.9rem;
}

.dashboard-v2 .dashboard-list-card .table-dashboard thead th {
    background: #f8fafc;
}

.dashboard-v2 .dashboard-list-card .table-dashboard td,
.dashboard-v2 .dashboard-list-card .table-dashboard th {
    font-size: 0.86rem;
}

.dashboard-v2 .dashboard-list-card .table-wrap,
.dashboard-v2 .customer-panel-table-wrap,
.dashboard-v2 .card-summary-desktop {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-v2 .cashflow-calculator-body {
    padding-top: 1rem;
}

.dashboard-v2 .cashflow-row {
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e8eef6;
}

.dashboard-v2 .card-badge-count {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.dashboard-v2 .dashboard-list-overdue .table-dashboard tbody tr:hover {
    background: #fff7ed;
}

.dashboard-v2 .dashboard-list-collections .table-dashboard tbody tr:hover {
    background: #f0fdf4;
}

.dashboard-v2 .dashboard-list-payments .table-dashboard tbody tr:hover {
    background: #eff6ff;
}

.dashboard-v2 .overdue-days {
    background: #fff0e6;
    color: #c2410c;
}

@media (max-width: 1024px) {
    .dashboard-v2 .dashboard-tables {
        grid-template-columns: 1fr;
    }

    .dashboard-v2 .dashboard-insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .dashboard-v2 {
        gap: 0.75rem;
        padding: 0.2rem;
    }

    .dashboard-hero {
        padding: 0.85rem;
        border-radius: 12px;
        flex-direction: column;
        align-items: stretch;
        box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
    }

    .dashboard-hero-main .dashboard-title {
        font-size: 1.05rem;
    }

    .dashboard-hero-main .dashboard-period {
        font-size: 0.8rem;
        opacity: 0.95;
    }

    .dashboard-hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .dashboard-hero-chip {
        justify-content: center;
        font-size: 0.78rem;
        width: 100%;
    }

    .dashboard-hero-actions .btn-toggle-amounts {
        width: 100%;
        min-height: 38px;
        font-size: 1rem;
    }

    .dashboard-kpi-layout-v2 .kpi-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .dashboard-kpi-layout-v2 .dashboard-kpi-section {
        padding: 0.7rem;
        border-radius: 12px;
    }

    .dashboard-kpi-layout-v2 .dashboard-kpi-section-title {
        font-size: 0.72rem;
        margin-bottom: 0.45rem;
        color: #526173;
    }

    .dashboard-kpi-layout-v2 .kpi-card {
        padding: 0.9rem;
        border-radius: 11px;
    }

    .dashboard-kpi-layout-v2 .kpi-value {
        font-size: 1.1rem;
    }

    .dashboard-v2 .dashboard-list-card .dashboard-list-card-header {
        padding: 0.8rem 0.9rem;
    }

    .dashboard-v2 .dashboard-list-card .card-title {
        font-size: 1rem;
    }

    .dashboard-v2 .dashboard-panel {
        border-radius: 12px;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
    }

    .dashboard-v2 .dashboard-section-title {
        padding: 0.2rem 0.35rem;
        border-radius: 8px;
        background: #eef4ff;
        color: #3b4a5f;
    }

    .dashboard-v2 .cashflow-calculator-body {
        padding: 0.85rem;
    }

    .dashboard-v2 .cashflow-results {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .dashboard-v2 .cashflow-row {
        padding: 0.62rem 0.65rem;
    }

    .dashboard-v2 .cashflow-value {
        font-size: 0.95rem;
        font-weight: 700;
    }

    .dashboard-v2 .dashboard-list-card .list-card {
        border-radius: 12px;
        border-width: 1px;
        background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    }

    .dashboard-v2 .dashboard-list-overdue .list-card {
        border-color: #fed7aa;
    }

    .dashboard-v2 .dashboard-list-collections .list-card {
        border-color: #bbf7d0;
    }

    .dashboard-v2 .dashboard-list-payments .list-card {
        border-color: #bfdbfe;
    }

    .dashboard-v2 .overdue-controls {
        padding-bottom: 0.75rem;
    }

    .dashboard-v2 .overdue-cutoff-info {
        font-size: 0.78rem;
        background: #fff7ed;
        border: 1px solid #fed7aa;
        border-radius: 8px;
        padding: 0.45rem 0.55rem;
    }

    .dashboard-v2 .overdue-select,
    .dashboard-v2 .overdue-search {
        min-height: 38px;
        border-radius: 9px;
        background: #fff;
    }

    .dashboard-v2 .table-dashboard td[data-currency] {
        font-size: 0.92rem;
        color: #0f172a;
    }

    .dashboard-v2 .alert-level,
    .dashboard-v2 .alert-action-status {
        font-size: 0.68rem;
        padding: 0.16rem 0.42rem;
    }

    .dashboard-v2 .alert-actions {
        width: 100%;
    }

    .dashboard-v2 .alert-actions .btn {
        flex: 1;
        min-width: 90px;
        padding: 0.38rem 0.45rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 420px) {
    .dashboard-hero-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-v2 .dashboard-list-card .dashboard-list-card-header {
        gap: 0.5rem;
    }

    .dashboard-v2 .dashboard-list-card .card-title {
        font-size: 0.95rem;
    }

    .dashboard-v2 .dashboard-list-card .card-badge-count {
        font-size: 0.72rem;
    }

    .revenue-quick-row {
        grid-template-columns: 1fr 1fr;
    }
}
