:root {
    --bg: #dfe6d8;
    --panel: rgba(250, 251, 246, 0.96);
    --panel-strong: #f5f7ef;
    --text: #13362b;
    --muted: #5f705f;
    --accent: #0d5f41;
    --accent-2: #6f8d61;
    --accent-3: #d5ddc7;
    --topbar-bg: #0d5f41;
    --topbar-text: #f3f5ec;
    --line: rgba(13, 95, 65, 0.18);
    --calendar-line: rgba(13, 95, 65, 0.34);
    --shadow: 0 28px 64px rgba(10, 55, 38, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(13, 95, 65, 0.22), transparent 28%),
        radial-gradient(circle at bottom right, rgba(111, 141, 97, 0.24), transparent 32%),
        linear-gradient(140deg, #edf2e7 0%, #dde7d8 100%);
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 28px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(13, 95, 65, 0.98), rgba(24, 88, 62, 0.98));
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    overflow: visible;
    position: relative;
    z-index: 2;
}

.topbar-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 14px;
    flex-wrap: wrap;
}

.page-content {
    clear: both;
    display: grid;
    gap: 24px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-width: 132px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(132px, 14vw, 150px);
    height: auto;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(250, 251, 246, 0.96);
    border: 0;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(10, 55, 38, 0.16);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: auto;
}

.brand {
    display: flex;
    align-items: center;
    color: var(--topbar-text);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    max-width: 100%;
    gap: 7px;
    flex: 1 1 560px;
    flex-wrap: wrap;
    min-width: 260px;
}

.nav a,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px !important;
    padding: 12px 20px !important;
    border-radius: 16px !important;
    color: var(--topbar-text) !important;
    text-decoration: none !important;
    font-size: 1.22rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    background: rgba(243, 245, 236, 0.08) !important;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-live {
    min-width: 0 !important;
}

.nav-live a,
.nav-live button {
    flex: 0 1 auto;
    max-width: 100%;
}

.nav a:hover,
.link-button:hover {
    color: #ffffff !important;
    background: rgba(243, 245, 236, 0.22) !important;
    box-shadow: 0 8px 18px rgba(10, 55, 38, 0.16) !important;
    transform: translateY(-1px);
}

.nav .nav-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(243, 245, 236, 0.24) !important;
    background: rgba(243, 245, 236, 0.12) !important;
}

.nav .nav-action:hover {
    background: rgba(243, 245, 236, 0.22);
    color: #ffffff;
}

.inline-form {
    margin: 0;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(13, 95, 65, 0.12), transparent 45%),
        linear-gradient(315deg, rgba(111, 141, 97, 0.18), transparent 55%);
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--accent-2);
}

h1 {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    line-height: 0.98;
    max-width: 12ch;
}

.lead {
    margin: 20px 0 0;
    max-width: 58ch;
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--muted);
}

.hero-actions {
    margin-top: 28px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), #8da07e);
}

.panel.inset {
    background: var(--panel-strong);
    box-shadow: none;
}

.panel.narrow {
    max-width: 520px;
    margin: 0 auto;
}

.dashboard-panel {
    margin-top: 0;
    clear: both;
}

.flash {
    margin-bottom: 20px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.flash-success {
    background: rgba(13, 106, 79, 0.12);
}

.flash-error {
    background: rgba(126, 46, 46, 0.1);
}

.inline-note {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(13, 95, 65, 0.08);
    color: var(--text);
}

.inline-note strong {
    color: var(--accent);
}

.top-shift-form {
    max-width: 720px;
    margin-bottom: 24px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    border: 0;
}

.calendar-table-head {
    display: flex;
    justify-content: flex-end;
    padding: 12px 12px 0;
}

.calendar-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(10, 55, 38, 0.08);
}

.week-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    background: transparent;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.week-link:hover {
    background: rgba(13, 95, 65, 0.09);
    transform: translateY(-1px);
}

.week-link-current {
    background: linear-gradient(135deg, rgba(13, 95, 65, 0.96), rgba(24, 88, 62, 0.96));
    color: #f3f5ec;
    box-shadow: 0 10px 20px rgba(13, 95, 65, 0.22);
}

.week-link-current:hover {
    background: linear-gradient(135deg, rgba(13, 95, 65, 0.96), rgba(24, 88, 62, 0.96));
    color: #f3f5ec;
}

.week-link-prev::before {
    content: "<";
    margin-right: 8px;
    font-weight: 700;
}

.week-link-next::after {
    content: ">";
    margin-left: 8px;
    font-weight: 700;
}

.calendar-wrapper {
    overflow-x: hidden;
    padding-bottom: 8px;
}

.calendar-table-wrap {
    width: 100%;
    border: 1px solid var(--calendar-line);
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(244, 248, 239, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.calendar-table thead th {
    padding: 14px 10px;
    border-right: 1px solid var(--calendar-line);
    border-bottom: 2px solid var(--calendar-line);
    background: linear-gradient(180deg, rgba(13, 95, 65, 0.2), rgba(111, 141, 97, 0.16));
    vertical-align: bottom;
}

.calendar-table thead th:last-child {
    border-right: 0;
}

.calendar-table thead th strong,
.calendar-table thead th span {
    display: block;
}

.calendar-hour-head,
.calendar-hour {
    text-align: center;
    font-weight: 700;
    color: var(--accent);
    background: rgba(232, 238, 224, 0.98);
    width: 64px;
}

.calendar-table thead th strong {
    color: var(--accent);
    font-size: 0.84rem;
}

.calendar-table thead th span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 400;
}

.calendar-hour {
    height: 52px;
    padding: 12px 4px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--calendar-line);
    border-right: 2px solid var(--calendar-line);
}

