:root {
    --sand: #f6e9d7;
    --terracotta: #c46a4e;
    --jungle: #2d5b4c;
    --lagoon: #5ab4c5;
    --ink: #2b2b2b;
    --cream: #fffaf2;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: var(--sand);
    background-image:
        radial-gradient(1200px 500px at 10% -10%, rgba(90, 180, 197, 0.18), transparent 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(196, 106, 78, 0.18), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
    color: var(--ink);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: "Playfair Display", "Times New Roman", serif;
    margin: 0 0 8px;
}

.page-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(120deg, var(--jungle), #3d6b58);
    color: var(--white);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(45, 91, 76, 0.2);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

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

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.icon-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.icon-link-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.title {
    font-size: 22px;
    font-weight: 600;
}

.content {
    margin-top: 22px;
    display: grid;
    gap: 18px;
}

.card {
    background: var(--cream);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(45, 91, 76, 0.12);
    box-shadow: 0 12px 30px rgba(45, 91, 76, 0.08);
}

.summary-textarea {
    width: 100%;
    min-height: 170px;
    border-radius: 14px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    padding: 14px;
    font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    background: #fffdf9;
    color: var(--ink);
    resize: vertical;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 22px 0;
}

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

.filters {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    align-items: stretch;
}

.filters-compact {
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.filters .quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-topline,
.filter-bottomline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.filter-topline {
    padding-bottom: 4px;
}

.filter-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 14px;
}

.filter-panel {
    border: 1px solid rgba(45, 91, 76, 0.12);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.55);
    display: grid;
    gap: 12px;
}

.filter-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--jungle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.period-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.quick-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(43, 43, 43, 0.7);
}

.quick-sep {
    color: rgba(43, 43, 43, 0.35);
}

.quick-current {
    font-size: 12px;
    font-weight: 600;
    color: var(--jungle);
}

.quick-filters .btn.active {
    background: var(--jungle);
    color: var(--white);
    border-color: var(--jungle);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--jungle);
}

.field span {
    font-weight: 600;
}

.field input {
    border-radius: 12px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    padding: 10px 12px;
    font-size: 14px;
    background: #fffdf9;
}

.field select {
    border-radius: 12px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    padding: 10px 12px;
    font-size: 14px;
    background: #fffdf9;
}

.year-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.month-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.year-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(45, 91, 76, 0.22);
    background: rgba(255, 255, 255, 0.82);
    color: var(--jungle);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.year-link.active,
.year-link:hover {
    background: var(--jungle);
    color: var(--white);
    border-color: var(--jungle);
    box-shadow: 0 10px 18px rgba(45, 91, 76, 0.18);
}

