:root {
    --indigo: #260964;
    --purple: #3E1170;
    --violet: #631E81;
    --lavender: #8247BB;
    --aubergine: #521879;
    --navy: #180655;
    --text: #291D1A;
    --gray: #46596B;
    --sand: #B29788;
    --bronze: #A97137;
    --dark: #1E1D1D;
    --danger: #C80101;
    --bg: #F7F5FA;
    --card: #fff;
    --border: #E5E0EB;
    --success: #217254;
    --warning: #A97137;
    --shadow: 0 6px 26px rgba(38,9,100,.045)
}

* {
    box-sizing: border-box
}

html {
    font-family: Inter,Segoe UI,Arial,Helvetica,sans-serif;
    color: var(--text);
    font-size: 15px
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg)
}

a {
    color: var(--indigo);
    text-decoration: none
}

    a:hover {
        color: var(--violet)
    }

button, input, select, textarea {
    font: inherit
}

button {
    cursor: pointer
}

h1, h2, h3, p {
    margin: 0
}

h1 {
    font-size: 1.8rem;
    font-weight: 750;
    letter-spacing: -.035em;
    color: var(--navy)
}

h2 {
    font-size: 1.16rem;
    margin-bottom: 14px
}

h3 {
    font-size: 1.02rem;
    margin-bottom: 8px
}

p {
    line-height: 1.55
}

small, .muted {
    color: #767286
}

small {
    font-size: .8rem
}

.block {
    display: block
}

.spaced {
    margin-top: 16px
}

.app-shell {
    display: flex
}

.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    width: 246px;
    min-width: 246px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(166deg,var(--navy),var(--indigo) 58%,var(--purple));
    color: #fff;
    padding: 22px 12px 12px;
    overflow: auto;
    z-index: 60
}

.app-brand {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 14px 25px
}

    .app-brand:hover {
        color: #fff
    }

    .app-brand strong {
        font-size: 1.45rem;
        letter-spacing: 2px
    }

    .app-brand small {
        display: block;
        color: #CFC3E8;
        font-size: .62rem;
        letter-spacing: 1.7px
    }

.brand-mark {
    display: flex;
    background: linear-gradient(145deg,#a878dc,#6f3999);
    width: 43px;
    height: 43px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 900;
    box-shadow: 0 5px 15px #19063577
}

.sidebar-label {
    font-size: .67rem;
    letter-spacing: 1.6px;
    color: #AFA0C9;
    padding: 22px 14px 10px
}

.nav-item {
    display: flex;
    color: #E0D9EF;
    gap: 12px;
    align-items: center;
    font-size: .89rem;
    font-weight: 550;
    padding: 11px 13px;
    margin: 2px 0;
    border-radius: 10px
}

    .nav-item span {
        width: 20px;
        text-align: center;
        font-size: 1.18rem
    }

    .nav-item:hover {
        color: #fff;
        background: #ffffff24
    }

.sidebar-spacer {
    flex: 1
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid #ffffff22;
    font-size: .77rem;
    color: #d8cfee
}

.main-zone {
    flex: 1;
    min-width: 0
}

.topbar {
    height: 67px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 10
}

.company-title {
    font-size: 1rem;
    font-weight: 750
}

.topbar-user {
    margin-left: auto;
    color: #756a82
}

.small-link, .logout {
    font-size: .82rem
}

.logout {
    border: 0;
    background: #f0e7f6;
    color: var(--purple);
    padding: 8px 13px;
    border-radius: 9px
}

.main-content {
    padding: 27px 34px;
    max-width: 1600px;
    margin: 0 auto
}

.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 23px
}

    .heading .muted {
        margin-top: 5px
    }

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 20px
}

    .panel.inset {
        background: #F9F7FC;
        border-color: #eee8f4;
        padding: 15px;
        box-shadow: none
    }

    .panel.narrow {
        max-width: 690px
    }

    .panel h2 {
        color: #2B1462
    }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
    gap: 14px;
    margin-bottom: 25px
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 130px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    color: var(--text)
}

    .stat span {
        font-size: .82rem;
        color: #777084
    }

    .stat strong {
        font-size: 2.05rem;
        line-height: 1;
        color: var(--indigo);
        font-variant-numeric: tabular-nums
    }

    .stat small {
        margin-top: auto
    }

    .stat.danger strong {
        color: var(--danger)
    }

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 14px;
    margin-bottom: 25px
}

