:root {
    --ink: #12232e;
    --ink-soft: #3d5360;
    --paper: #f4efe4;
    --card: #fffaf1;
    --line: #d8cdb8;
    --teal: #1f6f6a;
    --teal-deep: #14524e;
    --amber: #d89011;
    --late: #b42318;
    --ok: #1b7a4a;
    --shadow: 0 18px 40px rgba(18, 35, 46, 0.08);
    --shell-max: 1280px;
    --shell-pad: 24px;
}

* { box-sizing: border-box; }
html {
    margin: 0;
    min-height: 100%;
    scrollbar-gutter: stable;
}
body {
    margin: 0;
    min-height: 100%;
    font-family: Manrope, sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, #ffe7b3 0%, transparent 50%),
        var(--paper);
    color: var(--ink);
}
a { color: var(--teal-deep); text-decoration: none; }
h1, h2, .brand span { font-family: Fraunces, Georgia, serif; }

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px max(var(--shell-pad), calc((100% - var(--shell-max)) / 2 + var(--shell-pad)));
    border-bottom: 1px solid var(--line);
    background: rgba(255, 250, 241, 0.86);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.25rem; }
.nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); font-weight: 600; }
.nav a:hover { color: var(--teal); }
.session { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 0.92rem; }
.session form { margin: 0; }
.linkish, button.linkish {
    background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; font-weight: 700;
}

.shell {
    width: min(var(--shell-max), calc(100% - (var(--shell-pad) * 2)));
    max-width: 100%;
    margin: 28px auto 64px;
}
.is-kiosk, .is-bare { background: var(--ink); color: var(--paper); }
.is-kiosk .shell, .is-bare .shell { width: min(720px, calc(100% - 24px)); margin: 40px auto; }