.year-option {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.year-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.year-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(45, 91, 76, 0.22);
    background: rgba(255, 255, 255, 0.82);
    color: var(--jungle);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.year-option input:checked + span {
    background: var(--jungle);
    color: var(--white);
    border-color: var(--jungle);
    box-shadow: 0 10px 18px rgba(45, 91, 76, 0.18);
}

.year-option input:focus-visible + span {
    outline: 2px solid rgba(90, 180, 197, 0.8);
    outline-offset: 2px;
}

.field .helper {
    font-size: 12px;
    color: rgba(43, 43, 43, 0.65);
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-label {
    display: inline;
}

.icon-btn {
    gap: 6px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn-icon path,
.btn-icon rect,
.btn-icon circle {
    stroke: currentColor;
    fill: none;
}

.btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn.primary {
    background: var(--terracotta);
    color: var(--white);
    box-shadow: 0 12px 24px rgba(196, 106, 78, 0.2);
}

.btn.danger {
    background: #b2382b;
    color: var(--white);
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.25);
    color: var(--jungle);
    border-color: rgba(45, 91, 76, 0.3);
}

.btn.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.topbar .btn.ghost {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.6);
}

.table-view {
    padding: 12px 22px 22px;
}

.table-view table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-view thead {
    text-align: left;
    color: var(--jungle);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.table-view th,
.table-view td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(45, 91, 76, 0.12);
    vertical-align: top;
}

.table-view td.actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.table-view td.actions form {
    margin: 0;
}

.table-view tbody tr.is-current td {
    background: rgba(85, 166, 119, 0.16);
}

.table-view tbody tr.is-past td {
    background: rgba(60, 60, 60, 0.08);
}

.compact-table .table-view {
    padding-top: 0;
}

.strong {
    font-weight: 600;
}

.muted {
    color: rgba(43, 43, 43, 0.65);
    font-size: 13px;
}

.muted.small {
    font-size: 11px;
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(90, 180, 197, 0.2);
    color: var(--jungle);
    font-weight: 600;
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid transparent;
    margin-bottom: 6px;
}

.status-pill.ok {
    background: rgba(45, 91, 76, 0.15);
    color: var(--jungle);
    border-color: rgba(45, 91, 76, 0.2);
}

.status-pill.missing {
    background: rgba(178, 56, 43, 0.12);
    color: #8f3d26;
    border-color: rgba(178, 56, 43, 0.2);
}

.status-pill.wait {
    background: rgba(196, 106, 78, 0.12);
    color: #8f3d26;
    border-color: rgba(196, 106, 78, 0.2);
}

.row-status-icons {
    justify-content: flex-start;
}

.status-icons {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.status-icons .badge {
    margin-left: 4px;
}

.status-arrow {
    color: rgba(45, 91, 76, 0.45);
    font-size: 14px;
    font-weight: 600;
}

.status-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    background: rgba(255, 255, 255, 0.7);
    color: rgba(45, 91, 76, 0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    appearance: none;
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-icon.state-ok {
    color: #ffffff;
    background: #2f9e5f;
    border-color: #2f9e5f;
}

.status-icon.state-off {
    color: rgba(45, 91, 76, 0.4);
    background: rgba(45, 91, 76, 0.04);
    border-color: rgba(45, 91, 76, 0.12);
}

.status-icon.state-error {
    color: #b2382b;
    background: rgba(178, 56, 43, 0.12);
    border-color: rgba(178, 56, 43, 0.25);
}

.status-icon.state-wait {
    color: #8f5a00;
    background: rgba(240, 164, 31, 0.22);
    border-color: rgba(240, 164, 31, 0.45);
}

.status-icon.state-action,
.status-icon.pdf-modal-trigger {
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(45, 91, 76, 0.12);
}

.status-icon:hover {
    transform: translateY(-1px);
}

.status-icon-svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.status-icon-svg path,
.status-icon-svg rect,
.status-icon-svg circle {
    stroke: currentColor;
    fill: none;
}

.status-icon-form {
    margin: 0;
    display: inline-flex;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.lang-select {
    border-radius: 999px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    padding: 4px 10px;
    font-size: 12px;
    background: #fffdf9;
}

.status-block {
    display: grid;
    gap: 6px;
}

.card-view {
    display: none;
    padding: 16px;
    gap: 12px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 22px 22px;
    border-top: 1px solid rgba(45, 91, 76, 0.12);
    flex-wrap: wrap;
}

.page-info {
    font-size: 13px;
    color: rgba(43, 43, 43, 0.7);
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reservation-card {
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(45, 91, 76, 0.12);
    background: #fffdf9;
    display: grid;
    gap: 12px;
}

.reservation-card.is-current {
    background: rgba(85, 166, 119, 0.16);
    border-color: rgba(45, 91, 76, 0.22);
    box-shadow: 0 10px 20px rgba(45, 91, 76, 0.12);
}

.reservation-card.is-past {
    background: rgba(60, 60, 60, 0.08);
    border-color: rgba(45, 91, 76, 0.12);
}

.reservation-card .row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.reservation-card .row.actions {
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(45, 91, 76, 0.6);
}

.people-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.empty {
    padding: 20px 22px 26px;
    color: rgba(43, 43, 43, 0.7);
}

.login-card {
    max-width: 420px;
    margin: 0 auto;
}

.login-card form {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.alert {
    background: rgba(196, 106, 78, 0.12);
    color: #8f3d26;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.alert.success {
    background: rgba(45, 91, 76, 0.12);
    color: var(--jungle);
}

.alert ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

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

.form-grid textarea {
    border-radius: 12px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    padding: 10px 12px;
    font-size: 14px;
    background: #fffdf9;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.span-2 {
    grid-column: span 2;
}

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

.detail {
    background: #fffdf9;
    border-radius: 14px;
    padding: 12px;
    border: 1px solid rgba(45, 91, 76, 0.12);
}

.detail .label {
    margin-bottom: 6px;
}

.break {
    word-break: break-word;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 200;
}

.modal.open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 91, 76, 0.35);
    backdrop-filter: blur(2px);
}

.modal-card {
    position: relative;
    background: var(--cream);
    border-radius: 18px;
    border: 1px solid rgba(45, 91, 76, 0.16);
    box-shadow: 0 24px 50px rgba(45, 91, 76, 0.2);
    max-width: 360px;
    margin: 12vh auto 0;
    padding: 14px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-body {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.modal-status {
    font-size: 13px;
    color: rgba(43, 43, 43, 0.7);
}

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

.modal-actions form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.modal-actions .inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-actions .lang-select {
    min-width: 96px;
}

.modal-fields {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.pdf-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pdf-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(45, 91, 76, 0.2);
    background: rgba(255, 255, 255, 0.7);
    color: var(--jungle);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

body.modal-open {
    overflow: hidden;
}

.stats-card {
    padding: 0;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    padding: 16px 22px 22px;
}

.stat {
    background: #fffdf9;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(45, 91, 76, 0.12);
    display: grid;
    gap: 8px;
}

.stat-head {
    display: flex;
    justify-content: flex-end;
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 91, 76, 0.08);
    color: var(--jungle);
}

.stat-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--jungle);
}

.note {
    padding: 0 22px 20px;
    font-size: 13px;
    color: rgba(43, 43, 43, 0.7);
}

.filters-card {
    margin-bottom: 18px;
}

.stats-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.stats-layout .span-2 {
    grid-column: span 1;
}

.summary-strip,
.business-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 22px 18px;
}

.summary-pill,
.business-pill,
.delta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(45, 91, 76, 0.08);
    color: var(--jungle);
    font-size: 12px;
    line-height: 1.2;
}

.business-pill {
    justify-content: space-between;
    min-width: 180px;
}

.business-pill strong,
.delta-chip {
    font-weight: 700;
}

.secondary-grid {
    padding-top: 0;
}

.kpi-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 22px 18px;
}

.kpi-tile {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(45, 91, 76, 0.12);
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(43, 43, 43, 0.62);
}

.kpi-value {
    font-size: 22px;
    line-height: 1.05;
    color: var(--jungle);
}

.kpi-meta {
    font-size: 12px;
    color: rgba(43, 43, 43, 0.72);
    line-height: 1.25;
}

.kpi-positive .kpi-value {
    color: #1f6f5c;
}

.kpi-warning .kpi-value {
    color: #9a6112;
}

.stat-positive .stat-icon,
.stat-positive .stat-value {
    color: #1f6f5c;
}

.stat-warning .stat-icon,
.stat-warning .stat-value {
    color: #9a6112;
}

.metric-row,
.expense-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-row strong {
    color: var(--jungle);
}

.chart-year-sections {
    display: grid;
    gap: 18px;
}

.chart-year-section {
    border: 1px solid rgba(45, 91, 76, 0.12);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 253, 249, 0.85);
}