.shortcut {
    padding: 28px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    justify-content: center;
    align-items: center;
    font-weight: 650;
    box-shadow: var(--shadow);
    text-align: center
}

    .shortcut span {
        font-size: 2rem;
        color: var(--violet)
    }

    .shortcut:hover {
        background: #f8f1fe;
        border-color: #c6a6ec
    }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--indigo);
    border-radius: 10px;
    padding: 10px 17px;
    min-height: 40px;
    font-weight: 650;
    white-space: nowrap
}

    .btn:hover {
        background: #f1ebf8
    }

    .btn.primary {
        border-color: var(--indigo);
        background: var(--indigo);
        color: #fff
    }

        .btn.primary:hover {
            background: var(--purple)
        }

    .btn.light {
        background: #f3eff8;
        border-color: #e7deef
    }

    .btn.small {
        font-size: .76rem;
        padding: 6px 10px;
        min-height: 30px
    }

    .btn.big {
        font-size: 1.05rem;
        padding: 15px 18px
    }

    .btn.full {
        width: 100%
    }

    .btn.danger-outline {
        border-color: #e6cccc;
        color: var(--danger)
    }

.pill {
    display: inline-block;
    border-radius: 30px;
    padding: 5px 10px;
    background: #f0e8f7;
    color: var(--purple);
    font-weight: 650;
    font-size: .7rem;
    white-space: nowrap
}

    .pill.green {
        background: #e4f7ef;
        color: #166b4e
    }

    .pill.amber {
        background: #fff3df;
        color: #956019
    }

    .pill.red {
        background: #ffe6e6;
        color: #a90000
    }

    .pill.neutral {
        background: #f2f2f2;
        color: #666
    }

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 16px
}

    .form-stack label, .filter-row label, .form-grid label {
        display: flex;
        flex-direction: column;
        gap: 7px;
        font-size: .86rem;
        font-weight: 600;
        color: #50435e
    }

.form-stack input:not([type=checkbox]):not([type=radio]), .form-stack select, .form-stack textarea, .filter-row input, .filter-row select {
    width: 100%;
    border: 1px solid #D7CEDF;
    border-radius: 10px;
    padding: 11px 12px;
    min-height: 43px;
    background: #fff;
    color: var(--text);
    outline: none
}

    .form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .filter-row input:focus, .filter-row select:focus {
        border-color: var(--violet);
        box-shadow: 0 0 0 3px #8247bb22
    }

.form-stack input[type=file] {
    padding: 7px !important
}

.checkbox-line {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px !important;
    font-size: .89rem
}

    .checkbox-line input {
        accent-color: var(--purple);
        width: 19px;
        height: 19px;
        flex-shrink: 0
    }

    .checkbox-line.big-check {
        font-size: 1.05rem
    }

.choice-row, .choice-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

    .choice-row > label, .choice-grid fieldset {
        flex: 1;
        min-width: 160px;
        border: 1px solid #e3dcec;
        border-radius: 11px;
        padding: 14px 18px;
        background: #f8f5fc
    }

    .choice-row > label {
        flex-direction: row;
        align-items: center;
        gap: 12px
    }

    .choice-row input, .choice-grid input {
        accent-color: var(--purple);
        width: 20px;
        height: 20px
    }

    .choice-grid fieldset {
        display: flex;
        gap: 14px;
        align-items: center
    }

    .choice-grid legend {
        font-size: .85rem;
        font-weight: 700
    }

    .choice-grid fieldset label {
        flex-direction: row;
        align-items: center;
        gap: 7px;
        font-weight: 700
    }

        .choice-grid fieldset label:has(input:checked) {
            color: var(--violet)
        }

.camera-box {
    border: 1px dashed #bbaad0;
    border-radius: 12px;
    padding: 17px;
    background: #fbf8ff
}

    .camera-box video {
        max-width: 100%;
        max-height: 300px;
        border-radius: 10px;
        margin-top: 12px
    }

.row-wrap, .filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px
}

    .row-wrap > * {
        flex: 1;
        min-width: 170px
    }

