:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 2px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bs-body-bg);
    overflow-x: hidden;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform .3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand-link {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.sidebar-logo {
    max-width: 160px;
    width: 100%;
    height: auto;
    display: block;
}

.sidebar-nav {
    list-style: none;
    padding: .75rem 0;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.5rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(102, 126, 234, .08);
    color: #667eea;
}

.sidebar-nav a.active {
    background: rgba(102, 126, 234, .12);
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

.sidebar-nav i { font-size: 1.1rem; width: 1.25rem; }

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: var(--topbar-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.admin-main { flex: 1; }

.page-heading { font-weight: 600; }

.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform .2s;
    overflow: hidden;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card .card-body { padding: 1.25rem; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: .8rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.card-table {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.card-table .card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1rem 1.25rem;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    background: #ffffff;
}

.login-brand {
    padding-top: .5rem;
}

.login-logo-img {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}

.login-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.sale-item-row {
    background: var(--bs-tertiary-bg);
    border-radius: 8px;
    padding: .75rem;
    margin-bottom: .5rem;
}

.badge-cash { background: #198754; }
.badge-card { background: #0d6efd; }
.badge-delivered { background: #198754; }
.badge-pending { background: #ffc107; color: #000; }

.chart-container {
    position: relative;
    height: 280px;
}

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }
    .admin-content { margin-left: 0; }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
}

.sidebar-overlay.show { display: block; }

[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .card-table {
    background: var(--bs-dark);
}

[data-bs-theme="dark"] .sidebar-nav a:hover {
    background: rgba(102, 126, 234, .15);
}

/* Satış modal scroll */
.sale-modal-dialog {
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
}

.sale-modal-dialog .modal-content {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.sale-modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 12rem);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sale-modal-body::-webkit-scrollbar {
    width: 8px;
}

.sale-modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, .4);
    border-radius: 4px;
}

.sale-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, .6);
}