.chart-year-header {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.chart-year-title {
    font-family: "Playfair Display", "Times New Roman", serif;
    font-size: 22px;
    color: var(--jungle);
}

.chart-year-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: rgba(43, 43, 43, 0.75);
}

.chart-year-kpis span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(45, 91, 76, 0.07);
}

.expense-card {
    padding-bottom: 18px;
}

.expense-bars {
    display: grid;
    gap: 14px;
    padding: 0 22px 18px;
}

.expense-bar-row {
    display: grid;
    gap: 6px;
}

.expense-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(45, 91, 76, 0.08);
    overflow: hidden;
}

.expense-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f6f5c 0%, #5ab4c5 100%);
}

.calendar-months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 0 22px 22px;
    align-items: start;
}

.calendar-month {
    border: 1px solid rgba(45, 91, 76, 0.12);
    border-radius: 18px;
    background: #fffdf9;
    overflow: hidden;
}

.calendar-month-title {
    padding: 8px 12px;
    font-family: "Playfair Display", "Times New Roman", serif;
    font-size: 18px;
    color: var(--jungle);
    border-bottom: 1px solid rgba(45, 91, 76, 0.1);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weeks {
    display: grid;
}

.calendar-week {
    position: relative;
    border-bottom: 1px solid rgba(45, 91, 76, 0.08);
}

.calendar-weekdays div {
    padding: 5px 6px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(43, 43, 43, 0.65);
    background: rgba(45, 91, 76, 0.04);
    border-bottom: 1px solid rgba(45, 91, 76, 0.08);
}

.calendar-day {
    min-height: 22px;
    padding: 1px 5px 0;
    border-right: 1px solid rgba(45, 91, 76, 0.08);
    display: block;
    background: rgba(255, 255, 255, 0.72);
}

.calendar-grid.compact .calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.is-outside {
    background: rgba(43, 43, 43, 0.04);
}

.calendar-day.is-muted {
    opacity: 0.55;
}

.calendar-day.is-today {
    background: rgba(90, 180, 197, 0.12);
}

.calendar-day-number {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--jungle);
    display: block;
}

