@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #eef2f0;
    --panel: #ffffff;
    --panel-soft: #f8faf9;
    --text: #111827;
    --muted: #667085;
    --line: #d9e1de;
    --line-strong: #c8d2ce;
    --accent: #18785b;
    --accent-dark: #0f5b43;
    --accent-soft: #e7f4ef;
    --warn: #b54708;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
    --shadow-soft: 0 8px 24px rgba(16, 24, 40, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0) 240px),
        var(--bg);
    color: var(--text);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

body.embed {
    background: transparent;
    display: flow-root;
}

a {
    color: var(--accent);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(217, 225, 222, 0.8);
    backdrop-filter: blur(14px);
}

.brand {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.topbar nav a {
    color: #344054;
    border-radius: 999px;
    padding: 8px 12px;
    text-decoration: none;
    font-weight: 700;
    transition: background 140ms ease, color 140ms ease;
}

.topbar nav a:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.page {
    width: min(1180px, calc(100% - 36px));
    margin: 28px auto;
}

.embed .page {
    width: 100%;
    margin: 0;
    display: flow-root;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 18px;
    align-items: start;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
    gap: 18px;
    align-items: start;
}

.admin-main,
.admin-side {
    display: grid;
    gap: 18px;
}

.panel,
.calendar-shell {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
}

.panel {
    padding: 20px;
}

.calendar-shell {
    overflow: hidden;
}

.embed .panel,
.embed .calendar-shell {
    border-radius: 0;
    border: 0;
    box-shadow: none;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfcfc);
    border-bottom: 1px solid var(--line);
}

.calendar-toolbar h1 {
    margin: 0;
    color: #0f172a;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.icon-button,
button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--accent);
    border-radius: 9px;
    padding: 10px 15px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.icon-button {
    width: 44px;
    padding: 0;
    font-size: 30px;
    line-height: 1;
}

button:hover,
.button:hover,
.icon-button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
    box-shadow: 0 8px 18px rgba(24, 120, 91, 0.22);
    transform: translateY(-1px);
}

.button.secondary {
    border-color: var(--line-strong);
    background: #fff;
    color: var(--text);
}

.button.secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

button:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(24, 120, 91, 0.22);
    outline-offset: 2px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border-top: 0;
}

.weekday,
.day {
    background: #fff;
    min-width: 0;
}

.weekday {
    padding: 13px 8px;
    text-align: center;
    color: #667085;
    background: #fbfcfc;
    font-size: 0.92rem;
    font-weight: 800;
}

.day {
    position: relative;
    min-height: 122px;
    padding: 10px;
    transition: background 140ms ease;
}

.day:hover {
    background: #fcfefd;
}

.day strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
}

.compact .day {
    min-height: 96px;
}

.embed .compact .calendar-toolbar {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
    padding: 10px 12px;
}

.embed .compact .calendar-toolbar h1 {
    font-size: 1.08rem;
}

.embed .compact .icon-button {
    width: 38px;
    min-height: 38px;
    border-radius: 8px;
    font-size: 25px;
}

.embed .compact .weekday {
    padding: 7px 4px;
    font-size: 0.76rem;
}

.embed .compact .day {
    min-height: 66px;
    padding: 5px;
}

.embed .compact .day strong {
    min-width: 22px;
    height: 22px;
    font-size: 0.82rem;
}

.embed .compact .booking {
    margin-top: 5px;
    padding: 5px 6px;
    border-left-width: 3px;
    border-radius: 6px;
    font-size: 0.72rem;
}

.muted {
    background: var(--panel-soft);
    color: var(--muted);
}

.muted strong {
    color: var(--muted);
}

.booking {
    display: grid;
    gap: 2px;
    margin-top: 8px;
    padding: 7px 8px;
    border-left: 4px solid var(--accent);
    border-radius: 7px;
    background: var(--accent-soft);
    color: #164b38;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(24, 120, 91, 0.08);
}

.booking.blocked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border-left: 0;
    background: #fee4e2;
    color: #b42318;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.16);
}

.booking small {
    color: #48665c;
    font-weight: 600;
}

button.booking {
    width: 100%;
    min-height: 26px;
    padding: 7px 8px;
    font-family: inherit;
    line-height: 1.2;
}

.popup-box {
    position: absolute;
    left: 50%;
    top: 72px;
    z-index: 20;
    width: min(330px, calc(100% - 28px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    transform: translateX(-50%);
}

.popup-box[hidden] {
    display: none;
}

.popup-box h2 {
    margin: 0 0 7px;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.25;
}

.popup-box p:last-child {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.popup-close {
    width: 100%;
    min-height: 38px;
    margin-top: 14px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
    transform: none;
}

.popup-close:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
    box-shadow: none;
    transform: none;
}

.popup-close:focus-visible {
    outline: 2px solid rgba(24, 120, 91, 0.26);
    outline-offset: 2px;
}

.form {
    display: grid;
    gap: 14px;
}

.form h1,
.form h2,
.panel h1,
.panel h2 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
}

.admin-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(24, 120, 91, 0.08), rgba(255, 255, 255, 0.78)),
        rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.admin-hero h1 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
}

