/* Administrace — Stodola Lesůňky */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600&family=Inter:wght@400;500;600&display=swap');

:root {
    --barn: #241E17;
    --plaster: #F6F1E6;
    --moss: #656F4C;
    --moss-dark: #454C34;
    --brick: #93502F;
    --candle: #CC9A3E;
    --candle-soft: #E7C77C;
    --ink: #2B2620;
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --line: #E4DDCC;
    --danger: #A23B2B;
    --success: #4C6B3C;
}

* { box-sizing: border-box; }
body.admin {
    margin: 0;
    font-family: var(--sans);
    background: var(--plaster);
    color: var(--ink);
    min-height: 100vh;
}

a { color: inherit; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--barn);
    color: rgba(255,255,255,.85);
    padding: 26px 18px;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
}
.admin-sidebar .brand {
    font-family: var(--serif);
    color: #fff;
    font-size: 1.15rem;
    padding: 0 10px 20px;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 18px;
}
.admin-sidebar .brand span { color: var(--candle-soft); }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 4px;
    font-size: .92rem;
    font-weight: 500;
    margin-bottom: 2px;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); }
.admin-nav a.active { background: var(--candle); color: var(--barn); font-weight: 600; }
.admin-nav .divider { height: 1px; background: rgba(255,255,255,.12); margin: 14px 4px; }
.admin-sidebar .logout { display: block; margin-top: 20px; padding: 11px 12px; font-size: .85rem; color: rgba(255,255,255,.55); }
.admin-sidebar .logout:hover { color: #fff; }

.admin-mobile-topbar { display: none; }
.admin-bottom-nav { display: none; }

.admin-main { flex: 1; margin-left: 230px; padding: 36px 44px; max-width: 1100px; }

@media (max-width: 900px) {
    .admin-shell { display: block; }
    .admin-sidebar { display: none; }

    .admin-mobile-topbar {
        display: flex; align-items: center; justify-content: space-between;
        background: var(--barn); color: #fff; padding: 16px 18px;
        position: sticky; top: 0; z-index: 20;
    }
    .admin-mobile-topbar .brand { font-family: var(--serif); font-size: 1.1rem; color: #fff; }
    .admin-mobile-topbar .brand span { color: var(--candle-soft); }
    .mobile-topbar-actions { display: flex; gap: 10px; }
    .mobile-topbar-actions a {
        width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        background: rgba(255,255,255,.1); color: #fff; font-size: 1rem; text-decoration: none;
    }
    .mobile-topbar-actions a:hover { background: rgba(255,255,255,.18); }

    .admin-main { margin-left: 0; padding: 22px 16px 100px; max-width: 100%; }

    .admin-bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: #fff; border-top: 1px solid var(--line);
        box-shadow: 0 -4px 16px rgba(36,30,23,.06);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .admin-bottom-nav::-webkit-scrollbar { display: none; }
    .admin-bottom-nav a {
        flex: 0 0 auto; min-width: 68px; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 7px 8px; border-radius: 10px; text-decoration: none;
        color: #8a8069; font-size: .62rem; font-weight: 600;
    }
    .admin-bottom-nav a .icon { font-size: 1.15rem; line-height: 1; }
    .admin-bottom-nav a .label { white-space: nowrap; }
    .admin-bottom-nav a.active { color: var(--brick); background: var(--plaster); }
}

.admin-topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; flex-wrap: wrap; gap: 14px;
}
.admin-topbar h1 { font-family: var(--serif); font-size: 1.9rem; margin: 0; color: var(--barn); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 4px;
    font-family: var(--sans); font-weight: 600; font-size: .88rem;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    transition: transform .2s ease, background .2s ease;
}
.btn-primary { background: var(--candle); color: var(--barn); }
.btn-primary:hover { background: var(--candle-soft); }
.btn-outline { border-color: var(--barn); color: var(--barn); background: #fff; }
.btn-outline:hover { background: var(--plaster); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 26px 28px;
    margin-bottom: 24px;
}
.panel h2 { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 18px; color: var(--barn); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 18px; margin-bottom: 30px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; transition: transform .15s ease, box-shadow .15s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(36,30,23,.08); }
.stat-card .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brick); font-weight: 600; margin-bottom: 8px; }
.stat-card .value { font-family: var(--serif); font-size: 1.7rem; color: var(--barn); }