.filter-row {
    margin-bottom: 16px
}

    .filter-row label {
        min-width: 125px
    }

    .filter-row > input {
        max-width: 200px
    }

.alert {
    background: #f1edf8;
    border-radius: 10px;
    padding: 14px 17px;
    margin: 12px 0 20px;
    border: 1px solid #e3d8ef
}

    .alert.error {
        background: #fff0f0;
        border-color: #ffd5d5;
        color: #9e0404
    }

    .alert.success {
        background: #edf9f2;
        border-color: #cfebdb;
        color: #146c4b
    }

.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 12px
}

    .tabs.wrap {
        flex-wrap: wrap
    }

    .tabs a {
        display: inline-block;
        padding: 9px 13px;
        background: #eeeaf4;
        color: #65586e;
        border-radius: 9px;
        white-space: nowrap;
        font-weight: 650;
        font-size: .8rem
    }

        .tabs a.active {
            background: var(--indigo);
            color: #fff
        }

.table-wrap {
    overflow-x: auto
}

    .table-wrap table, table {
        width: 100%;
        border-collapse: collapse;
        font-size: .84rem
    }

        table th, table td {
            text-align: left;
            padding: 12px 11px;
            border-bottom: 1px solid #eee9f3;
            vertical-align: middle
        }

        table th {
            font-size: .75rem;
            color: #796e86;
            background: #fbf9fd;
            font-weight: 700;
            white-space: nowrap
        }

        table tr:hover td {
            background: #fdfbff
        }

.inline {
    display: inline
}

.empty {
    text-align: center;
    padding: 40px 20px;
    color: #888
}

.two-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px
}

    .two-panel .panel {
        overflow: auto
    }

.account-box {
    border: 2px solid #e3d9ec;
    padding: 19px;
    border-radius: 14px;
    background: #f7f2fb
}

    .account-box .muted {
        margin-top: 10px
    }

.history-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px dashed var(--border);
    font-size: .8rem
}

    .history-item.selected {
        background: #f0e6fc
    }

.auth-card {
    max-width: 440px;
    width: 100%;
    margin: 35px auto;
    padding: 34px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 22px 80px #26096418
}

    .auth-card.wide {
        max-width: 680px
    }

    .auth-card h1 {
        font-size: 1.55rem;
        margin: 12px 0
    }

    .auth-card .muted {
        margin-bottom: 22px
    }

.brand-emblem {
    background: linear-gradient(145deg,var(--purple),var(--lavender));
    color: #fff;
    border-radius: 18px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900
}

.login-shell {
    background: radial-gradient(circle at 90% 10%,#f1e7fb,#f7f5fa 60%)
}

.login-main {
    padding: 5vh 14px
}

.qr-panel {
    text-align: center;
    max-width: 560px;
    margin: 20px auto
}

.qr-img {
    max-width: 280px;
    width: 100%;
    margin: 20px auto
}

    .qr-img svg {
        width: 100%;
        height: auto
    }

.ticket {
    margin: 25px auto;
    max-width: 410px;
    background: white;
    border: 1px solid #d8cde6;
    box-shadow: 0 18px 70px #2609641c;
    border-radius: 19px;
    overflow: hidden;
    text-align: center
}

.ticket-top {
    background: linear-gradient(110deg,var(--indigo),var(--violet));
    color: #fff;
    padding: 21px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    letter-spacing: 1px;
    font-size: .77rem
}

    .ticket-top strong {
        font-size: 1.07rem;
        letter-spacing: 0
    }

.ticket-body {
    padding: 20px
}

    .ticket-body h2 {
        margin: 12px 0 4px;
        font-size: 1.33rem
    }

    .ticket-body .muted {
        font-size: .85rem
    }

.ticket-photo {
    width: 108px;
    height: 108px;
    border-radius: 15px;
    object-fit: cover;
    background: #f7f5fa;
    display: block;
    margin: 8px auto
}

.ticket-body .qr-img {
    max-width: 240px
}

.timer {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--violet);
    margin: 10px 0
}

.ticket-bottom {
    background: #f8f4fb;
    padding: 17px
}

.legal-text {
    white-space: normal;
    max-height: 350px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf9fb;
    padding: 19px;
    margin: 17px 0
}

    .legal-text h3 {
        margin-bottom: 16px
    }