.admin-hero p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.stat-card {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid rgba(24, 120, 91, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.stat-card span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.stat-card strong {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.1;
}

.admin-section {
    overflow: hidden;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.request-list {
    display: grid;
    gap: 12px;
}

.request-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.request-card h3 {
    margin: 8px 0 4px;
    color: #0f172a;
    font-size: 1.02rem;
}

.request-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.muted-text {
    margin-top: 8px !important;
    font-size: 0.9rem;
}

.contact-box {
    display: grid;
    gap: 3px;
    padding: 12px;
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--muted);
    font-weight: 700;
}

.contact-box strong {
    color: var(--text);
}

.empty-state {
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--panel-soft);
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.admin-form {
    gap: 12px;
}

.admin-form h2 {
    margin-top: -4px;
}

.accordion-panel {
    padding: 0;
    overflow: hidden;
}

.accordion-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.accordion-panel > summary::-webkit-details-marker {
    display: none;
}

.accordion-panel > summary::after {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 1.25rem;
    font-weight: 800;
}

.accordion-panel[open] > summary {
    border-bottom: 1px solid var(--line);
}

.accordion-panel[open] > summary::after {
    content: "-";
}

.accordion-panel small {
    display: block;
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.accordion-panel strong {
    display: block;
    color: #0f172a;
    font-size: 1.08rem;
}

.accordion-panel .form {
    padding: 18px 20px 20px;
}

.edit-form {
    max-width: 860px;
}

.user-list {
    display: grid;
    gap: 12px;
}

.user-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.45fr) minmax(210px, 0.5fr) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 800;
}

.user-identity h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
}

.user-identity p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.inline-form {
    display: grid;
    gap: 8px;
}

.inline-form label {
    display: grid;
    gap: 6px;
    color: #1d2939;
    font-size: 0.84rem;
    font-weight: 800;
}

.inline-form button,
.user-card > form > button {
    width: 100%;
}

.help-card {
    display: grid;
    gap: 8px;
}

.help-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.help-card strong {
    color: var(--text);
}

.form label {
    display: grid;
    gap: 7px;
    color: #1d2939;
    font-size: 0.92rem;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 11px 12px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-weight: 600;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
    color: #8a94a3;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #b9c5c0;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(24, 120, 91, 0.08);
}

textarea {
    resize: vertical;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.notice {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(24, 120, 91, 0.18);
    border-left: 5px solid var(--accent);
    border-radius: 10px;
    background: var(--accent-soft);
    color: #164b38;
    font-weight: 700;
}

.notice.warn {
    border-color: rgba(181, 71, 8, 0.22);
    border-left-color: var(--warn);
    background: #fff4e5;
    color: #7a2e0e;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.table th,
.table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: #475467;
    background: var(--panel-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.table tr:last-child td {
    border-bottom: 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 9px;
    background: #fff4e5;
    color: #93370d;
    font-size: 0.78rem;
    font-weight: 800;
}

.status.confirmed {
    background: #fee4e2;
    color: #b42318;
}

.status.locked {
    background: #ffe4e8;
    color: #a1102b;
}

.danger {
    border-color: var(--danger);
    background: var(--danger);
}

.danger:hover {
    border-color: #8f1d13;
    background: #8f1d13;
    box-shadow: 0 8px 18px rgba(180, 35, 24, 0.18);
}

.embed-code {
    width: 100%;
    min-height: 82px;
    font-family: Consolas, "Liberation Mono", monospace;
    font-weight: 500;
}

.embed-stack {
    display: grid;
    gap: 14px;
}

@media (min-width: 980px) {
    .page > .form .grid-2,
    .embed .form .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .layout,
    .admin-layout,
    .admin-hero {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .request-card {
        grid-template-columns: 1fr;
    }

    .user-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .calendar {
        overflow-x: auto;
        grid-template-columns: repeat(7, minmax(112px, 1fr));
    }

    .embed .compact .calendar {
        overflow-x: visible;
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .page {
        width: min(100% - 22px, 680px);
        margin: 18px auto;
    }
}

@media (max-width: 430px) {
    body {
        font-size: 14px;
    }

    .embed .compact .calendar-toolbar {
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        gap: 6px;
        padding: 8px 6px;
    }

    .embed .compact .calendar-toolbar h1 {
        font-size: 0.96rem;
    }

    .embed .compact .icon-button {
        width: 32px;
        min-height: 32px;
        border-radius: 7px;
        font-size: 21px;
    }

    .embed .compact .weekday {
        padding: 6px 1px;
        font-size: 0.62rem;
    }

    .embed .compact .day {
        min-height: 50px;
        padding: 3px;
    }

    .embed .compact .day strong {
        min-width: 18px;
        height: 18px;
        font-size: 0.68rem;
    }

    .embed .compact .booking {
        overflow: hidden;
        margin-top: 3px;
        padding: 3px;
        font-size: 0.56rem;
        line-height: 1.15;
    }

    .embed .compact .booking.blocked {
        min-height: 18px;
        padding: 3px 2px;
        font-size: 0.5rem;
        letter-spacing: 0;
    }

    .embed .form,
    .embed .panel {
        padding: 14px;
    }

    .embed .form {
        gap: 11px;
    }

    .embed .form label {
        font-size: 0.84rem;
    }

    .embed input,
    .embed textarea,
    .embed select {
        min-height: 42px;
        padding: 10px;
        font-size: 16px;
    }

    .embed textarea {
        min-height: 96px;
    }

    .embed button {
        width: 100%;
        min-height: 46px;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .actions .button,
    .actions button,
    .actions form {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .embed .compact .calendar-toolbar h1 {
        font-size: 0.9rem;
    }

    .embed .compact .day {
        min-height: 46px;
        padding: 2px;
    }

    .embed .compact .booking.blocked {
        font-size: 0.46rem;
    }
}
