:root {
    --primary: #1a56db;
    --primary-dark: #1342b0;
    --sidebar-w: 220px;
    --header-h: 56px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f4f6fb;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: #0f172a;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 18px 16px 14px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .sidebar-logo span {
        font-size: 22px;
    }

.sidebar-section {
    padding: 10px 0 4px 16px;
    font-size: 10px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    transition: all .15s;
}

    .sidebar a:hover, .sidebar a.active {
        background: #1e293b;
        color: white;
        border-left: 3px solid var(--primary);
    }

    .sidebar a .ico {
        font-size: 17px;
        width: 20px;
        text-align: center;
    }

/* ── MAIN ── */
.main-wrap {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.topbar {
    height: var(--header-h);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.page-content {
    padding: 24px;
}

/* ── CARDS ── */
.card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 18px;
}

/* ── KPI CARDS ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi {
    background: white;
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #e2e8f0;
}

.kpi-val {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
}

.kpi-lbl {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.kpi-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

/* ── TABLE ── */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

    .tbl th {
        background: #f8fafc;
        color: #475569;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        padding: 10px 12px;
        border-bottom: 1px solid #e2e8f0;
        text-align: left;
    }

    .tbl td {
        padding: 10px 12px;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
    }

    .tbl tr:last-child td {
        border-bottom: none;
    }

    .tbl tr:hover td {
        background: #f8fafc;
    }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

    .btn-primary:hover {
        background: var(--primary-dark);
        color: white;
    }

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

    .btn-outline:hover {
        background: #f9fafb;
    }

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 13.5px;
    outline: none;
    transition: border .15s;
}

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(26,86,219,.1);
    }

.form-select {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 13.5px;
    background: white;
}

.form-row {
    display: grid;
    gap: 16px;
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.badge-gray {
    background: #f1f5f9;
    color: #475569;
}

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13.5px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ── PUANTAJ GRID ── */
.puantaj-wrap {
    overflow-x: auto;
}

.puantaj-table {
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 11px;
}

    .puantaj-table th, .puantaj-table td {
        border: 1px solid #e2e8f0;
    }

    .puantaj-table thead th {
        background: #0f172a;
        color: white;
        text-align: center;
        padding: 4px 2px;
        font-size: 10px;
        font-weight: 600;
        min-width: 28px;
    }

        .puantaj-table thead th.col-isim {
            min-width: 130px;
            text-align: left;
            padding-left: 10px;
            position: sticky;
            left: 0;
            z-index: 2;
            background: #0f172a;
        }

        .puantaj-table thead th.haftasonu {
            background: #1e3a5f;
        }

        .puantaj-table thead th.ozet {
            background: #1e293b;
            min-width: 22px;
        }

    .puantaj-table tbody td.col-isim {
        background: white;
        position: sticky;
        left: 0;
        z-index: 1;
        padding: 4px 8px;
        font-weight: 600;
        color: #0f172a;
        font-size: 12px;
        border-right: 2px solid #e2e8f0;
    }

    .puantaj-table tbody td.gun-cell {
        text-align: center;
        cursor: pointer;
        padding: 2px 1px;
        font-weight: 700;
        font-size: 11px;
        min-width: 28px;
        transition: opacity .1s;
    }

        .puantaj-table tbody td.gun-cell:hover {
            opacity: .8;
            filter: brightness(1.1);
        }

    .puantaj-table tbody td.haftasonu-bos {
        background: #f1f5f9;
    }

    .puantaj-table tbody td.ozet-cell {
        text-align: center;
        background: #f8fafc;
        font-weight: 700;
        font-size: 11px;
        color: #374151;
        padding: 3px 1px;
    }

/* Özet sütunları gizle/göster */
.ozet-gizli .ozet, .ozet-gizli .ozet-cell {
    display: none !important;
}

/* Vardiya seçim popup */
.vardiya-popup {
    position: fixed;
    z-index: 9999;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 14px;
    min-width: 220px;
    display: none;
}

    .vardiya-popup h6 {
        margin: 0 0 10px;
        font-size: 12px;
        color: #64748b;
        font-weight: 600;
        text-transform: uppercase;
    }

.vardiya-popup-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 5px;
}

.vbtn {
    padding: 6px 4px;
    border-radius: 6px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    color: white;
    border: none;
    transition: transform .1s;
}

    .vbtn:hover {
        transform: scale(1.08);
    }

.vbtn-izin {
    background: #64748b;
}

.vbtn-sil {
    background: #ef4444;
    grid-column: span 2;
}

/* ── QR ── */
.qr-card {
    text-align: center;
    padding: 30px;
}

    .qr-card img {
        max-width: 220px;
        border: 3px solid #e2e8f0;
        border-radius: 12px;
        padding: 10px;
    }

    .qr-card h3 {
        margin: 16px 0 4px;
        font-size: 18px;
    }

    .qr-card p {
        color: #64748b;
        font-size: 13px;
    }

.qr-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.qr-giris {
    border-top: 4px solid #10b981;
}

.qr-cikis {
    border-top: 4px solid #ef4444;
}

/* ── MOBİL ── */
@media (max-width: 767px) {
    /* Sidebar varsayılan gizli */
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 100;
    }

        .sidebar.sidebar-open {
            transform: translateX(0);
        }

    /* Main tüm genişliği kaplar */
    .main-wrap {
        margin-left: 0 !important;
    }

    /* Hamburger görünür */
    #hamburger {
        display: block !important;
    }

    /* E-posta gizle, sadece avatar */
    .topbar-email {
        display: none !important;
    }

    /* İçerik padding küçült */
    .page-content {
        padding: 14px;
    }

    /* KPI grid tek sütun */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Form row tek sütun */
    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr !important;
    }

    /* Tablo yatay scroll */
    .card {
        overflow-x: auto;
    }

    /* QR butonları büyük tut */
    .qr-pair {
        grid-template-columns: 1fr !important;
    }
}

/* Hamburger her zaman görünür — mobil ve PC */
#hamburger {
    display: block !important;
}

/* Sidebar ve main-wrap transition */
.sidebar {
    transition: width .2s ease;
}

.main-wrap {
    transition: margin-left .2s ease;
}

/* Desktop sidebar collapse */
body.sidebar-dar {
    --sidebar-w: 58px;
}

    body.sidebar-dar .sidebar {
        overflow: hidden;
    }

        body.sidebar-dar .sidebar-logo div,
        body.sidebar-dar .sidebar-section,
        body.sidebar-dar .sidebar a span:last-child,
        body.sidebar-dar .sidebar > div:last-child form {
            display: none !important;
        }

    body.sidebar-dar .sidebar-logo button {
        margin-left: 0 !important;
    }

    body.sidebar-dar .sidebar-logo {
        justify-content: center;
        padding: 16px 0;
    }

    body.sidebar-dar .sidebar a {
        justify-content: center;
        padding: 12px 0;
        gap: 0;
    }

        body.sidebar-dar .sidebar a .ico {
            width: auto;
            font-size: 20px;
        }

    body.sidebar-dar .sidebar > div:last-child {
        padding: 8px 0;
        text-align: center;
    }

/* Tam ekran modu */
.card:fullscreen {
    overflow: auto;
    background: white;
    padding: 16px;
}

.card:-webkit-full-screen {
    overflow: auto;
    background: white;
    padding: 16px;
}
