:root {
    --bg: #f4f7fb;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --border: #d1d5db;
    --warning: #f59e0b;
    --error: #dc2626;
    --ok: #16a34a;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, #dbeafe 0%, #f4f7fb 45%, #f4f7fb 100%);
}

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

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-card,
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.auth-card h1,
.topbar h1 {
    margin: 0;
    font-size: 28px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: var(--text-muted);
    margin: 8px 0 0;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #374151;
}

.text-input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 15px;
    background: #ffffff;
}

.text-input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    border-radius: 10px;
    padding: 10px 16px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    margin-top: 18px;
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #0e9f94 100%);
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0e9188 100%);
}

.btn-secondary {
    border: 1px solid var(--border);
    background: #ffffff;
    color: #1f2937;
}

.btn-secondary:hover {
    border-color: #9ca3af;
}

.error-message {
    margin-top: 12px;
    display: block;
    color: var(--error);
    font-size: 14px;
    font-weight: 600;
}

.app-page {
    min-height: 100vh;
    padding: 18px;
}

.app-shell {
    max-width: 1280px;
    margin: 0 auto;
}

.app-shell.single-col {
    max-width: 860px;
}

.topbar {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

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

.month-tools {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 16px;
}

.month-tools h2 {
    margin: 0;
    text-align: center;
    text-transform: capitalize;
}

.month-tools .btn-secondary:first-child {
    justify-self: start;
}

.month-tools .btn-secondary:last-child {
    justify-self: end;
}

.info-box,
.error-box {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.info-box {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.error-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

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

.weekday {
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    padding: 8px 0;
}

.day-cell {
    background: var(--bg-card);
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    min-height: 175px;
    padding: 10px;
}

.day-cell.today {
    border: 1px solid var(--primary);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.day-cell.muted {
    background: transparent;
    border-style: dashed;
    border-color: #e5e7eb;
}

.day-head {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.slot-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.slot-item {
    border-radius: 10px;
    padding: 8px;
    font-size: 13px;
}

.slot-item.open {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.slot-item.confirmed {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.slot-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.slot-state {
    margin-top: 6px;
    font-weight: 700;
    color: var(--ok);
}

.slot-extra {
    margin-top: 4px;
    color: #166534;
}

.slot-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
}

.no-slot {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.legend {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: #374151;
    font-size: 13px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 4px;
}

.dot-open {
    background: var(--warning);
}

.dot-confirmed {
    background: var(--ok);
}

.form-row {
    margin-top: 14px;
}

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

.confirm-final {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px;
}

.foot-actions {
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .day-cell {
        min-height: 150px;
    }
}

@media (max-width: 900px) {
    .month-tools {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .month-tools .btn-secondary:first-child,
    .month-tools .btn-secondary:last-child {
        justify-self: center;
    }

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

    .weekday {
        display: none;
    }

    .day-cell,
    .day-cell.muted {
        min-height: auto;
    }

    .day-cell.muted {
        display: none;
    }

    .two-cols {
        grid-template-columns: 1fr;
    }
}