.hero, .card, .stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.hero { padding: 48px; display: grid; gap: 18px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0; line-height: 1.15; }
.landing-block { margin-top: 36px; }
.landing-block h2, .landing-cta h2 { margin: 8px 0 18px; font-size: 1.7rem; }
.landing-block h3, .card h3 { font-family: Fraunces, Georgia, serif; margin: 0 0 8px; }
.step {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ink); color: var(--paper);
    font-weight: 800; margin-bottom: 12px;
}
.app-card { min-height: 160px; }
.landing-cta {
    margin-top: 36px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hero p, .muted { color: var(--ink-soft); line-height: 1.6; }
.kicker { letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.75rem; color: var(--teal); font-weight: 700; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions.row-actions {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.note-input {
    width: 110px;
    min-width: 90px;
    padding: 8px 10px;
    border-radius: 10px;
}

.btn, button.btn, input[type=submit] {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; padding: 12px 20px;
    background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.amber { background: var(--amber); color: var(--ink); }
.btn.danger { background: var(--late); }

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.form-dense { gap: 12px 16px; align-items: start; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field > label { margin: 0 0 4px; font-size: 0.88rem; }
.field > .muted { margin: 4px 0 0; font-size: 0.8rem; line-height: 1.35; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field.span-4 { grid-column: span 4; }
/* Checkbox’ı yanındaki etiketli input ile hizala (label yüksekliği + gap) */
.field-check {
    display: flex;
    align-items: center;
    padding-top: calc(0.88rem + 4px);
    min-height: 0;
}
.field-check .check { margin: 0; }
.field-sm { max-width: 12rem; }
.field-md { max-width: 22rem; }
.form-card label:not(.check),
.settings-module-body > label:not(.check),
.settings-sub > label:not(.check) { margin-top: 10px; }
.form-card .grid + .grid,
.settings-module-body .grid + .grid { margin-top: 12px; }
.form-card input,
.form-card select,
.settings-module-body input,
.settings-module-body select { max-width: 100%; }
.license-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 20px;
}
.license-grid .check { margin-top: 8px; }
.stat, .card { padding: 22px; }
.stat b { display: block; font-size: 2rem; font-family: Fraunces, serif; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
th { color: var(--ink-soft); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table.dense th, table.dense td { padding: 8px 6px; font-size: 0.88rem; white-space: nowrap; }
.support-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px max(var(--shell-pad), calc((100% - var(--shell-max)) / 2 + var(--shell-pad)));
    background: #12232e; color: #f6f1e8; font-size: 0.92rem;
}
.support-banner .linkish { color: #f0c75e; }
.support-banner form { margin: 0; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }
label.check {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; margin-top: 16px;
}
label.check input { width: auto; margin: 0; }
input, select {
    width: 100%; padding: 12px 14px; border-radius: 14px;
    border: 1px solid var(--line); background: #fff; font: inherit;
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border: 0; background: transparent;
    color: var(--ink-soft); cursor: pointer; border-radius: 10px;
    display: grid; place-items: center; padding: 0;
}
.password-toggle:hover { color: var(--ink); background: #fff3d6; }
.flash { padding: 12px 14px; border-radius: 14px; background: #e8f6ee; color: var(--ok); }
.flash.bad { background: #fdecea; color: var(--late); }
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.module-tile {
    aspect-ratio: 1.15;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 16px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-weight: 700;
}
.module-tile span { display: block; margin-top: 6px; color: var(--ink-soft); font-weight: 500; font-size: 0.85rem; }

.settings-stack { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.settings-module {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: clip;
}
.settings-module-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 20px;
    background: #fbf8f1;
    list-style: none;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
}
.settings-module-head::-webkit-details-marker { display: none; }
.settings-module-head::marker { content: ""; }
.settings-module-head h2 { margin: 0; font-size: 1.1rem; }
.settings-module-head .module-toggle { margin: 0; white-space: nowrap; }
.settings-module[open] > .settings-module-head {
    border-bottom-color: var(--line);
}
.accordion-hint {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-soft);
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    min-width: 4.5rem;
    text-align: center;
}
.settings-module[open] .accordion-hint {
    background: #fff3d6;
    color: #8a6a10;
    border-color: #e8d4a0;
}
.settings-module-body { padding: 8px 22px 20px; }
.settings-module-body h3 {
    font-family: Manrope, system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 20px 0 6px;
    color: var(--ink);
}
.settings-module-body > .module-toggle { margin-top: 12px; }
.settings-sub {
    margin-top: 8px;
    padding-top: 4px;
    border-top: 1px dashed var(--line);
}
.settings-sub:first-of-type { border-top: 0; padding-top: 0; }
.module-status {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.module-status.on { background: #e8f6ee; color: var(--ok); }
.module-status.off { background: #eef2f4; color: var(--ink-soft); }
.module-status.locked { background: #fdecea; color: var(--late); }
.module-status.always { background: #fff3d6; color: #8a6a10; }
.settings-module.is-locked .settings-module-head { opacity: 0.92; }
.period-tabs .btn { padding: 8px 12px; font-size: 0.85rem; }
.year-filter {
    display: flex; align-items: center; gap: 10px;
}
.year-filter label {
    margin: 0; font-size: 0.88rem; white-space: nowrap;
}
.year-filter select {
    width: auto; min-width: 10rem; margin: 0; padding: 8px 12px;
}

.badge.in { background: #e8f6ee; color: var(--ok); }
.badge.out { background: #eef2f4; color: var(--ink-soft); }
.badge.late { background: #fdecea; color: var(--late); }
.badge.amber { background: #fff3d6; color: #8a6a10; }

.pin-overlay {
    position: fixed; inset: 0; background: rgba(18, 35, 46, 0.72);
    display: none; place-items: center; z-index: 20;
}
.pin-overlay.is-open { display: grid; }
.kicker#logoHit { cursor: default; user-select: none; }
.kiosk-wrap { text-align: center; color: var(--paper); }
.kiosk-wrap h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 8px; }
.qr-frame {
    margin: 24px auto; width: min(420px, 88vw); aspect-ratio: 1;
    background: #f6f1e8; border-radius: 28px; padding: 18px;
    display: grid; place-items: center;
}
.qr-frame svg { width: 100%; height: 100%; }
.clock { font-size: 1.4rem; letter-spacing: 0.08em; }

.login-card { width: min(440px, 100%); margin: 8vh auto; padding: 36px; }
.form-wrap { width: 100%; margin: 0; }
.form-card { width: 100%; }
.form-wrap h1 { margin-bottom: 6px; }
.form-card .grid { margin-top: 4px; }
.tr-date {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 10.5rem;
}
.tr-date-text {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    pointer-events: none;
}
.tr-date input[type=date] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}
.notice-list { display: grid; gap: 10px; }
.notice { padding: 12px 14px; border-radius: 14px; background: #fff6e0; border: 1px solid var(--line); }

@media (max-width: 900px) {
    .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field.span-3, .field.span-4 { grid-column: span 2; }
}
@media (max-width: 560px) {
    :root { --shell-pad: 16px; }
    .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
    .field.span-2, .field.span-3, .field.span-4 { grid-column: auto; }
    .license-grid { grid-template-columns: 1fr; }
    .topbar { flex-wrap: wrap; padding: 14px var(--shell-pad); }
    .hero { padding: 28px; }
    .landing-cta { flex-direction: column; align-items: flex-start; }
    .shell { margin: 20px auto 48px; }
}

@media print {
    .topbar, .no-print, .actions, .notice-list, .landing-cta .btn { display: none !important; }
    body { background: #fff; }
    .shell { width: 100%; margin: 0; }
    .hero, .card, .stat { box-shadow: none; break-inside: avoid; }
    a { color: inherit; }
}