.calendar-table tbody td {
    height: 52px;
    border-right: 1px solid var(--calendar-line);
    border-bottom: 1px solid var(--calendar-line);
    background: #fbfcf7;
    position: relative;
}

.calendar-table tbody tr:nth-child(even) td {
    background: #f4f8ef;
}

.calendar-table tbody tr:last-child th,
.calendar-table tbody tr:last-child td {
    border-bottom: 0;
}

.calendar-table tbody td:last-child {
    border-right: 0;
}

.calendar-cell-filled {
    vertical-align: top;
    padding: 4px 6px;
}

.calendar-slot-form {
    display: block;
    width: 22px;
    max-width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 0 auto;
}

.calendar-slot {
    display: block;
    align-items: center;
    justify-content: center;
    height: 22px;
    min-height: 22px;
    width: 22px;
    min-width: 22px;
    max-width: 22px;
    padding: 0;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    font: inherit;
    font-size: 0;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.calendar-slot span {
    display: block;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-slot:hover {
    filter: brightness(0.98);
}

.calendar-slot.is-open {
    background: linear-gradient(135deg, #8fbd72, #5f9345) !important;
    color: #102f1f !important;
}

.calendar-slot.is-registered {
    background: linear-gradient(135deg, #b84d4d, #8f3030) !important;
    color: #fff7f7 !important;
}

.calendar-slot.is-full {
    background: linear-gradient(135deg, #b84d4d, #8f3030) !important;
    color: #fff7f7 !important;
    cursor: default;
}

.calendar-slot.is-past {
    background: linear-gradient(135deg, #b8beb8, #858d85) !important;
    color: #f7f8f7 !important;
    cursor: default;
    filter: none;
}


.calendar-shift-label {
    font-size: 0.54rem;
    line-height: 1;
    letter-spacing: 0;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
    transform: rotate(-90deg);
    white-space: nowrap;
}

.cell-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.cell-form-actions .button,
.cell-form-actions button {
    min-width: 0;
    flex: 1 1 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 36px;
}

.card {
    padding: 22px;
    border-radius: 22px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), #8da07e);
}

.card h2 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: var(--accent);
}

.card p {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
}

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

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

input,
select,
textarea,
button {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px 16px;
    font: inherit;
    background: #fffdfa;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(13, 106, 79, 0.18);
    border-color: rgba(13, 106, 79, 0.4);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 160px;
    background: linear-gradient(135deg, #0d5f41 0%, #1f704f 100%);
    color: #f8f5ed;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(13, 95, 65, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(13, 95, 65, 0.34);
}


.button.secondary {
    background: linear-gradient(135deg, #8fa67e 0%, #6f8d61 100%);
    color: #14372b;
}

.list {
    display: grid;
    gap: 16px;
}

.list.compact h3 {
    margin: 0 0 10px;
}

.list-card {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
    border-radius: 22px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
}

.list-content h2 {
    margin: 0 0 12px;
}

.list-content p {
    margin: 6px 0;
    color: var(--muted);
    line-height: 1.6;
}

.list-actions {
    display: flex;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(13, 95, 65, 0.14);
    color: var(--accent);
}

.badge.danger {
    background: rgba(126, 46, 46, 0.1);
    color: #7e2e2e;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 22px;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 1120px);
        padding: 20px 0 40px;
    }

    .topbar,
    .section-head,
    .list-card,
    .two-col {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar {
        justify-content: stretch;
        margin-bottom: 22px;
    }

    .page-content {
        margin-top: 14px;
    }

    .topbar-side {
        align-items: center;
    }

    .brand-wrap {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .brand-mark {
        width: 132px;
        height: auto;
        border-radius: 14px;
        padding: 8px 10px;
    }

    .brand-mark img {
        width: 100%;
    }

    .hero {
        padding: 24px;
        border-radius: 20px;
    }

    .calendar-toolbar {
        display: block;
    }

    .calendar-table-head {
        padding: 10px 10px 0;
    }

    .calendar-switcher {
        display: grid;
        width: 100%;
        gap: 8px;
    }

    .week-link {
        width: 100%;
    }

    .calendar-table-wrap,
    .calendar-shell {
        min-width: 0;
        display: none !important;
    }

    .mobile-calendar-list {
        display: block !important;
    }

    .topbar-side {
        flex-direction: column !important;
        align-items: center !important;
        gap: 14px !important;
    }

    .brand-wrap {
        margin-right: 0 !important;
        justify-content: center !important;
    }

    .brand-mark,
    .brand-mark img {
        width: 132px !important;
        height: auto !important;
        min-width: 132px !important;
    }

    .brand-mark {
        width: auto !important;
    }

    .nav-live {
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 7px !important;
    }

    .nav-live a,
    .nav-live button {
        min-height: 38px !important;
        padding: 8px 10px !important;
        font-size: 0.9rem !important;
    }

    .panel {
        padding: 22px;
        border-radius: 20px;
    }

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