.calendar-segments {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(var(--calendar-lanes), 18px);
    gap: 2px 0;
    padding: 0 4px 4px;
    min-height: calc(var(--calendar-lanes) * 18px + 4px);
}

.calendar-reservation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    height: 16px;
    border-radius: 8px;
    background: var(--reservation-color);
    color: #fff;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.reservation-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 6px;
}

.reservation-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.calendar-reservation.source-airbnb {
    background: #ff6b35;
}

.calendar-reservation.source-owner {
    background: #6f5d3e;
}

.calendar-reservation.source-direct {
    background: #1f6f5c;
}

.calendar-reservation.source-other {
    background: #2f4858;
}

.calendar-reservation.status-pending {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.calendar-reservation.status-cancelled {
    background: #7a4b4b;
    opacity: 0.7;
}

.reservation-mini-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.reservation-mini-icon svg {
    width: 8px;
    height: 8px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reservation-mini-icon.status-submitted {
    background: rgba(255, 255, 255, 0.24);
}

.reservation-mini-icon.status-pending {
    background: rgba(255, 255, 255, 0.12);
}

.reservation-mini-icon.status-cancelled {
    background: rgba(122, 75, 75, 0.9);
}

.calendar-reservation.is-middle {
    border-radius: 3px;
}

.calendar-reservation.is-start {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.calendar-reservation.is-end {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.calendar-empty-row {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 16px;
}

.chart-card {
    padding: 0;
    overflow: hidden;
}

.monitor-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitor-table .table-view {
    overflow-x: auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px 0;
}

.chart-body {
    padding: 12px 22px 22px;
    display: grid;
    gap: 14px;
}

.chart-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(43, 43, 43, 0.7);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--legend-color);
}

.chart-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(36px, 1fr));
    gap: 10px;
    align-items: end;
    min-height: 210px;
    min-width: 720px;
}

.chart-col {
    display: grid;
    gap: 6px;
    align-items: end;
    justify-items: center;
}

.bars {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    justify-content: center;
    height: 178px;
}

.bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
    min-width: 48px;
}

.bar-value {
    max-width: 56px;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--jungle);
    word-break: break-word;
}

.bar {
    position: relative;
    width: 18px;
    border: 0;
    border-radius: 8px 8px 4px 4px;
    background: var(--bar-color);
    min-height: 3px;
    box-shadow: 0 8px 12px rgba(45, 91, 76, 0.12);
    cursor: pointer;
    appearance: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.bar:hover,
.bar:focus-visible,
.bar.is-active {
    transform: translateY(-2px);
    box-shadow: 0 14px 20px rgba(45, 91, 76, 0.18);
}

.bar:focus-visible {
    outline: 2px solid rgba(90, 180, 197, 0.9);
    outline-offset: 2px;
}

.bar-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 110px;
    max-width: 160px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(43, 43, 43, 0.92);
    color: var(--white);
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 14px 30px rgba(43, 43, 43, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 3;
}

.bar-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-width: 6px 5px 0 5px;
    border-style: solid;
    border-color: rgba(43, 43, 43, 0.92) transparent transparent transparent;
}

.bar:hover .bar-tooltip,
.bar:focus-visible .bar-tooltip,
.bar.is-active .bar-tooltip {
    opacity: 1;
}

