:root {
    --ink: #172033;
    --muted: #697386;
    --line: #e3e8ef;
    --panel: #ffffff;
    --page: #f4f7fb;
    --primary: #0e7490;
    --primary-dark: #0b5f75;
    --success-bg: #ecfdf5;
    --success-ink: #047857;
    --danger-bg: #fef2f2;
    --danger-ink: #b91c1c;
    --info-bg: #eff6ff;
    --info-ink: #1d4ed8;
    --shadow: 0 18px 45px rgba(22, 32, 51, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.header-inner {
    max-width: 1560px;
    min-height: 70px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.site-subtitle { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
.header-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    background: #fff;
}
.header-link:hover { border-color: var(--primary); color: var(--primary); }

.page-shell { max-width: 1560px; margin: 0 auto; padding: 28px 24px 42px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.page-intro h1 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.page-intro p { margin: 7px 0 0; color: var(--muted); }
.map-note { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }

.map-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.map-scroll { overflow-x: auto; padding: 12px; background: #edf2f7; }
.map-canvas {
    position: relative;
    width: 100%;
    min-width: 1180px;
    max-width: 1561px;
    margin: 0 auto;
    line-height: 0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .18);
}
.map-image { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.stand-hotspot {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: #fff;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.stand-hotspot:hover,
.stand-hotspot:focus-visible {
    z-index: 5;
    border-color: #fff;
    background: rgba(15, 23, 42, .20);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .62);
    outline: none;
}
.stand-hotspot:focus-visible { box-shadow: 0 0 0 3px #f8fafc, 0 0 0 5px var(--primary); }
.generated-stand-label {
    display: block;
    width: 100%;
    padding: 0 1px;
    overflow: visible;
    color: #fff;
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .60);
    pointer-events: none;
    white-space: nowrap;
}

.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 16px 18px; border-top: 1px solid var(--line); color: #475569; font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 13px; height: 13px; border-radius: 2px; }
.swatch-a { background: #d53738; }
.swatch-b { background: #2cc6bf; }
.swatch-c { background: #383fd1; }
.swatch-d { background: #7b3b00; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
}
.modal-backdrop.is-open { display: flex; }
.modal-panel {
    width: min(100%, 520px);
    max-height: min(720px, calc(100vh - 40px));
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .35);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.modal-kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.modal-title { margin: 1px 0 0; font-size: 24px; letter-spacing: -.03em; }
.modal-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: #475569; font-size: 22px; line-height: 1; }
.modal-close:hover { border-color: #94a3b8; background: #f8fafc; }
.modal-content { padding: 22px; }
.info-list { display: grid; gap: 16px; margin: 0; }
.info-row { padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.info-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.info-value { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-copy { color: var(--muted); font-style: italic; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-bos { background: #e2e8f0; color: #475569; }
.status-rezerve { background: #fef3c7; color: #92400e; }
.status-dolu { background: #dcfce7; color: #166534; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    transition: transform .14s ease, background-color .14s ease, border-color .14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.btn-secondary { border-color: var(--line); background: #fff; color: #334155; }
.btn-secondary:hover { border-color: #94a3b8; }
.btn-danger { border-color: #dc2626; background: #dc2626; color: #fff; }
.btn-block { width: 100%; }

.form-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 800; }
.form-grid input,
.form-grid textarea,
.form-grid select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    outline: none;
}
.form-grid input,
.form-grid select { min-height: 44px; padding: 0 12px; }
.form-grid textarea { min-height: 128px; padding: 11px 12px; resize: vertical; }
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .14); }
.full-field { grid-column: 1 / -1; }

.alert { margin: 18px 0; padding: 14px 16px; border-radius: 12px; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success-ink); }
.alert-danger { background: var(--danger-bg); color: var(--danger-ink); }
.alert-info { background: var(--info-bg); color: var(--info-ink); }

.setup-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at top, #dff4f3 0, #f4f7fb 42%, #eef2f7 100%); }
.setup-shell { width: min(100%, 720px); }
.setup-card { padding: 34px; border: 1px solid rgba(203, 213, 225, .9); border-radius: 20px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 900; }
.eyebrow { margin: 20px 0 4px; color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.setup-card h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.setup-card h2 { margin: 28px 0 14px; font-size: 16px; }
.setup-intro, .setup-note { color: var(--muted); }
.setup-form { margin-top: 22px; }
.setup-form .btn-block { margin-top: 24px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.setup-note { margin: 18px 0 0; font-size: 13px; }
.setup-note code { padding: 2px 5px; border-radius: 4px; background: #eef2f7; color: #334155; }
.desktop-spacer { display: block; }

@media (max-width: 700px) {
    .header-inner, .page-shell { padding-left: 16px; padding-right: 16px; }
    .header-inner { min-height: 62px; }
    .site-title { font-size: 17px; }
    .site-subtitle { display: none; }
    .page-shell { padding-top: 20px; }
    .page-intro { display: block; }
    .map-note { margin-top: 10px; white-space: normal; }
    .map-scroll { padding: 8px; }
    .map-canvas { min-width: 1180px; }
    .setup-body { padding: 14px; }
    .setup-card { padding: 24px 18px; border-radius: 16px; }
    .two-columns { grid-template-columns: 1fr; }
    .full-field { grid-column: auto; }
    .desktop-spacer { display: none; }
    .modal-backdrop { padding: 12px; }
    .modal-content { padding: 18px; }
}
