:root {
    --ink-900: #16202a;
    --ink-700: #3d4b5a;
    --ink-500: #68788a;
    --sand-100: #f6f2eb;
    --sand-200: #ece4d8;
    --gold-300: #d2b06e;
    --gold-500: #a97722;
    --wine-600: #7d2030;
    --wine-700: #671725;
    --paper: rgba(255, 252, 246, 0.88);
    --line: rgba(103, 23, 37, 0.14);
    --success: #215f41;
    --danger: #8a2430;
    --shadow-lg: 0 28px 70px rgba(18, 31, 44, 0.16);
    --shadow-md: 0 16px 36px rgba(18, 31, 44, 0.11);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --nav-width: 280px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-900);
    font-family: "Aptos", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(210, 176, 110, 0.28), transparent 32%),
        radial-gradient(circle at right 15%, rgba(125, 32, 48, 0.12), transparent 20%),
        linear-gradient(145deg, #f5efe5 0%, #f0e7da 48%, #f8f5ef 100%);
}

a {
    color: inherit;
}

.login-screen {
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-card {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 34px;
    background: rgba(255, 250, 244, 0.82);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.login-hero {
    padding: 56px;
    background:
        linear-gradient(160deg, rgba(103, 23, 37, 0.9), rgba(31, 57, 87, 0.86)),
        linear-gradient(45deg, rgba(210, 176, 110, 0.25), transparent);
    color: #fffaf3;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-hero h1,
.page-header h1,
.section-card h2,
.brand-panel h2 {
    margin: 0;
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    letter-spacing: 0.02em;
}

.login-hero h1 {
    font-size: clamp(2.3rem, 4vw, 4rem);
    line-height: 0.95;
}

.login-hero p {
    max-width: 440px;
    color: rgba(255, 250, 243, 0.82);
    font-size: 1rem;
    line-height: 1.7;
}

.hero-points {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.hero-point {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-point strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.login-form-shell {
    padding: 52px 44px;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.82), rgba(255, 247, 237, 0.96));
}

.brand-mini {
    margin-bottom: 26px;
    color: var(--wine-600);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-700);
}

.field-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(103, 23, 37, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink-900);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(103, 23, 37, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink-900);
    font: inherit;
}

.field-group input:focus,
.field-group select:focus,
.button:focus,
.sidebar-link:focus {
    outline: none;
    border-color: rgba(125, 32, 48, 0.5);
    box-shadow: 0 0 0 4px rgba(125, 32, 48, 0.12);
}

.field-group input:focus {
    transform: translateY(-1px);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--wine-600), var(--wine-700));
    box-shadow: 0 14px 28px rgba(103, 23, 37, 0.22);
}

.button-secondary {
    color: var(--wine-600);
    background: rgba(125, 32, 48, 0.09);
}

.button-muted {
    color: var(--ink-700);
    background: rgba(22, 32, 42, 0.07);
}

.button-full {
    width: 100%;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.flash-error {
    color: var(--danger);
    background: rgba(138, 36, 48, 0.08);
    border: 1px solid rgba(138, 36, 48, 0.15);
}

.flash-success {
    color: var(--success);
    background: rgba(33, 95, 65, 0.09);
    border: 1px solid rgba(33, 95, 65, 0.14);
}

.app-layout {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 28px 22px;
    background:
        linear-gradient(180deg, rgba(255, 248, 238, 0.92), rgba(248, 240, 228, 0.82)),
        linear-gradient(135deg, rgba(103, 23, 37, 0.04), rgba(22, 32, 42, 0.04));
    border-right: 1px solid rgba(103, 23, 37, 0.08);
    backdrop-filter: blur(10px);
}

.brand-panel {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 247, 236, 0.96));
    border: 1px solid rgba(125, 32, 48, 0.08);
    box-shadow: var(--shadow-md);
}

.brand-panel span {
    display: block;
    margin-bottom: 8px;
    color: var(--wine-600);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-panel h2 {
    font-size: 1.45rem;
    line-height: 1.02;
}

.brand-panel p {
    margin: 10px 0 0;
    color: var(--ink-700);
    line-height: 1.55;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--ink-700);
    font-weight: 700;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    color: var(--wine-600);
    background: rgba(125, 32, 48, 0.09);
    transform: translateX(2px);
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(22, 32, 42, 0.07);
}

.sidebar-footer strong,
.meta-card strong,
.stat-card strong {
    display: block;
}

.sidebar-footer p,
.meta-card p,
.stat-card p,
.section-card p,
.page-header p {
    margin: 6px 0 0;
    color: var(--ink-700);
    line-height: 1.55;
}

.main-content {
    padding: 28px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 0.95;
}

.page-grid,
.stats-grid,
.meta-grid {
    display: grid;
    gap: 18px;
}

.page-grid {
    grid-template-columns: 1.5fr 1fr;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.meta-card-wide {
    grid-column: 1 / -1;
}

.section-card,
.stat-card,
.meta-card,
.table-card {
    padding: 24px;
    border-radius: var(--radius-xl);
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}

.section-card h2,
.table-card h2 {
    font-size: 1.32rem;
    margin-bottom: 8px;
}

.section-card + .section-card {
    margin-top: 18px;
}

.action-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.action-item {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(247, 239, 226, 0.92));
    border: 1px solid rgba(125, 32, 48, 0.08);
}

.action-item h3 {
    margin: 0;
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    font-size: 1.1rem;
}

.stat-card span {
    color: var(--gold-500);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stat-card strong {
    margin-top: 10px;
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    font-size: 2.4rem;
    line-height: 1;
}

.meta-card {
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.92), rgba(255, 246, 232, 0.8));
}

