/* =====================================================
   VADELİ SATIŞ & TAHSİLAT ERP/CRM SİSTEMİ
   Stil Dosyası
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Responsive: convert aging table to card list on small screens */
@media (max-width: 767.98px) {
    .aging-table thead {
        display: none;
    }
    .aging-table, .aging-table tbody, .aging-table tr, .aging-table td {
        display: block;
        width: 100%;
    }
    .aging-table tr {
        margin-bottom: 0.35rem;
        border: 1px solid #e9ecef;
        border-radius: .3125rem;
        padding: .35rem;
        background: #fff;
    }
    /* Compact grid: label left column, value right column on same line */
    .aging-table td {
        padding: .2rem .35rem;
        border: none;
        display: grid;
        grid-template-columns: 35% 1fr;
        align-items: center;
        gap: .5rem;
        font-size: .95rem;
    }
    .aging-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
        text-align: left;
        font-size: .85rem;
        padding-right: .25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* value cell (actual content) sits in second grid column and is right-aligned for numbers */
    .aging-table td[data-currency="true"] {
        grid-column: 2 / 3;
        justify-self: end;
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
    }
    .aging-table td:not([data-currency="true"]) {
        grid-column: 2 / 3;
        justify-self: start;
        text-align: left;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    /* Make Firma Adı more readable: allow wrapping, hide the label before, and neutralize colors */
    .aging-table td[data-label="Firma Adı"] {
        display: block;
        grid-template-columns: none;
        padding: .2rem .35rem;
        text-align: left;
        font-weight: 700;
        white-space: normal; /* allow wrap */
        overflow-wrap: anywhere;
        color: #111;
    }
    .aging-table td[data-label="Firma Adı"]::before {
        display: none;
    }
    /* Ensure table text uses neutral color on mobile to avoid noisy coloring */
    .aging-table,
    .aging-table td {
        color: #222;
    }
    .d-flex.flex-column.flex-sm-row .btn {
        width: 100%;
    }
    /* allow table container to shrink so values don't force horizontal scroll */
    .table-responsive .aging-table {
        min-width: 0 !important;
    }
}

/* Improve export button visibility in report headers */
.card-header .btn {
    min-width: 120px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Aging table desktop polish */
.aging-table thead th {
    background-color: #345c5e;
    color: #fff;
    border-color: #2b4b4d;
}
.aging-table tbody tr:hover {
    background-color: #f1f7f7;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --background-color: #f5f7fa;
    --surface-color: #ffffff;
    --text-color: #333333;
    --muted-color: #6c757d;
    --navbar-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --sidebar-bg: #ffffff;
    --sidebar-border: #e9ecef;
    --content-bg: #f5f7fa;
    --footer-bg: #f8f9fa;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

body.dark-theme {
    --primary-color: #0f172a;
    --secondary-color: #3b82f6;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-color: #e2e8f0;
    --dark-color: #0f172a;
    --background-color: #0f172a;
    --surface-color: #111827;
    --text-color: #e2e8f0;
    --muted-color: #94a3b8;
    --navbar-bg: #111827;
    --sidebar-bg: #111827;
    --sidebar-border: #334155;
    --content-bg: #0f172a;
    --footer-bg: #020617;
}

/* ===== NAVİGASYON ===== */
.navbar {
    background: var(--navbar-bg);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-nav {
    display: flex;
    gap: 0;
    list-style: none;
}

.navbar-nav .nav-item {
    position: relative;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: block;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white;
    background: rgba(0, 0, 0, 0.1);
}

.navbar-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-right .user-info {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-right .btn {
    padding: 0.5rem 1rem;
}

#sidebarToggle {
    display: none;
    border: 1px solid rgba(255,255,255,0.65);
    color: white;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.sidebar-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

/* ===== LAYOUT ===== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.d-flex {
    display: flex;
}

.main-container {
    flex: 1;
    display: flex;
    min-height: calc(100vh - 76px); /* navbar height */
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 2rem 1rem;
    transition: var(--transition);
    position: relative;
}

.main-content {
    flex: 1;
    padding: 2rem;
    background: var(--content-bg);
    overflow-x: auto;
}

/* ===== SIDEBAR MENU ===== */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #6c757d;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.menu-link:hover,
.menu-link.active {
    background: var(--secondary-color);
    color: white;
}

.menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-link span {
    font-weight: 500;
}

/* ===== SIDEBAR CLOSE BUTTON ===== */
.sidebar-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-close:hover {
    background: #f8f9fa;
    color: #495057;
}

/* ===== SIDEBAR MENU ===== */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #6c757d;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.menu-link:hover,
.menu-link.active {
    background: var(--secondary-color);
    color: white;
}

.menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-link span {
    font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 2rem;
}

.footer {
    padding: 1rem 2rem;
    background: var(--footer-bg);
    color: var(--text-color);
    text-align: center;
    font-size: 0.95rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}


.page-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--light-color);
    padding-bottom: 1rem;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #999;
    font-size: 0.95rem;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: #999;
    font-size: 0.85rem;
}

.card-icon {
    font-size: 3rem;
    opacity: 0.1;
    position: absolute;
    top: -10px;
    right: -10px;
}

/* ===== TABLO ===== */
.table-responsive {
    border-radius: var(--border-radius);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table-responsive table {
    width: 100%;
        min-width: 720px;
}

.table th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    vertical-align: middle;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f9f9f9;
}

    /* ===== EKSTRE / CARİ EKSTRESİ STYLES ===== */
    .statement-page {
        max-width: 1240px;
        margin: 0 auto;
        padding: 0 0.5rem;
        color: #111827;
    }

    .statement-topbar {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 1rem 1rem 1.25rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    }

    .statement-doc-label {
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: #6b7280;
        margin-bottom: 0.35rem;
        font-size: 0.75rem;
    }

    .statement-title {
        font-size: 2.1rem;
        margin-bottom: 0.25rem;
        letter-spacing: -0.03em;
    }

    .statement-subtitle {
        color: #4b5563;
        margin: 0;
        font-size: 0.95rem;
    }

    .company-mini {
        margin-top: 0.5rem;
        font-size: 0.9rem;
        color: #374151;
        line-height: 1.3;
    }

    .company-mini a {
        color: #1d4ed8;
        text-decoration: none;
    }

    .statement-meta {
        display: grid;
        gap: 0.75rem;
        min-width: 240px;
        text-align: right;
    }

    .statement-meta div {
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.8rem 1rem;
        background: #f9fafb;
    }

    .meta-label {
        display: block;
        font-size: 0.75rem;
        color: #6b7280;
        margin-bottom: 0.15rem;
    }

    .statement-summary-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    .statement-summary-card {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1rem;
        background: #ffffff;
        min-height: 110px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    }

    .summary-label {
        color: #6b7280;
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        letter-spacing: 0.08em;
    }

    .summary-value {
        font-size: 1.4rem;
        font-weight: 700;
    }

    .statement-summary-card--debt .summary-value {
        color: #dc2626;
    }

    .statement-summary-card--paid .summary-value {
        color: #16a34a;
    }

    .statement-summary-card--balance .summary-value {
        color: #1d4ed8;
    }

    .statement-summary-card--overdue .summary-value {
        color: #b91c1c;
    }

    .statement-party-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .statement-invoice-status-card {
        padding-bottom: 0.15rem;
        margin-bottom: 1rem;
    }

    .statement-status-grid,
    .statement-status-summary-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 0.75rem;
        padding: 1rem;
        min-width: 0;
    }

    .statement-status-item,
    .statement-status-summary-item {
        border-radius: 12px;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 110px;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        min-width: 0;
        align-items: flex-start;
    }

    .statement-status-summary-item {
        min-height: 100px;
    }

    .statement-status-item--paid,
    .statement-status-summary-item--paid {
        background: rgba(220, 248, 220, 0.55);
        border-color: rgba(34, 197, 94, 0.25);
    }

    .statement-status-item--partial,
    .statement-status-summary-item--open {
        background: rgba(254, 240, 138, 0.45);
        border-color: rgba(234, 179, 8, 0.25);
    }

    .statement-status-item--open,
    .statement-status-summary-item--overdue {
        background: rgba(254, 215, 215, 0.45);
        border-color: rgba(239, 68, 68, 0.25);
    }

    .status-label {
        font-size: 0.85rem;
        color: #4b5563;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .statement-invoice-list {
        table-layout: auto;
        min-width: 720px;
    }

    .statement-invoice-list th,
    .statement-invoice-list td {
        padding: 0.7rem 0.75rem;
        vertical-align: middle;
    }

    .statement-invoice-list th {
        background: #eef2ff;
        color: #1e3a8a;
    }

    .statement-invoice-list td {
        font-size: 0.9rem;
    }

    .statement-invoice-list th:nth-child(1),
    .statement-invoice-list td:nth-child(1) {
        width: 30%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-all;
    }

    .statement-invoice-list th:nth-child(2),
    .statement-invoice-list td:nth-child(2),
    .statement-invoice-list th:nth-child(3),
    .statement-invoice-list td:nth-child(3) {
        width: 10%;
        white-space: nowrap;
        text-align: center;
    }

    .statement-invoice-list th:nth-child(4),
    .statement-invoice-list td:nth-child(4),
    .statement-invoice-list th:nth-child(5),
    .statement-invoice-list td:nth-child(5),
    .statement-invoice-list th:nth-child(6),
    .statement-invoice-list td:nth-child(6) {
        width: 12%;
        text-align: right;
        white-space: nowrap;
    }

    .statement-invoice-list th:nth-child(7),
    .statement-invoice-list td:nth-child(7) {
        width: 16%;
        white-space: nowrap;
        text-align: left;
    }

    .invoice-status-badge {
        display: inline-block;
        padding: 0.25rem 0.6rem;
        border-radius: 999px;
        font-size: 0.82rem;
        font-weight: 700;
        color: #111827;
    }

    .invoice-status-badge--paid {
        background: rgba(220, 248, 220, 0.65);
        color: #166534;
    }

    .invoice-status-badge--open {
        background: rgba(254, 243, 199, 0.65);
        color: #92400e;
    }

    .invoice-status-badge--overdue {
        background: rgba(254, 215, 215, 0.75);
        color: #991b1b;
    }

    .status-value {
        font-size: 1.7rem;
        font-weight: 700;
        color: #111827;
    }

    .statement-card {
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
        overflow: hidden;
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
    }

    .statement-card-title {
        padding: 1rem 1rem 0.75rem;
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #111827;
        border-bottom: 1px solid #e5e7eb;
    }

    .statement-info-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.92rem;
        color: #374151;
    }

    .statement-info-table td {
        padding: 0.85rem 1rem;
        vertical-align: top;
        border-bottom: 1px solid #e5e7eb;
    }

    .statement-info-table tr:last-child td {
        border-bottom: none;
    }

    .statement-info-table td:first-child {
        width: 36%;
        font-weight: 600;
        color: #111827;
    }

    .statement-info-table td:last-child {
        color: #4b5563;
    }

    .statement-section {
        margin-top: 1.75rem;
        padding: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: #ffffff;
    }

    .statement-section-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .section-label {
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #6b7280;
        letter-spacing: 0.12em;
    }

    .statement-section h2 {
        margin: 0;
        font-size: 1.3rem;
        letter-spacing: -0.02em;
    }

    .section-summary {
        color: #4b5563;
        font-size: 0.95rem;
    }

    .statement-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9rem;
        table-layout: fixed;
        min-width: 680px;
    }

    .statement-table th,
    .statement-table td {
        padding: 0.85rem 0.85rem;
        border-bottom: 1px solid #e5e7eb;
        vertical-align: middle;
        line-height: 1.5;
        overflow-wrap: anywhere;
        word-break: break-word;
        min-width: 0;
    }

    .statement-table th:nth-child(1),
    .statement-table td:nth-child(1) {
        width: 14%;
        white-space: nowrap;
    }

    .statement-table th:nth-child(2),
    .statement-table td:nth-child(2) {
        width: 42%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .statement-table th:nth-child(3),
    .statement-table td:nth-child(3),
    .statement-table th:nth-child(4),
    .statement-table td:nth-child(4),
    .statement-table th:nth-child(5),
    .statement-table td:nth-child(5) {
        width: 14%;
        white-space: nowrap;
    }

    .statement-table th {
        background: #f3f4f6;
        color: #111827;
        font-weight: 700;
    }

    .statement-note {
        margin-top: 0.35rem;
        font-size: 0.85rem;
        color: #6b7280;
        line-height: 1.35;
    }

    .statement-type-badge {
        font-size: 0.72rem;
        padding: 0.25rem 0.55rem;
        vertical-align: middle;
        margin-right: 0.5rem;
    }

    .statement-status-badge {
        font-size: 0.72rem;
        padding: 0.2rem 0.45rem;
        vertical-align: middle;
        margin-left: 0.45rem;
    }

    .statement-status-text {
        display: inline-block;
        margin-left: 0.5rem;
        color: #b91c1c;
        font-size: 0.95rem;
        vertical-align: middle;
    }

    .statement-row-invoice {
        background: rgba(254, 215, 215, 0.45);
    }

    .statement-row-payment {
        background: rgba(220, 248, 220, 0.45);
    }

    .statement-row-label-invoice {
        display: inline-block;
        padding: 0.1rem 0.4rem;
        border-radius: 0.35rem;
        background: rgba(239, 68, 68, 0.15);
        color: #991b1b;
        font-weight: 700;
        margin-right: 0.5rem;
    }

    .statement-row-label-payment {
        display: inline-block;
        padding: 0.1rem 0.4rem;
        border-radius: 0.35rem;
        background: rgba(16, 185, 129, 0.15);
        color: #047857;
        font-weight: 700;
        margin-right: 0.5rem;
    }

    .statement-row-invoice td:nth-child(2),
    .statement-row-invoice strong.statement-row-title-invoice {
        color: #b91c1c !important;
    }

    .statement-row-payment td:nth-child(2),
    .statement-row-payment strong.statement-row-title-payment {
        color: #047857 !important;
    }

    .statement-table tbody tr:last-child td {
        border-bottom: none;
    }

    .table-row-overdue {
        background: rgba(254, 226, 226, 0.6);
    }

    .statement-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.35rem 0.75rem;
        background: #f3f4f6;
        border-radius: 999px;
        margin-bottom: 0.25rem;
        font-size: 0.82rem;
    }

    .statement-empty {
        padding: 1rem;
        text-align: center;
        color: #4b5563;
        background: #f8fafc;
        border: 1px dashed #cbd5e1;
        border-radius: 10px;
        font-size: 0.96rem;
    }

    .statement-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    @media (max-width: 992px) {
        .statement-summary-grid,
        .statement-party-row,
        .statement-meta,
        .statement-status-summary-grid {
            grid-template-columns: 1fr;
            text-align: left;
        }

        .statement-meta {
            min-width: auto;
        }

        .statement-table {
            min-width: 720px;
            font-size: 0.85rem;
        }

        .statement-table th,
        .statement-table td {
            padding: 0.75rem 0.6rem;
        }

        .statement-table th:nth-child(1),
        .statement-table td:nth-child(1),
        .statement-table th:nth-child(3),
        .statement-table td:nth-child(3),
        .statement-table th:nth-child(4),
        .statement-table td:nth-child(4),
        .statement-table th:nth-child(5),
        .statement-table td:nth-child(5) {
            white-space: normal;
        }

        .statement-table th:nth-child(2),
        .statement-table td:nth-child(2) {
            white-space: normal;
        }
    }

    @media print {
        .statement-actions,
        .btn,
        .navbar,
        .sidebar,
        .modal,
        .alert {
            display: none !important;
        }

        .statement-page,
        .statement-topbar,
        .statement-summary-card,
        .statement-card,
        .statement-section {
            border-color: #d1d5db !important;
            background: white !important;
        }

        .statement-topbar {
            page-break-inside: avoid;
        }

        .statement-section {
            page-break-inside: avoid;
            border-width: 1px !important;
        }

        body {
            margin: 0;
            background: white !important;
        }
    }

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== FORMLAR ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-rounded {
    border-radius: 999px !important;
}

