* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --primary: #2563eb; --primary-dark: #1d4ed8; --success: #16a34a; --danger: #dc2626; --bg: #f1f5f9; --card: #fff; --text: #1e293b; --text-muted: #64748b; --border: #e2e8f0; --sidebar: #0f172a; --sidebar-hover: #1e293b; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--sidebar); color: #fff; position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; z-index: 200; }
.sidebar-brand { flex-shrink: 0; display: block; padding: 1rem 1.15rem; border-bottom: 1px solid rgba(255,255,255,0.1); text-decoration: none; }
.sidebar-brand:hover { background: rgba(255, 255, 255, 0.04); }
.sidebar-brand span { color: #60a5fa; }

.sidebar-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    min-height: 56px;
}

.sidebar-brand-logo,
.auth-logo {
    display: block;
    width: 100%;
    max-width: 210px;
    max-height: 48px;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.auth-logo {
    max-width: 360px;
    max-height: 96px;
}

.sidebar-brand-logo.logo-default-tagline-crop,
.auth-logo.logo-default-tagline-crop {
    max-height: none;
    height: 44px;
    object-fit: cover;
    object-position: left top;
}

.auth-logo.logo-default-tagline-crop {
    height: 84px;
}
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.45) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.45); border-radius: 999px; }
.sidebar-nav a { display: block; padding: 0.65rem 0.875rem; color: #cbd5e1; text-align: center; line-height: 1.35; font-size: 0.8125rem; font-weight: 500; }
.sidebar-nav a:hover,
.sidebar-nav a.active { background: var(--sidebar-hover); color: #fff; }
.sidebar-footer { flex-shrink: 0; padding: 0.875rem 1.25rem; font-size: 0.8125rem; color: #94a3b8; border-top: 1px solid rgba(255,255,255,0.1); line-height: 1.35; word-break: break-word; }
.main-content { flex: 1; margin-left: 260px; padding: 2rem; position: relative; z-index: 1; }
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 42%, #e0f2fe 100%);
}
.auth-card {
    background: var(--card);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08), 0 4px 16px rgba(15, 23, 42, 0.06);
}
.auth-card h1 { text-align: center; margin-bottom: 0.5rem; }
.auth-card .subtitle {
    text-align: center;
    margin-bottom: 2rem;
    font-size: clamp(1rem, 2.8vw, 1.125rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #1e3a8a;
    text-transform: uppercase;
}
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.card { background: var(--card); border-radius: 12px; padding: 1.5rem; border: 1px solid var(--border); margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-group label { font-weight: 500; font-size: 0.875rem; }
.form-group input, .form-group select, .form-group textarea { padding: 0.625rem 0.875rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9375rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.form-group.full-width { grid-column: 1 / -1; }
.btn { display: inline-flex; align-items: center; padding: 0.625rem 1.25rem; border: none; border-radius: 8px; font-size: 0.9375rem; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.alert { padding: 1rem 1.25rem; border-radius: 8px; margin-bottom: 1.5rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { background: var(--card); border-radius: 12px; padding: 1.25rem; border: 1px solid var(--border); }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); }
.stat-value { font-size: 1.75rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
table th { background: #f8fafc; font-size: 0.8125rem; color: var(--text-muted); }
.badge { display: inline-block; padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #e2e8f0; color: #475569; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.required { color: var(--danger); }
.table-wrapper { overflow-x: auto; }
.login-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.login-tabs button { flex: 1; padding: 0.625rem; border: 1px solid var(--border); background: #f8fafc; border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s ease; }
.login-tabs button.active { background: var(--gradient-blue); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.auth-card { border: 1px solid rgba(226, 232, 240, 0.9); box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08), 0 4px 16px rgba(15, 23, 42, 0.06); }

.auth-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 96px;
    width: 100%;
}

.auth-logo {
    max-width: 360px;
    max-height: 96px;
    width: 100%;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-group input[readonly], .readonly-field { background: #f1f5f9; color: #475569; cursor: not-allowed; }

/* ---- Panel: mobil & rapor grafikleri ---- */
:root {
    --gradient-blue: linear-gradient(135deg, #3b82f6, #6366f1);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #a855f7);
    --gradient-green: linear-gradient(135deg, #10b981, #22c55e);
    --gradient-orange: linear-gradient(135deg, #f97316, #fb923c);
    --gradient-pink: linear-gradient(135deg, #ec4899, #f43f5e);
    --gradient-teal: linear-gradient(135deg, #14b8a6, #06b6d4);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
    --radius-lg: 16px;
}

body.menu-open { overflow: hidden; }

.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 90;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    margin: -2rem -2rem 1.5rem;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: var(--gradient-blue);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.mobile-topbar-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

.page-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.8125rem;
    font-weight: 600;
}

.card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: none;
}

.card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
}

.card-title-meta {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.filter-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
}

.filter-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.filter-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.filter-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.filter-card-header p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.stats-grid {
    gap: 1rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    box-shadow: var(--shadow-md);
    min-height: 100px;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.stat-card-blue { background: var(--gradient-blue); }
.stat-card-purple { background: var(--gradient-purple); }
.stat-card-green { background: var(--gradient-green); }
.stat-card-orange { background: var(--gradient-orange); }
.stat-card-pink { background: var(--gradient-pink); }
.stat-card-teal { background: var(--gradient-teal); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-body { position: relative; z-index: 1; min-width: 0; }

.stat-label {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.8125rem;
    font-weight: 500;
}

.stat-value {
    color: #fff;
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    padding: 1.25rem;
}

.chart-wrap {
    position: relative;
    height: 280px;
    padding: 0.5rem;
}

.chart-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.chart-wrap-sm { height: 220px; }

.chart-wrap-top-urun { height: 420px; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.data-table th:first-child { border-radius: 10px 0 0 0; }
.data-table th:last-child { border-radius: 0 10px 0 0; }

.data-table tbody tr:hover td {
    background: #f8fafc;
}

.data-table tfoot td {
    background: linear-gradient(180deg, #eef2ff, #e0e7ff);
    font-weight: 700;
    color: #3730a3;
    border-bottom: none;
}

.amount-cell {
    font-weight: 700;
    color: #059669;
}

.amount-cell-negative {
    color: #dc2626;
}

.badge-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

.dashboard-hero {
    background: var(--gradient-blue);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    color: #fff;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.dashboard-hero h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: 0.35rem;
}

.dashboard-hero p {
    opacity: 0.9;
    font-size: 0.9375rem;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--text);
}

.quick-link-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.quick-link-card strong {
    font-size: 0.9375rem;
}

.quick-link-card span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-section {
    padding: 0.65rem 0.875rem 0.3rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    text-align: center;
}

body.panel-chain .sidebar-brand {
    padding: 0.75rem 1rem;
}

body.panel-chain .sidebar-brand-logo.logo-default-tagline-crop {
    height: 40px;
}

body.panel-chain .sidebar-nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

body.panel-chain .nav-section {
    padding: 0.45rem 0.75rem 0.2rem;
    font-size: 0.625rem;
}

body.panel-chain .sidebar-footer {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
}

.chain-page-compact .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.chain-page-compact .stat-card {
    min-height: 84px;
    padding: 1rem;
}

.chain-page-compact .chart-wrap-top-urun {
    height: 280px;
}

.chain-page-compact .dashboard-hero {
    margin-bottom: 1rem;
    padding: 1.25rem 1.5rem;
}

.chain-page-compact .page-header {
    margin-bottom: 1.25rem;
}

.chain-page-compact .filter-card {
    margin-bottom: 1rem;
}

.date-group-row td {
    background: #fef9c3 !important;
    height: 8px;
    padding: 0 !important;
    border: none !important;
}

.ql-blue .quick-link-icon { background: var(--gradient-blue); }
.ql-purple .quick-link-icon { background: var(--gradient-purple); }
.ql-green .quick-link-icon { background: var(--gradient-green); }
.ql-orange .quick-link-icon { background: var(--gradient-orange); }
.ql-pink .quick-link-icon { background: var(--gradient-pink); }
.ql-teal .quick-link-icon { background: var(--gradient-teal); }

.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.branch-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #fff, #f8fafc);
    border: 1px solid var(--border);
}

.branch-card h4 {
    font-size: 1rem;
}

.branch-card-stat {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary);
}

.branch-switcher {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
}

.branch-switcher-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.branch-switcher-form label {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.branch-switcher-form select {
    flex: 1;
    min-width: 180px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

@media (max-width: 991px) {
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }

    .app-layout {
        overflow-x: hidden;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 200;
        width: min(280px, 85vw);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
        overflow: hidden;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 0.75rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .mobile-topbar {
        display: flex;
        margin: 0 0 1rem;
        width: 100%;
        padding: 0.75rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrap {
        height: 220px;
    }

    .chart-wrap-top-urun {
        height: 360px;
        min-height: 320px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        margin-bottom: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    /* Tablolar: mobil kart görünümü */
    .table-responsive-cards {
        overflow-x: visible;
    }

    .table-responsive-cards .data-table thead {
        display: none;
    }

    .table-responsive-cards .data-table,
    .table-responsive-cards .data-table tbody,
    .table-responsive-cards .data-table tfoot,
    .table-responsive-cards .data-table tr {
        display: block;
        width: 100%;
    }

    .table-responsive-cards .data-table tbody tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.875rem 1rem;
        margin-bottom: 0.625rem;
        box-shadow: var(--shadow-sm);
    }

    .table-responsive-cards .data-table tbody tr:hover td {
        background: transparent;
    }

    .table-responsive-cards .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.45rem 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
        font-size: 0.9375rem;
        word-break: break-word;
    }

    .table-responsive-cards .data-table tbody td:last-child {
        border-bottom: none;
    }

    .table-responsive-cards .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.6875rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        text-align: left;
        flex-shrink: 0;
        max-width: 42%;
    }

    .table-responsive-cards .data-table tbody td[data-primary="1"] {
        display: block;
        padding: 0 0 0.5rem;
        margin-bottom: 0.375rem;
        border-bottom: 2px solid #e2e8f0;
        text-align: left;
        font-size: 1.0625rem;
        font-weight: 700;
        line-height: 1.35;
        color: var(--text);
    }

    .table-responsive-cards .data-table tbody td[data-primary="1"]::before {
        display: none;
    }

    .table-responsive-cards .data-table tfoot {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
        margin-bottom: 1.25rem;
    }

    .stat-card {
        padding: 0.875rem;
        min-height: 76px;
        gap: 0.625rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
        border-radius: 10px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 14px;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .filter-card {
        padding: 1rem;
    }

    .filter-card-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 0.75rem;
    }

    .dashboard-hero {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .quick-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .quick-link-card {
        padding: 0.875rem;
    }

    .quick-link-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .branch-grid {
        grid-template-columns: 1fr;
    }

    .date-group-row {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .main-content {
        padding: 0.625rem;
    }

    .mobile-topbar {
        padding: 0.625rem 0.75rem;
    }

    .page-header h1 {
        font-size: 1.15rem;
    }

    .chart-wrap {
        height: 200px;
    }

    .chart-wrap-sm {
        height: 170px;
    }

    .auth-card {
        margin: 1rem;
        padding: 1.75rem;
    }

    .amount-cell,
    .amount-cell-negative {
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }
}

/* ---- Admin dashboard ---- */
.admin-dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.admin-dashboard-hero h1 {
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    margin-bottom: 0.35rem;
}

.admin-dashboard-hero p {
    color: rgba(255, 255, 255, 0.88);
    max-width: 640px;
    font-size: 0.9375rem;
}

.admin-dashboard-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-stats-grid {
    margin-bottom: 1.5rem;
}

.admin-alert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.admin-alert-card {
    border: none;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-alert-card .card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-alert-danger {
    border-top: 4px solid #dc2626;
}

.admin-alert-warning {
    border-top: 4px solid #f59e0b;
}

.admin-license-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-license-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.admin-license-item-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.admin-license-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.admin-license-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.admin-license-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.admin-license-days {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-license-days.is-danger {
    color: #dc2626;
}

.admin-license-days.is-warning {
    color: #d97706;
}

.admin-license-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed var(--border);
}

body.admin-panel {
    background: linear-gradient(165deg, #c9d4e3 0%, #b8c7da 48%, #cfd9e8 100%);
    color: #1e293b;
}

body.admin-panel .main-content {
    background: transparent;
}

body.admin-panel .card {
    background: #fff;
    border: 2px solid #8fa3bc;
    box-shadow: 0 4px 18px rgba(30, 58, 95, 0.12);
}

body.admin-panel .card-title {
    color: #0f172a;
    border-bottom: 2px solid #94a3b8;
}

body.admin-panel .form-group label {
    color: #0f172a;
    font-weight: 600;
}

body.admin-panel .form-group input,
body.admin-panel .form-group select,
body.admin-panel .form-group textarea {
    background: #fff;
    border: 2px solid #64748b;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.admin-panel .form-group input:hover,
body.admin-panel .form-group select:hover,
body.admin-panel .form-group textarea:hover {
    border-color: #475569;
}

body.admin-panel .form-group input:focus,
body.admin-panel .form-group select:focus,
body.admin-panel .form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

body.admin-panel .form-group input[type="date"],
body.admin-panel .form-group input[type="number"] {
    cursor: pointer;
    min-height: 44px;
}

body.admin-panel .form-group input[readonly],
body.admin-panel .readonly-field {
    background: #dbe4ee;
    border-color: #64748b;
    color: #334155;
}

body.admin-panel .form-actions {
    border-top: 2px solid #94a3b8;
}

body.admin-panel table th {
    background: #dbe4ee;
    color: #0f172a;
    font-weight: 700;
    border-bottom: 2px solid #94a3b8;
}

body.admin-panel table td {
    border-bottom: 1px solid #b8c9dc;
    color: #1e293b;
}

.admin-list-search-wrap {
    margin-bottom: 1rem;
}

.admin-list-search {
    width: 100%;
    max-width: 420px;
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    border: 2px solid #64748b;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #0f172a;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3'/%3E%3C/svg%3E") no-repeat 0.9rem center;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-list-search:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.admin-list-no-results td {
    text-align: center;
    color: #64748b;
    padding: 2rem !important;
}

body.admin-panel .sidebar-nav a {
    text-align: center;
}

.admin-logo-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.25rem;
    align-items: start;
}

.admin-logo-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.admin-logo-intro {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    max-width: 820px;
}

.admin-logo-slot-card .card-title {
    margin-bottom: 0.35rem;
}

.admin-logo-slot-desc {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.admin-logo-upload-form {
    margin-top: 1rem;
}

.admin-logo-upload-form .form-group {
    margin-bottom: 0.75rem;
}

.admin-logo-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.admin-logo-action-row .btn {
    width: 100%;
    justify-content: center;
}

.admin-logo-hidden-preview {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

.admin-logo-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-logo-preview-box {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
}

.admin-logo-preview-label {
    padding: 0.65rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.admin-logo-preview-sidebar-inner {
    background: #0f172a;
    padding: 1rem;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-logo-preview-auth-inner {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    padding: 1.25rem;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-logo-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

@media (max-width: 991px) {
    .admin-dashboard-hero {
        padding: 1.15rem;
    }

    .admin-dashboard-actions {
        width: 100%;
    }

    .admin-dashboard-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .admin-alert-grid {
        grid-template-columns: 1fr;
    }

    .admin-license-item {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-license-item-side {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        width: 100%;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .admin-logo-grid,
    .admin-logo-slots-grid {
        grid-template-columns: 1fr;
    }

    .admin-logo-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Giriş reklamı popup — panel/login.php */
body.login-ad-open {
    overflow: hidden;
}

.login-ad-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 1.5rem);
    background: rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.login-ad-overlay.is-hidden {
    display: none;
}

.is-hidden {
    display: none !important;
}

.login-ad-modal {
    position: relative;
    width: min(100%, 540px);
    max-height: min(92dvh, 760px);
    background: var(--card, #fff);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.login-ad-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 1.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.login-ad-close:hover,
.login-ad-close:focus-visible {
    background: rgba(239, 68, 68, 0.92);
    outline: none;
}

.login-ad-close:active {
    transform: scale(0.94);
}

.login-ad-image-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}

.login-ad-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(78dvh, 640px);
    object-fit: contain;
}

.login-ad-hint {
    margin: 0;
    padding: 0.7rem 1rem;
    text-align: center;
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
    color: var(--text-muted, #64748b);
    border-top: 1px solid var(--border, #e2e8f0);
}

.login-ad-admin-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    max-height: 360px;
    padding: 1rem;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
}

.login-ad-admin-preview .login-ad-image {
    max-width: 100%;
    max-height: 320px;
}

@media (max-width: 480px) {
    .login-ad-overlay {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .login-ad-modal {
        width: 100%;
        max-height: 94dvh;
        border-radius: 12px 12px 0 0;
    }

    .login-ad-close {
        top: 0.4rem;
        right: 0.4rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.65rem;
    }

    .login-ad-image {
        max-height: min(72dvh, 560px);
    }

    .login-ad-hint {
        padding: 0.6rem 0.75rem;
    }
}

/* Giriş ekranı: şifremi unuttum, kayıt, gizlilik */
.auth-card-panel {
    transition: max-width 0.2s ease;
}

.auth-card-wide {
    max-width: 480px;
}

.auth-view.is-hidden {
    display: none;
}

.auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.auth-form-row .auth-remember {
    margin-bottom: 0;
}

.auth-link-btn {
    border: none;
    background: none;
    padding: 0;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link-btn:hover,
.auth-link-btn:focus-visible {
    color: var(--primary-dark);
    outline: none;
}

.auth-link-btn-strong {
    font-weight: 700;
}

.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.auth-karpos-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.9rem 1.25rem;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-karpos-btn:hover,
.auth-karpos-btn:focus-visible {
    background: #dc2626;
    color: #fff;
    outline: none;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

.auth-karpos-btn:active {
    transform: scale(0.98);
}

.auth-panel-head {
    margin-bottom: 1.25rem;
}

.auth-panel-accent {
    height: 4px;
    border-radius: 999px;
    background: var(--gradient-blue);
    margin-bottom: 0.85rem;
}

.auth-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.auth-panel-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

.auth-register-form .form-group {
    margin-bottom: 0.85rem;
}

.auth-register-form .form-group label {
    font-size: 0.8125rem;
    color: #475569;
}

.auth-register-form .form-group input {
    width: 100%;
}

.auth-register-btn {
    margin-top: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.auth-success-box {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    margin-bottom: 1rem;
}

.auth-success-box strong {
    display: block;
    font-size: 1.05rem;
    color: #065f46;
    margin-bottom: 0.35rem;
}

.auth-success-box p {
    margin: 0;
    color: #047857;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-success-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 1.5rem;
    line-height: 52px;
    font-weight: 700;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
}

.auth-back-link:hover,
.auth-back-link:focus-visible {
    color: var(--primary);
    outline: none;
}

.auth-privacy-content {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #334155;
    margin-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.admin-privacy-textarea {
    min-height: 280px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.55;
}

.branch-connection-alert {
    margin-bottom: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.panel-connection-block {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
}

.panel-connection-block-inner {
    width: min(100%, 520px);
    background: #fff;
    border-radius: 16px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.panel-connection-block-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #fef3c7;
    color: #d97706;
    font-size: 2.25rem;
    line-height: 72px;
    font-weight: 700;
}

.panel-connection-block-inner h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    color: #0f172a;
}

.panel-connection-block-inner p {
    margin: 0;
    color: #475569;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.55;
}

.panel-connection-block-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

body.panel-connection-blocked .main-content,
body.panel-connection-blocked .sidebar {
    pointer-events: none;
    user-select: none;
}

.sidebar-nav-link-disabled {
    display: block;
    padding: 0.65rem 0.875rem;
    color: #64748b;
    text-align: center;
    line-height: 1.35;
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0.45;
    cursor: not-allowed;
}

.quick-links-disabled .quick-link-card-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 480px) {
    .auth-form-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .auth-footer-links {
        flex-direction: row;
        gap: 0.65rem 1rem;
    }

    .auth-privacy-content {
        max-height: 48vh;
    }
}

/* Müşteri giriş ekranı — mobilde tek ekrana sığdır */
@media (max-width: 480px), (max-height: 760px) and (max-width: 991px) {
    body.auth-login-page {
        overflow-x: hidden;
    }

    body.auth-login-page .auth-page {
        min-height: 100dvh;
        align-items: flex-start;
        justify-content: flex-start;
        padding: max(0.35rem, env(safe-area-inset-top)) 0.4rem max(0.35rem, env(safe-area-inset-bottom));
    }

    body.auth-login-page .auth-card-panel {
        margin: 0 auto;
        padding: 0.85rem 0.95rem 0.75rem;
        max-width: 100%;
    }

    body.auth-login-page .auth-logo-wrap {
        min-height: 52px;
        margin-bottom: 0.4rem;
    }

    body.auth-login-page .auth-logo {
        max-height: 52px;
    }

    body.auth-login-page .auth-logo.logo-default-tagline-crop {
        height: 46px;
    }

    body.auth-login-page .auth-card .subtitle {
        margin-bottom: 0.55rem;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    body.auth-login-page .login-tabs {
        margin-bottom: 0.55rem;
        gap: 0.35rem;
    }

    body.auth-login-page .login-tabs button {
        padding: 0.42rem 0.45rem;
        font-size: 0.78rem;
    }

    body.auth-login-page .form-group {
        margin-bottom: 0.5rem;
        gap: 0.2rem;
    }

    body.auth-login-page .form-group label {
        font-size: 0.76rem;
    }

    body.auth-login-page .form-group input {
        padding: 0.48rem 0.7rem;
        font-size: 16px;
    }

    body.auth-login-page .auth-form-row {
        margin-bottom: 0.5rem;
        gap: 0.35rem;
    }

    body.auth-login-page .auth-remember {
        font-size: 0.76rem;
    }

    body.auth-login-page .auth-link-btn {
        font-size: 0.76rem;
    }

    body.auth-login-page .btn-block {
        min-height: 40px;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    body.auth-login-page .auth-footer-links {
        margin-top: 0.55rem;
        padding-top: 0.55rem;
        gap: 0.45rem 0.85rem;
    }

    body.auth-login-page .auth-karpos-btn {
        margin-top: 0.55rem;
        padding: 0.62rem 0.85rem;
        font-size: 0.875rem;
    }

    body.auth-login-page .alert {
        padding: 0.65rem 0.85rem;
        margin-bottom: 0.65rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 380px), (max-height: 680px) and (max-width: 991px) {
    body.auth-login-page .auth-logo-wrap {
        min-height: 44px;
    }

    body.auth-login-page .auth-logo {
        max-height: 44px;
    }

    body.auth-login-page .auth-logo.logo-default-tagline-crop {
        height: 40px;
    }

    body.auth-login-page .auth-card .subtitle {
        margin-bottom: 0.4rem;
        font-size: 0.75rem;
    }

    body.auth-login-page .auth-card-panel {
        padding: 0.65rem 0.8rem 0.6rem;
    }

    body.auth-login-page .auth-karpos-btn {
        margin-top: 0.45rem;
        padding: 0.55rem 0.75rem;
    }
}