.hint {
    margin-top: 16px;
    padding: 14px 16px;
    border-left: 4px solid var(--gold-500);
    border-radius: 14px;
    background: rgba(169, 119, 34, 0.08);
    color: var(--ink-700);
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    overflow: auto;
    margin-top: 18px;
}

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

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(22, 32, 42, 0.08);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--ink-500);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: rgba(125, 32, 48, 0.04);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(33, 95, 65, 0.1);
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 700;
}

.toolbar-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.toolbar-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(125, 32, 48, 0.08);
    color: var(--wine-600);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
}

.modal-open {
    overflow: hidden;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 19, 28, 0.56);
    backdrop-filter: blur(6px);
}

.meeting-modal {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    overflow: auto;
    padding: 28px;
    border-radius: 30px;
    background: rgba(255, 251, 245, 0.96);
    box-shadow: var(--shadow-lg);
}

.meeting-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.meeting-modal-header p {
    max-width: 720px;
}

.meeting-modal-eyebrow {
    margin-bottom: 12px;
}

.meeting-close {
    min-width: 48px;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: rgba(125, 32, 48, 0.08);
    color: var(--wine-600);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.meeting-modal-body {
    display: grid;
    grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
    gap: 22px;
}

.meeting-calendar-panel,
.meeting-agenda-panel {
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(103, 23, 37, 0.08);
}

.meeting-calendar-toolbar,
.meeting-day-summary,
.meeting-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meeting-current-month {
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    font-size: 1.2rem;
    text-transform: capitalize;
}

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

.meeting-weekdays {
    margin: 20px 0 10px;
    color: var(--ink-500);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.meeting-day {
    display: grid;
    gap: 4px;
    min-height: 76px;
    padding: 12px 10px;
    border: 1px solid rgba(103, 23, 37, 0.08);
    border-radius: 18px;
    background: rgba(255, 252, 246, 0.92);
    color: var(--ink-900);
    text-align: left;
    cursor: pointer;
}

.meeting-day span {
    font-weight: 700;
}

.meeting-day small {
    color: var(--ink-500);
    min-height: 1rem;
}

.meeting-day-free {
    background: rgba(33, 95, 65, 0.10);
    border-color: rgba(33, 95, 65, 0.18);
}

.meeting-day-busy {
    background: rgba(210, 176, 110, 0.24);
    border-color: rgba(169, 119, 34, 0.22);
}

.meeting-day-full {
    background: rgba(125, 32, 48, 0.20);
    border-color: rgba(125, 32, 48, 0.24);
}

.meeting-day-blocked {
    background: rgba(22, 32, 42, 0.05);
    color: var(--ink-500);
    cursor: not-allowed;
}

.meeting-day.is-outside {
    opacity: 0.42;
}

.meeting-day.is-selected {
    box-shadow: 0 0 0 3px rgba(125, 32, 48, 0.18);
}

.meeting-day-free small,
.meeting-day-busy small,
.meeting-day-full small,
.meeting-day-blocked small {
    color: transparent;
}

.meeting-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: var(--ink-700);
    font-size: 0.88rem;
}

.legend-dot {
    display: inline-flex;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 999px;
}

.legend-free { background: rgba(33, 95, 65, 0.62); }
.legend-busy { background: rgba(169, 119, 34, 0.72); }
.legend-full { background: rgba(125, 32, 48, 0.72); }
.legend-blocked { background: rgba(104, 120, 138, 0.72); }

.meeting-day-summary h3,
.meeting-form h3 {
    margin: 8px 0 4px;
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
}

.meeting-day-reservations {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.meeting-empty-state {
    padding: 20px;
    border-radius: 20px;
    background: rgba(246, 242, 235, 0.95);
    color: var(--ink-700);
}

.meeting-reservation-card {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(246, 242, 235, 0.95);
    border: 1px solid rgba(103, 23, 37, 0.08);
}

.meeting-reservation-card strong,
.meeting-user-pill strong {
    display: block;
}

.meeting-reservation-card p,
.meeting-reservation-card small {
    display: block;
    margin-top: 6px;
    color: var(--ink-700);
}

.meeting-reservation-time {
    color: var(--wine-600);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.meeting-reservation-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.button-compact {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.meeting-form {
    display: grid;
    gap: 18px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.meeting-user-pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.meeting-user-pillars-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meeting-user-pill {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(246, 242, 235, 0.95);
}

.meeting-user-pill input {
    width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(103, 23, 37, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink-700);
    font: inherit;
}

.meeting-form textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(103, 23, 37, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink-900);
    font: inherit;
    resize: vertical;
}

.meeting-error {
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--danger);
    background: rgba(138, 36, 48, 0.08);
    border: 1px solid rgba(138, 36, 48, 0.15);
}

.simple-screen {
    min-height: 100vh;
    padding: 32px;
}

.simple-card {
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 30px;
    border-radius: 30px;
    background: var(--paper);
    box-shadow: var(--shadow-md);
}

@media (max-width: 1080px) {
    .login-card,
    .page-grid,
    .stats-grid,
    .meta-grid,
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .meeting-modal-body,
    .meeting-user-pillars {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .login-screen,
    .main-content,
    .simple-screen {
        padding: 18px;
    }

    .login-hero,
    .login-form-shell,
    .section-card,
    .stat-card,
    .meta-card,
    .table-card,
    .simple-card {
        padding: 22px;
    }

    .toolbar-links,
    .action-grid {
        grid-template-columns: 1fr;
    }

    .meeting-modal {
        width: calc(100vw - 18px);
        margin: 9px auto;
        padding: 18px;
    }

    .meeting-calendar-toolbar,
    .meeting-day-summary,
    .meeting-actions,
    .meeting-modal-header {
        flex-direction: column;
        align-items: stretch;
    }
}