.btn-outline-warning {
    background: transparent;
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

.btn-outline-warning:hover {
    background: var(--warning-color);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
}

.page-link {
    border-radius: 999px;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.page-item.active .page-link {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    box-shadow: 0 0 0 0.15rem rgba(52, 152, 219, 0.25);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Highlight pulse for returning to a card/row */
.flash-highlight {
    position: relative;
    animation: flash-pulse 2.4s ease-out;
    border-radius: 8px;
    z-index: 2;
}

@keyframes flash-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52,152,219,0.55);
    }
    40% {
        box-shadow: 0 0 0 14px rgba(52,152,219,0.06);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52,152,219,0);
    }
}

/* ===== ALERT ===== */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--secondary-color);
    color: #0c5460;
}

/* ===== LOGIN SAYFASI ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-form {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

/* ===== RESPONSIVE TASARIM ===== */

/* ===== MOBILE FIRST APPROACH ===== */

/* Küçük ekranlar (max 576px) */
@media (max-width: 576px) {
    /* Genel */
    body {
        font-size: 14px;
    }

    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Navbar */
    .navbar .container-fluid {
        padding: 0 15px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-brand i {
        font-size: 1.5rem;
    }

    .navbar-nav {
        display: none;
    }

    .navbar-right {
        gap: 0.5rem;
    }

    .navbar-right .user-info {
        display: none;
    }

    /* Sidebar - Mobile'da gizli */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        background: var(--sidebar-bg);
        border-right: 1px solid var(--sidebar-border);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    /* Sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    /* Hamburger menu göster */
    #sidebarToggle {
        display: flex !important;
    }

    /* Ana içerik */
    .main-content {
        padding: 1rem 0.5rem;
        margin-left: 0;
    }

    /* Başlıklar */
    .page-title {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .page-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    /* Kartlar */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 1rem 0.75rem;
    }

    .card-body {
        padding: 1rem 0.75rem;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-value {
        font-size: 1.5rem;
    }

    /* Tablolar */
    .table-responsive {
        border: none;
    }

    .table {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    .table th {
        font-size: 0.75rem;
        font-weight: 600;
    }

    /* Formlar */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        height: auto;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        min-height: 40px;
    }

    /* Modal'lar */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-header {
        padding: 1rem 1rem 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.5rem 1rem 1rem;
    }

    /* Buton grupları */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .btn-group .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    /* Alert'ler */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Progress bar */
    .progress {
        height: 8px;
    }

    /* Badge'ler */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Özel sınıflar */
    .justify-between {
        flex-direction: column;
        gap: 0.5rem;
    }

    .d-flex {
        flex-wrap: wrap;
    }

    .gap-2 {
        gap: 0.5rem;
    }

    /* Yazdırılabilir alanlar */
    @media print {
        .btn, .modal, .sidebar, .navbar { display: none !important; }
        body { background: white; }
        .card { page-break-inside: avoid; }
    }
}

    /* Başlıklar */
    .page-title {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .page-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    /* Kartlar */
    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 1rem 0.75rem;
    }

    .card-body {
        padding: 1rem 0.75rem;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-value {
        font-size: 1.5rem;
    }

    /* Tablolar */
    .table-responsive {
        border: none;
    }

    .table {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    .table th {
        font-size: 0.75rem;
        font-weight: 600;
    }

    /* Formlar */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
        height: auto;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        min-height: 40px;
    }

    /* Modal'lar */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-header {
        padding: 1rem 1rem 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.5rem 1rem 1rem;
    }

    /* Buton grupları */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .btn-group .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    /* Alert'ler */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Progress bar */
    .progress {
        height: 8px;
    }

    /* Badge'ler */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Özel sınıflar */
    .justify-between {
        flex-direction: column;
        gap: 0.5rem;
    }

    .d-flex {
        flex-wrap: wrap;
    }

    .gap-2 {
        gap: 0.5rem;
    }

    /* Yazdırılabilir alanlar */
    @media print {
        .btn, .modal, .sidebar, .navbar { display: none !important; }
        body { background: white; }
        .card { page-break-inside: avoid; }
    }


/* Orta ekranlar (577px - 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .navbar-nav {
        display: flex;
        flex-wrap: wrap;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }

    .modal-dialog {
        max-width: 600px;
    }
}

/* Büyük ekranlar (769px - 992px) */
@media (min-width: 769px) and (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 992px) {
    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl,
    .modal-dialog.modal-fullscreen,
    .modal-dialog.modal-fullscreen-sm-down,
    .modal-dialog.modal-fullscreen-md-down,
    .modal-dialog.modal-fullscreen-lg-down,
    .modal-dialog.modal-fullscreen-xl-down,
    .modal-dialog.modal-fullscreen-xxl-down {
        max-width: 760px !important;
        width: auto !important;
        margin: 1.5rem auto !important;
    }

    .modal-content {
        max-height: calc(100vh - 4rem);
        overflow: hidden;
    }

    .modal-body {
        max-height: calc(100vh - 10rem);
        overflow-y: auto;
    }
}

/* Çok büyük ekranlar (993px+) */
@media (min-width: 993px) {
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .main-content {
        padding: 2rem 2rem;
    }
}

@media (min-width: 992px) {
    .modal.show .modal-dialog,
    .modal .modal-dialog {
        max-width: 820px !important;
        width: 820px !important;
        margin: 1.5rem auto !important;
    }
}

/* ===== TABLET SPECIFIC ===== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .navbar-nav .nav-link {
        padding: 1rem 1.5rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* iOS zoom prevention */
    }

    .table th,
    .table td {
        padding: 0.75rem;
        min-height: 44px;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 0;
    }

    .sidebar {
        width: 200px;
        padding: 1rem 0.5rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    .page-header {
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .card-body {
        padding: 0.75rem 0.5rem;
    }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand i {
        font-size: 2rem;
    }

    .card-value {
        font-weight: 600;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12px;
    }

    .navbar,
    .sidebar,
    .btn,
    .modal,
    .alert {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: 1px solid #ddd !important;
        margin-bottom: 1rem !important;
        page-break-inside: avoid;
    }

    .table {
        font-size: 10px;
        border-collapse: collapse;
    }

    .table th,
    .table td {
        border: 1px solid #ddd;
        padding: 4px;
    }

    .page-break {
        page-break-before: always;
    }
}

/* ===== ALERT STİLERİ ===== */
.alert.border-left-success {
    border-left: 5px solid var(--success-color);
    padding-left: 1.5rem;
}

body.dark-theme .alert.border-left-success {
    border-left-color: #22c55e;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    border-color: var(--success-color);
    color: var(--text-color);
}

body.dark-theme .alert-success {
    background-color: rgba(34, 197, 94, 0.15);
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-color: var(--warning-color);
    color: var(--text-color);
}

body.dark-theme .alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
}

/* ===== EK RESPONSIVE DÜZELTMELER ===== */

/* Row ve Column düzeltmeleri */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-3, .col-md-4, .col-md-6, .col-lg-6, .col-lg-3 {
    padding: 0 15px;
}

/* Mobil için column genişlikleri */
@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6, .col-lg-6, .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 769px) {
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-lg-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Input group responsive */
.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Mobil için input group */
@media (max-width: 576px) {
    .input-group {
        flex-direction: column;
    }

    .input-group .form-control {
        border-radius: var(--border-radius);
        margin-bottom: 0.5rem;
    }

    .input-group .btn {
        border-radius: var(--border-radius);
        width: 100%;
    }
}

/* Dropdown menü responsive */
.dropdown-menu {
    min-width: 200px;
}

@media (max-width: 576px) {
    .dropdown-menu {
        min-width: 180px;
        font-size: 0.9rem;
    }
}

/* Toast mesajları */
.toast {
    max-width: 350px;
}

@media (max-width: 576px) {
    .toast {
        max-width: calc(100vw - 2rem);
        margin: 0 1rem;
    }
}

/* Loading spinner */
.spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Mobil için daha büyük spinner */
@media (max-width: 576px) {
    .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Chart.js responsive */
@media (max-width: 576px) {
    canvas {
        max-width: 100%;
        height: auto !important;
    }
}

/* Özel mobil sınıflar */
.mobile-hidden {
    display: none !important;
}

@media (min-width: 577px) {
    .mobile-hidden {
        display: block !important;
    }
}

.desktop-hidden {
    display: block !important;
}

@media (max-width: 576px) {
    .desktop-hidden {
        display: none !important;
    }
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 576px) {
    .footer {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
}

/* Sticky tablo başlıkları */
@media (max-width: 768px) {
    .table-responsive {
        position: relative;
    }

    .table thead th {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* Accordion style for mobile */
@media (max-width: 576px) {
    .card .card-header {
        cursor: pointer;
        position: relative;
    }

    .card .card-header::after {
        content: '+';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.2rem;
        font-weight: bold;
    }

    .card.collapsed .card-body {
        display: none;
    }

    .card.collapsed .card-header::after {
        content: '+';
    }

    .card.expanded .card-header::after {
        content: '−';
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .navbar {
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid;
    }

    .btn {
        border: 2px solid;
    }

    .form-control,
    .form-select {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