.month-label {
    font-size: 11px;
    color: rgba(43, 43, 43, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chart-scale {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(43, 43, 43, 0.6);
}

@media (max-width: 820px) {
    .kpi-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panels,
    .filter-topline,
    .filter-bottomline {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .period-nav {
        justify-content: flex-start;
    }

    .stats-layout {
        grid-template-columns: 1fr;
    }

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

    .calendar-months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .monitor-table .table-view {
        display: block;
    }

    .table-view.always-visible {
        display: block;
        overflow-x: auto;
    }

    .table-view {
        display: none;
    }

    .card-view {
        display: grid;
    }

    .card-view .label {
        display: none;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
    }

    .logout-link {
        position: absolute;
        top: 12px;
        right: 14px;
    }

    .span-2 {
        grid-column: span 1;
    }

    .chart-grid {
        min-width: 820px;
        gap: 12px;
    }

    .bars {
        height: 168px;
    }

    .bar-wrap {
        min-width: 54px;
    }

    .bar {
        width: 18px;
    }
}

@media (max-width: 700px) {
    .page-shell {
        padding: 18px 12px 36px;
    }

    .topbar {
        padding: 14px 16px;
        border-radius: 16px;
    }

    .topbar-nav {
        width: 100%;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 18px 18px 0;
    }

    .calendar-months {
        grid-template-columns: 1fr;
        padding: 0 14px 16px;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .stat-icon svg {
        width: 16px;
        height: 16px;
    }

    .calendar-month-title {
        font-size: 16px;
        padding: 7px 10px;
    }

    .calendar-weekdays div {
        padding: 4px 2px;
        font-size: 8px;
    }

    .calendar-day {
        min-height: 22px;
        padding: 1px 2px;
    }

    .calendar-day-number {
        font-size: 8px;
    }

    .calendar-segments {
        grid-template-rows: repeat(var(--calendar-lanes), 12px);
        gap: 2px 0;
        padding: 2px 2px 4px;
        min-height: calc(var(--calendar-lanes) * 12px + 6px);
    }

    .calendar-reservation {
        height: 10px;
        padding: 0 2px;
        font-size: 7px;
        border-radius: 4px;
    }

    .reservation-mini-icon {
        width: 8px;
        height: 8px;
    }

    .reservation-mini-icon svg {
        width: 6px;
        height: 6px;
    }

    .reservation-icons {
        gap: 2px;
    }

    .reservation-name {
        padding-right: 3px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1 1 140px;
    }

    .summary-strip,
    .business-strip,
    .expense-bars,
    .kpi-board {
        padding-left: 18px;
        padding-right: 18px;
    }

    .kpi-board {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 14px;
    }

    .kpi-tile {
        padding: 10px 12px;
    }

    .kpi-value {
        font-size: 20px;
    }

    .business-pill {
        min-width: 100%;
    }

    .chart-year-section {
        padding: 12px;
    }

    .chart-year-title {
        font-size: 18px;
    }

    .filters {
        gap: 8px;
    }

    .filters .quick-filters {
        gap: 6px;
    }

    .filter-actions {
        justify-content: flex-start;
    }

    .year-picker {
        gap: 6px;
    }

    .year-option span {
        min-width: 64px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .quick-sep {
        display: none;
    }

    .card-view {
        padding: 10px;
        gap: 10px;
    }

    .reservation-card {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 14px;
    }

    .reservation-card .row {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: start;
        gap: 6px 10px;
    }

    .reservation-card .row.row-meta {
        grid-template-columns: 1fr 1fr;
    }

    .reservation-card .row.row-status-icons {
        grid-template-columns: 1fr;
    }

    .reservation-card .row.row-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        align-items: stretch;
    }

    .reservation-card .row.row-actions form,
    .reservation-card .row.row-actions a {
        width: 100%;
    }

    .reservation-card .row.row-actions form {
        display: flex;
    }

    .reservation-card .row.row-actions form .btn {
        flex: 1;
    }

    .icon-btn {
        padding: 8px 10px;
    }

    .icon-btn .btn-label {
        display: none;
    }

    .status-icons {
        gap: 6px;
    }

    .status-arrow {
        font-size: 12px;
    }

    .status-icon {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .status-icon-svg {
        width: 15px;
        height: 15px;
    }

    .btn-icon {
        width: 18px;
        height: 18px;
    }

    .btn.small {
        padding: 6px 10px;
        font-size: 11px;
    }

    .inline-form {
        gap: 4px;
    }

    .lang-select {
        padding: 3px 8px;
        font-size: 11px;
    }

    .badge {
        font-size: 12px;
        padding: 4px 10px;
    }

    .status-pill {
        font-size: 11px;
        padding: 3px 8px;
        margin-bottom: 4px;
    }

    .label {
        font-size: 11px;
    }

    .muted {
        font-size: 12px;
    }

    .pagination {
        padding: 14px 18px 18px;
    }

    .modal-card {
        margin: 10vh 12px 0;
    }

    .chart-body {
        padding: 12px 16px 18px;
    }

    .chart-grid {
        min-width: 860px;
        gap: 14px;
    }

    .bar-wrap {
        min-width: 58px;
        gap: 6px;
    }

    .bar-value {
        max-width: 58px;
        font-size: 10px;
    }

    .bar {
        width: 18px;
    }

    .bar-tooltip {
        min-width: 104px;
        font-size: 11px;
    }
}