table.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th {
    text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--brick); font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--line);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:hover td { background: #fbf8f1; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 600; }
.badge-new { background: #eef1e6; color: var(--moss-dark); }
.badge-confirmed { background: #e3edd8; color: var(--success); }
.badge-rejected { background: #f6e3dd; color: var(--danger); }
.badge-paid { background: #e3edd8; color: var(--success); }
.badge-unpaid { background: #fbf3e0; color: #8a6413; }

label { display: block; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; color: var(--moss-dark); font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid #d9d0ba; border-radius: 4px;
    font-family: var(--sans); font-size: .94rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--candle); outline-offset: 1px; }
textarea { resize: vertical; min-height: 90px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1/-1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.alert { padding: 14px 18px; border-radius: 5px; margin-bottom: 20px; font-size: .92rem; }
.alert-success { background: #eaf0e2; color: var(--moss-dark); border: 1px solid #cdd9bd; }
.alert-error { background: #fbeae4; color: #8a3a20; border: 1px solid #f0c9b8; }
.alert-warning { background: #fbf3e0; color: #8a6413; border: 1px solid #eddca0; }

.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--barn); padding: 20px;
}
.login-box { background: #fff; border-radius: 8px; padding: 44px 40px; width: 100%; max-width: 380px; }
.login-box .brand { font-family: var(--serif); font-size: 1.5rem; color: var(--barn); text-align: center; display: block; margin-bottom: 26px; }
.login-box .brand span { color: var(--brick); }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: #8a8069; font-size: .88rem; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------------------------------- SEZONNI KALENDAR (admin) — moderni styl --------------------------------- */
.season-nav { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 28px; }
.season-year { font-family: var(--serif); font-weight: 600; font-size: 1.8rem; color: var(--barn); min-width: 84px; text-align: center; }
.season-arrow {
    width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: var(--barn);
    text-decoration: none; box-shadow: 0 1px 2px rgba(36,30,23,.06);
    transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.season-arrow:hover { background: var(--barn); color: #fff; border-color: var(--barn); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(36,30,23,.18); }

.season-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-bottom: 22px; }
.month-card { background: #fff; border: 1px solid #EFE9DA; border-radius: 16px; padding: 20px 18px 22px; box-shadow: 0 1px 3px rgba(36,30,23,.05); }
.month-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 16px 4px; color: var(--barn); text-align: left; font-family: var(--serif); }

table.month-table { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.month-table th { font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; color: #a89e88; font-weight: 700; padding-bottom: 8px; text-align: center; }
.month-table th.we { color: var(--brick); }

.month-table td {
    text-align: center; padding: 0; height: 36px; position: relative; border: none; border-radius: 9px;
    font-size: .8rem; font-weight: 500; color: var(--ink); background: transparent;
    transition: background .15s ease;
}
.month-table td.muted { color: #ddd4bf; }
.month-table td:not(.muted):not(.day-booked):not(.day-pending):hover { background: var(--plaster); }
.month-table td.today { box-shadow: inset 0 0 0 1.5px var(--candle); font-weight: 700; }

.day-cell .day-num { display: block; line-height: 1; padding-top: 10px; }
.day-cell .day-label { display: block; font-size: .5rem; line-height: 1; padding: 2px 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }

.day-booked { background: linear-gradient(135deg, #E8998A, #D97F6E) !important; color: #fff !important; font-weight: 700; }
.day-pending { background: linear-gradient(135deg, #F3CF6E, #EAB94A) !important; color: #5c4a11 !important; font-weight: 700; }
.day-ubytovani { background: linear-gradient(135deg, #7FA0C4, #5A7FA6) !important; color: #fff !important; font-weight: 700; }
.day-booked:hover, .day-pending:hover, .day-ubytovani:hover { filter: brightness(1.06); }

.day-cell a { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; border-radius: 9px; }
.add-link .add-plus {
    position: absolute; top: 2px; right: 4px; font-size: .6rem; color: var(--candle); opacity: 0;
    transition: opacity .15s ease;
}
.month-table td:hover .add-plus { opacity: 1; }

.season-legend { display: flex; gap: 22px; justify-content: center; margin: 4px 0 8px; flex-wrap: wrap; }
.season-legend .item { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: #5c5340; }
.season-legend .swatch { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.season-legend .swatch.booked { background: linear-gradient(135deg, #E8998A, #D97F6E); }
.season-legend .swatch.pending { background: linear-gradient(135deg, #F3CF6E, #EAB94A); }
.season-legend .swatch.external { background: linear-gradient(135deg, #7FA0C4, #5A7FA6); }
.season-legend .swatch.free { background: #fff; border: 1px solid #e0d8c4; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1.is-visible { transition-delay: .06s; }
.reveal-delay-2.is-visible { transition-delay: .12s; }
.reveal-delay-3.is-visible { transition-delay: .18s; }

/* ---------------------------------- RESPONSIVE (mobil) --------------------------------- */
@media (max-width: 760px) {
    .admin-topbar h1 { font-size: 1.5rem; }
    .panel { padding: 18px 16px; }
    table.data-table { display: block; overflow-x: auto; white-space: nowrap; }
    .season-grid { grid-template-columns: 1fr; }
    .month-table td { height: 32px; font-size: .74rem; }
    .day-cell .day-num { padding-top: 8px; }
    .day-cell .day-label { display: none; }
    .login-box { padding: 32px 24px; }
    .stat-cards { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); }
}
