/* ===== Splash animation ===== */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #e9f2a4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-flag {
    width: min(200px, 50vw);
    height: min(110px, 28vw);
    border-radius: 4px;
    overflow: hidden;
    /* без білої обводки і тіні */
    box-shadow: none;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.35) rotate(-6deg);
    animation:
        flagIn 0.65s cubic-bezier(0.34, 1.35, 0.64, 1) 0.12s forwards,
        flagOut 0.4s ease 2.15s forwards;
}

.splash-flag-yellow {
    flex: 1;
    background: #FFD700;
    transform: translateY(-100%);
    animation: bandIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.18s forwards;
}

.splash-flag-blue {
    flex: 1;
    background: #0057B7;
    transform: translateY(100%);
    animation: bandIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.28s forwards;
}

/* Шрифт як на головній (Inter, не жирний) */
.splash-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(1.1rem, 3.2vw, 1.45rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #151515;
    opacity: 0;
    transform: translateY(10px);
    animation:
        titleIn 0.45s ease 0.5s forwards,
        titleOut 0.35s ease 2.2s forwards;
}

@keyframes flagIn {
    0% {
        opacity: 0;
        transform: scale(0.35) rotate(-6deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes flagOut {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(1.04);
    }
}

@keyframes bandIn {
    to { transform: translateY(0); }
}

@keyframes titleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes titleOut {
    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.page {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.page-visible {
    opacity: 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    overflow: hidden;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #e9f2a4;
    color: #1e1e1e;
    -webkit-font-smoothing: antialiased;
}

.page {
    display: flex;
    height: 100vh;
    width: 100%;
    background: #e9f2a4;
    overflow: hidden;
}

/* ===== ЛІВА ПАНЕЛЬ ===== */
.sidebar {
    width: 340px;
    flex-shrink: 0;
    padding: 20px 0 20px 20px;
    display: flex;
    height: 100%;
}

.sidebar-inner {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.scrollbar {
    width: 16px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 4px 0;
    height: 100%;
}
.scrollbar-track {
    width: 9px;
    height: 100%;
    background: #c2cbb0;
    border-radius: 20px;
    position: relative;
}
.scrollbar-thumb {
    width: 9px;
    height: 70px;
    background: #ffffff;
    border-radius: 20px;
    position: absolute;
    top: 14px;
    left: 0;
    cursor: grab;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    z-index: 2;
}
.scrollbar-thumb:hover { background: #f5f5f5; }
.scrollbar-thumb:active { cursor: grabbing; }

.side-card {
    flex: 0 0 auto;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 20px;
    border-radius: 28px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.25;
    letter-spacing: -0.02em;
    box-shadow: 0 3px 12px rgba(0,0,0,0.14);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.side-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    filter: brightness(1.05);
}

.card-brown   { background: #8B5E3C; }
.card-dark    { background: #4A3F35; }
.card-mustard { background: #C9A227; }
.card-blue    { background: #7BA3D4; }

/* ===== ПРАВА ЧАСТИНА ===== */
.main {
    flex: 1;
    min-width: 0;
    padding: 22px 24px 22px 14px;
    display: flex;
    height: 100%;
    overflow: hidden;
}
.main-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.title {
    font-size: clamp(1.55rem, 2.6vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #151515;
}

.flag {
    display: flex;
    flex-direction: column;
    width: 48px;
    height: 22px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    flex-shrink: 0;
}
.flag-yellow { flex: 1; background: #FFD700; }
.flag-blue   { flex: 1; background: #0057B7; }

.description {
    font-size: clamp(0.88rem, 1.2vw, 0.98rem);
    line-height: 1.5;
    color: #3d3d3d;
    max-width: 540px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.48rem 1.35rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: #222;
    background: #fff;
    border: 1.5px solid #c8c8c8;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    transition: all .15s;
    white-space: nowrap;
}
.btn:hover {
    background: #f5f5f5;
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
}

.accent-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #8B5E3C;
    margin-left: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    flex-shrink: 0;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
}
.accent-circle:hover {
    background: #7a5234;
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
    transform: scale(1.06);
}
.accent-circle:active {
    transform: scale(0.96);
}

/* Фото — квадратне, без закруглень, до кінця */
.photo-wrap {
    flex: 1 1 auto;
    width: 100%;
    aspect-ratio: 1 / 1;          /* квадрат */
    max-height: 100%;
    border-radius: 0;             /* без закруглень */
    overflow: hidden;
    background: #d0d8a0;
    min-height: 0;
}
.city-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* ===== Responsive — однакова логіка на всіх екранах ===== */
@media (max-width: 1000px) {
    .sidebar { width: 280px; padding: 14px 0 14px 12px; }
    .side-card { height: 130px; font-size: 1.05rem; border-radius: 22px; }
    .main { padding: 16px 16px 16px 10px; }
}

@media (max-width: 750px) {
    html, body { overflow: auto; }
    .page {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        padding: 12px 12px 8px;
        order: 2;
        height: auto;
    }
    .sidebar-inner { height: auto; }
    .sidebar-scroll {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding-right: 0;
        overflow: visible;
        height: auto;
    }
    .scrollbar { display: none; }
    .side-card {
        height: 72px;
        font-size: 0.92rem;
        border-radius: 16px;
        padding: 12px 8px;
    }
    .main {
        order: 1;
        padding: 14px 12px 8px;
        height: auto;
        overflow: visible;
    }
    .main-inner {
        overflow: visible;
        height: auto;
    }
    .title { font-size: 1.45rem; }
    .flag { width: 40px; height: 18px; }
    .description { font-size: 0.88rem; }
    .btn { padding: 0.45rem 1.15rem; font-size: 0.88rem; }
    .accent-circle { width: 34px; height: 34px; }

    /* На мобільному квадрат теж, але обмежений */
    .photo-wrap {
        flex: none;
        width: 100%;
        aspect-ratio: 1 / 1;
        max-height: 70vw;
        border-radius: 0;
    }
}

@media (max-width: 400px) {
    .sidebar-scroll { grid-template-columns: 1fr; }
    .side-card { height: 64px; }
    .actions { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    .accent-circle { display: block; align-self: center; }
}


/* ===== Службовий вхід (прихований за коричневим кружком) ===== */
.staff-login {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.staff-login[hidden] {
    display: none !important;
}
.staff-login-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 14, 0.45);
}
.staff-login-box {
    position: relative;
    z-index: 1;
    width: min(380px, 100%);
    background: #f7f6f2;
    border: 1px solid rgba(80, 60, 40, 0.2);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.22);
    overflow: hidden;
}
.staff-login-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    background: linear-gradient(180deg, #9a6b48 0%, #8B5E3C 100%);
    color: #fff;
}
.staff-login-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.staff-login-sub {
    font-size: 0.68rem;
    opacity: 0.88;
    margin-top: 2px;
    line-height: 1.35;
}
.staff-login-x {
    border: none;
    background: rgba(255,255,255,0.18);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}
.staff-login-x:hover {
    background: rgba(255,255,255,0.28);
}
.staff-login-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px 16px;
}
.staff-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #333;
    margin-top: 6px;
}
.staff-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(80,60,40,0.2);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    outline: none;
}
.staff-input:focus {
    border-color: #8B5E3C;
    box-shadow: 0 0 0 2px rgba(139,94,60,0.2);
}
.staff-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}
.staff-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.staff-btn-ghost {
    background: transparent;
    color: #555;
    border: 1px solid rgba(80,60,40,0.2);
}
.staff-btn-ghost:hover {
    background: rgba(0,0,0,0.04);
}
.staff-btn-primary {
    background: #8B5E3C;
    color: #fff;
}
.staff-btn-primary:hover {
    background: #7a5234;
}
.staff-status {
    font-size: 0.78rem;
    padding: 8px 10px;
    border-radius: 8px;
    margin-top: 8px;
}
.staff-status.is-err {
    background: rgba(180,60,60,0.1);
    color: #8b2020;
    border: 1px solid rgba(180,60,60,0.25);
}
.staff-status.is-wait {
    background: rgba(139,94,60,0.1);
    color: #5a4030;
    border: 1px solid rgba(139,94,60,0.25);
}
.staff-status.is-ok {
    background: rgba(60,140,70,0.1);
    color: #2a6b2a;
    border: 1px solid rgba(60,140,70,0.25);
}