.pre-wrap {
    white-space: pre-wrap;
    line-height: 1.65
}

.verify-result {
    text-align: center;
    margin-top: 20px;
    border-radius: 12px;
    padding: 24px
}

    .verify-result.valid {
        background: #edf9f3
    }

    .verify-result.invalid {
        background: #fff0f0
    }

    .verify-result strong {
        font-size: 1.4rem;
        color: var(--indigo)
    }

    .verify-result.invalid strong {
        color: var(--danger)
    }

#qr-video {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 16px
}

.chart-bars {
    margin-top: 20px;
    display: grid;
    gap: 13px
}

.bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 140px;
    align-items: center;
    gap: 12px;
    font-size: .76rem
}

.bar-track {
    height: 17px;
    border-radius: 8px;
    background: #f2eaf7;
    overflow: hidden
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg,#631E81,#8247BB)
}

.align-bottom {
    align-self: end
}

.logout:hover {
    background: #e6d5f6
}

#menu-toggle {
    display: none;
    border: 0;
    background: #f2edf8;
    padding: 8px 11px;
    border-radius: 8px
}

details {
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 16px
}

summary {
    cursor: pointer;
    font-weight: 650;
    color: var(--purple)
}

.info-group {
    padding: 15px 0;
    display: grid;
    gap: 8px
}

@media(max-width:1050px) {
    .sidebar {
        width: 205px;
        min-width: 205px
    }

    .main-content {
        padding: 20px
    }

    .shortcut-grid {
        grid-template-columns: repeat(2,1fr)
    }

    .bar-row {
        grid-template-columns: 145px 1fr 95px
    }
}

@media(max-width:760px) {
    .sidebar {
        position: fixed;
        left: -275px;
        width: 250px;
        min-width: 250px;
        transition: left .2s ease;
        box-shadow: 0 4px 20px #2226
    }

        .sidebar.open {
            left: 0
        }

    #menu-toggle {
        display: block
    }

    .topbar {
        height: 59px;
        padding: 0 14px;
        gap: 10px
    }

    .topbar-user {
        display: none
    }

    .company-title {
        font-size: .86rem;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .main-content {
        padding: 18px 12px
    }

    .heading {
        align-items: flex-start;
        gap: 8px
    }

        .heading h1 {
            font-size: 1.45rem
        }

    .panel {
        padding: 15px
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .stats {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 9px
    }

    .stat {
        min-height: 110px;
        padding: 13px
    }

        .stat strong {
            font-size: 1.75rem
        }

    .shortcut-grid {
        grid-template-columns: repeat(2,1fr);
        gap: 9px
    }

    .shortcut {
        font-size: .81rem;
        padding: 22px 6px
    }

    .choice-grid fieldset {
        min-width: 100%;
        justify-content: space-evenly
    }

    .choice-row > label {
        min-width: 100%
    }

    .two-panel {
        grid-template-columns: 1fr
    }

    .filter-row label {
        width: calc(50% - 5px);
        flex: 1
    }

    .bar-row {
        grid-template-columns: 100px 1fr 80px;
        gap: 7px
    }

        .bar-row strong {
            font-size: .67rem
        }

    .auth-card {
        padding: 22px 16px;
        margin: 15px auto
    }

    .ticket {
        margin: 10px auto
    }

    .qr-img {
        max-width: 235px
    }

    #overlay:not([hidden]) {
        position: fixed;
        inset: 0;
        background: #0007;
        z-index: 50
    }
}

@media print {
    .sidebar, .topbar, .ticket-bottom, .btn, .main-content > h1 {
        display: none !important
    }

    .main-content {
        padding: 0
    }

    .ticket {
        border: 0;
        box-shadow: none;
        margin: 0 auto
    }

    .login-main {
        padding: 0
    }

    .ticket-body .qr-img {
        max-width: 220px
    }
}

/* Ziyaretci fotoğraf onizlemesi - kamera, dosya seçimi ve telefonda yerel kamera icin */
.photo-preview {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 320px;
    object-fit: contain;
    border: 1px solid #e3dcec;
    border-radius: 12px;
    margin: 12px auto;
}

    .photo-preview[hidden] {
        display: none !important
    }
