/*
 * Main shared UI stylesheet for Family Hub.
 * Use this file for reusable layout and component styles across templates.
 * Page-to-file ownership notes live in static/css/README.md and templates/README.md.
 */
html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background:
        radial-gradient(circle at top left, rgba(184, 105, 58, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(107, 124, 74, 0.10), transparent 22%),
        linear-gradient(180deg, #f8f5ef 0%, var(--bg-body) 100%);
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    overflow-x: hidden;
}

.widget-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.78) !important;
    box-shadow:
        0 14px 34px rgba(90, 62, 46, 0.08),
        0 3px 10px rgba(90, 62, 46, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.widget-header {
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background-color: var(--color-clay-brown);
}

.widget-header.terracotta { background-color: var(--color-terracotta); }
.widget-header.olive { background-color: var(--color-olive); }
.widget-header.deep-clay { background-color: var(--color-deep-clay); }

.widget-body {
    background: rgba(255, 252, 245, 0.74);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 16px 18px;
}

.widget-card-glass {
    background: rgba(255, 252, 245, 0.45) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow:
        0 14px 34px rgba(90, 62, 46, 0.08),
        0 3px 10px rgba(90, 62, 46, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

.widget-card-glass .widget-body {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.cal-nav-btn-light {
    color: var(--color-clay-brown);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    line-height: 1.4;
}

.cal-nav-btn-light:hover {
    background: rgba(232, 220, 200, 0.26);
    color: var(--color-deep-clay);
}

.cal-nav-btn-light:active {
    transform: scale(0.97);
    background: rgba(240, 221, 208, 0.36);
}

.navbar-earth {
    background-color: var(--color-deep-clay) !important;
}

.navbar-earth .navbar-brand {
    color: var(--color-sandstone) !important;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.navbar-earth .nav-link {
    color: rgba(232, 220, 200, 0.85) !important;
    font-size: 0.9rem;
}

.navbar-earth .nav-link:hover {
    color: #fff !important;
}

.navbar-earth .btn-outline-light {
    border-color: rgba(232, 220, 200, 0.5);
    color: var(--color-sandstone);
    font-size: 0.85rem;
}

.navbar-earth .btn-outline-light:hover {
    background-color: rgba(232, 220, 200, 0.15);
    color: #fff;
}

.card {
    background: var(--bg-card-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg) !important;
    border: 1px solid rgba(232, 220, 200, 0.35) !important;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-clay-brown);
}

.btn-terracotta {
    background-color: var(--color-terracotta);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-terracotta:hover {
    background-color: var(--color-clay-brown);
    color: #fff;
}

.btn-terracotta:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 8px rgba(90, 62, 46, 0.18);
}

.btn-olive {
    background-color: var(--color-olive);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-olive:hover {
    background-color: #5f6e42;
    color: #fff;
}

.btn-olive:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 8px rgba(65, 78, 45, 0.2);
}

.btn-outline-earth {
    border: 1px solid var(--color-terracotta);
    color: var(--color-terracotta);
    background: transparent;
    border-radius: var(--radius-md);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-outline-earth:hover {
    background-color: var(--color-terracotta);
    color: #fff;
}

.btn-outline-earth:active {
    transform: scale(0.98);
    background-color: rgba(184, 105, 58, 0.12);
    box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.12);
}

.text-clay { color: var(--color-clay-brown) !important; }
.text-terracotta { color: var(--color-terracotta) !important; }
.text-olive { color: var(--color-olive) !important; }
.text-olive-light { color: var(--color-light-olive) !important; }
.text-earth-muted { color: var(--text-muted) !important; }

.calendar-table {
    border-collapse: separate;
    border-spacing: 4px;
    width: 100%;
    table-layout: fixed;
}

.mobile-calendar-agenda {
    display: none;
}

.mobile-day-strip-wrap {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 16px;
}

.mobile-day-strip {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
}

.mobile-day-strip-nav {
    width: 24px;
    flex: 0 0 24px;
    padding: 6px 4px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-clay-brown);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mobile-day-strip-nav:hover {
    background: rgba(240, 221, 208, 0.26);
    color: var(--color-terracotta);
}

.mobile-day-strip-nav:active {
    transform: scale(0.95);
    background: rgba(240, 221, 208, 0.36);
}

.mobile-day-chip {
    min-width: 0;
    padding: 8px 4px;
    border-radius: 14px;
    border: 1px solid rgba(139, 99, 85, 0.14);
    background: rgba(255, 252, 245, 0.78);
    color: var(--color-clay-brown);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mobile-day-chip.active {
    background: rgba(220, 230, 204, 0.72);
    border-color: rgba(107, 124, 74, 0.32);
    color: var(--color-deep-clay);
}

.mobile-day-chip.today:not(.active) {
    border-color: rgba(184, 105, 58, 0.28);
}

.mobile-day-chip:active {
    transform: scale(0.97);
    background: rgba(240, 221, 208, 0.68);
    border-color: rgba(184, 105, 58, 0.22);
}

.mobile-day-chip-weekday {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    line-height: 1.1;
}

.mobile-day-chip-date {
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
}

.mobile-day-chip-dots {
    display: flex;
    gap: 3px;
    min-height: 6px;
}

.mobile-day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}

.mobile-day-dot.event { background: rgba(107, 124, 74, 0.60); }
.mobile-day-dot.task { background: rgba(184, 105, 58, 0.56); }
.mobile-day-dot.holiday { background: rgba(201, 157, 126, 0.72); }

.mobile-selected-day {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-selected-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}

.mobile-selected-label-legend {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    letter-spacing: 0.03em;
}

.mobile-selected-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-selected-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-selected-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(107, 124, 74, 0.16);
    background: rgba(107, 124, 74, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mobile-selected-item:active {
    transform: scale(0.992);
    box-shadow: 0 8px 16px rgba(90, 62, 46, 0.06);
}

.mobile-selected-item.task {
    background: rgba(184, 105, 58, 0.07);
    border-color: rgba(184, 105, 58, 0.16);
}

.mobile-selected-item.holiday {
    background: rgba(255, 252, 245, 0.92);
    border: 2px solid rgba(201, 157, 126, 0.58);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.mobile-selected-item.celebrate {
    background: rgba(255, 251, 247, 0.94);
    border: 2px solid rgba(228, 186, 160, 0.60);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.mobile-selected-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(107, 124, 74, 0.12);
    color: var(--color-clay-brown);
}

.mobile-selected-item.task .mobile-selected-item-icon {
    background: rgba(184, 105, 58, 0.12);
    color: var(--color-terracotta);
}

.mobile-selected-item.holiday .mobile-selected-item-icon {
    background: rgba(201, 157, 126, 0.12);
    color: var(--color-clay-brown);
}

.mobile-selected-item.celebrate .mobile-selected-item-icon {
    background: rgba(228, 186, 160, 0.16);
    color: var(--color-clay-brown);
}

.mobile-selected-item-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mobile-selected-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.mobile-selected-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-clay-brown);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.mobile-selected-item-meta,
.mobile-selected-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.mobile-selected-item-time {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--color-olive);
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-selected-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.mobile-selected-item-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(184, 105, 58, 0.10);
    color: var(--color-terracotta);
    border: 1px solid rgba(184, 105, 58, 0.16);
}

.mobile-selected-item-badge.high {
    background: rgba(184, 105, 58, 0.14);
    border-color: rgba(184, 105, 58, 0.22);
}

.mobile-selected-item-badge.overdue {
    background: rgba(192, 57, 43, 0.10);
    color: #c0392b;
    border-color: rgba(192, 57, 43, 0.18);
}

.calendar-table thead th {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 4px;
    background-color: rgba(232, 220, 200, 0.52);
    color: var(--color-clay-brown);
    border-radius: var(--radius-sm);
    border: none;
}

.calendar-cell {
    height: 96px;
    vertical-align: top;
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(232, 220, 200, 0.46) !important;
    background-color: rgba(255, 250, 242, 0.88);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.calendar-cell:hover {
    background-color: rgba(255, 250, 242, 0.9);
    border-color: rgba(107, 124, 74, 0.22) !important;
    box-shadow: 0 8px 18px rgba(84, 63, 50, 0.05);
    transform: translateY(-1px);
}

.calendar-cell.other-month {
    background-color: rgba(245, 240, 232, 0.3);
    border-color: rgba(232, 220, 200, 0.25) !important;
}

.calendar-cell.today-cell {
    border: 1px solid rgba(184, 105, 58, 0.45) !important;
    background-color: rgba(184, 105, 58, 0.07);
}

.calendar-cell.selected-cell {
    background: linear-gradient(180deg, rgba(220, 230, 204, 0.62) 0%, rgba(255, 252, 245, 0.94) 100%);
    border-color: rgba(107, 124, 74, 0.40) !important;
    box-shadow: inset 0 0 0 1px rgba(107, 124, 74, 0.14);
}

.day-number {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.calendar-day-number-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
}

.today-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: var(--color-terracotta);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.cal-pill {
    font-size: 0.68rem;
    padding: 3px 6px;
    border-radius: 6px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    line-height: 1.5;
}

.cal-event {
    background-color: rgba(107, 124, 74, 0.15);
    color: var(--color-olive);
    border: 1px solid rgba(107, 124, 74, 0.25);
}

.cal-event.health {
    background-color: rgba(107, 124, 74, 0.18);
}

.cal-event.celebrate {
    background-color: rgba(201, 157, 126, 0.18);
    color: var(--color-clay-brown);
    border-color: rgba(201, 157, 126, 0.28);
}

.cal-event.neutral {
    background-color: rgba(122, 96, 80, 0.10);
    color: var(--color-clay-brown);
    border-color: rgba(122, 96, 80, 0.18);
}

.cal-event:hover {
    background-color: rgba(107, 124, 74, 0.28);
    color: var(--color-olive);
}

.cal-task {
    background-color: rgba(184, 105, 58, 0.12);
    color: var(--color-terracotta);
    border: 1px solid rgba(184, 105, 58, 0.22);
}

.cal-task.high {
    background-color: rgba(184, 105, 58, 0.18);
    border-color: rgba(184, 105, 58, 0.34);
}

.cal-task.overdue {
    background-color: rgba(192, 57, 43, 0.10);
    color: #c0392b;
    border-color: rgba(192, 57, 43, 0.28);
}

.cal-task:hover {
    background-color: rgba(184, 105, 58, 0.24);
    color: var(--color-terracotta);
}

.cal-holiday {
    background-color: rgba(255, 252, 245, 0.94);
    color: var(--color-clay-brown);
    border: 2px solid rgba(201, 157, 126, 0.52);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cal-holiday:hover {
    background-color: rgba(255, 252, 245, 0.98);
    color: var(--color-clay-brown);
    border-color: rgba(201, 157, 126, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.cal-birthday {
    background: rgba(255, 251, 247, 0.95);
    color: var(--color-clay-brown);
    border: 2px solid rgba(228, 186, 160, 0.56);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cal-birthday:hover {
    background: rgba(255, 251, 247, 0.98);
    color: var(--color-clay-brown);
    border-color: rgba(228, 186, 160, 0.74);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.cal-participants {
    font-size: 0.62rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    padding-left: 4px;
    margin-top: -1px;
    margin-bottom: 2px;
}

.tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tile-grid > * {
    min-width: 0;
}

.tile-grid-events-quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tile-grid-tasks-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tile-card {
    border-radius: var(--radius-md);
    padding: 12px 12px 10px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    border: 1px solid transparent;
    min-height: 132px;
    position: relative;
}

.tile-card-compact {
    min-height: 0;
    padding: 10px 10px 9px;
    gap: 3px;
}

.tile-card-event-quad {
    min-height: 96px;
    padding: 10px 11px 9px;
}

.tile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(84, 63, 50, 0.08);
    color: var(--text-primary);
}

.tile-card-removing {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
}

.tile-card-event {
    background-color: rgba(107, 124, 74, 0.10);
    border-color: rgba(107, 124, 74, 0.20);
}

.tile-card-task {
    background-color: rgba(184, 105, 58, 0.09);
    border-color: rgba(184, 105, 58, 0.18);
}

.tile-card-check {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid rgba(184, 105, 58, 0.55);
    background: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tile-card-check:hover {
    background: rgba(184, 105, 58, 0.12);
    border-color: var(--color-terracotta);
    transform: scale(1.06);
}

.tile-card-check-form {
    margin: 0;
    position: relative;
    z-index: 3;
    width: fit-content;
}

.tile-card-check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tile-card-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.tile-card-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.tile-card-link:hover {
    color: inherit;
}

.calendar-footer-note {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.page-backbar {
    margin-bottom: 14px;
}

.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    transition: color 0.15s ease, transform 0.15s ease;
}

.page-back-link:hover {
    color: var(--color-clay-brown);
}

.page-back-link:active {
    transform: translateX(-1px);
}

.dashboard-undo-toast {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid rgba(184, 105, 58, 0.18);
    box-shadow: 0 10px 24px rgba(90, 62, 46, 0.08);
    color: var(--color-clay-brown);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.dashboard-undo-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.dashboard-undo-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(107, 124, 74, 0.14);
    color: var(--color-olive);
    font-size: 0.74rem;
}

.dashboard-undo-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-clay-brown);
    flex: 1;
}

.dashboard-undo-btn {
    border: 1px solid rgba(139, 99, 85, 0.16);
    background: rgba(255, 255, 255, 0.78);
    color: var(--color-clay-brown);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.74rem;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.dashboard-undo-btn:hover {
    background: rgba(240, 221, 208, 0.72);
    color: var(--color-terracotta);
}

.dashboard-undo-btn:active {
    transform: scale(0.97);
}

.tile-card-date {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-muted);
}

.tile-card-title {
    font-size: 0.80rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-clay-brown);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.tile-card-compact .tile-card-title {
    font-size: 0.76rem;
    -webkit-line-clamp: 1;
}

.tile-card-event-quad .tile-card-title {
    -webkit-line-clamp: 2;
    flex-grow: 0;
}

.tile-grid-tasks-two .tile-card-title {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    word-break: break-word;
}

.tile-card-compact .tile-card-date,
.tile-card-compact .tile-card-time,
.tile-card-compact .tile-card-meta,
.tile-card-compact .tile-card-badge {
    font-size: 0.64rem;
}

.tile-card-time {
    font-size: 0.68rem;
    color: var(--color-olive);
    font-weight: 500;
}

.tile-card-meta {
    font-size: 0.69rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-card-badge {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-olive);
}

.tile-card-badge.high {
    color: var(--color-terracotta);
}

.tile-card-badge.overdue {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
    border-radius: 3px;
    padding: 1px 5px;
}


.todo-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-progress-copy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--color-clay-brown);
}

.todo-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(184, 105, 58, 0.12);
    overflow: hidden;
}

.todo-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-terracotta) 0%, #d08d63 100%);
}

.form-check-input:checked {
    background-color: var(--color-olive);
    border-color: var(--color-olive);
}

.form-check-input:focus {
    border-color: var(--color-olive);
    box-shadow: 0 0 0 3px rgba(107, 124, 74, 0.2);
}

.form-control,
.form-select {
    border-radius: var(--radius-md);
    border-color: rgba(139, 99, 85, 0.3);
    background-color: rgba(255, 250, 242, 0.8);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238B6355' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-terracotta);
    box-shadow: 0 0 0 3px rgba(184, 105, 58, 0.15);
    background-color: rgba(255, 250, 242, 0.95);
    outline: none;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-clay-brown);
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #f3eee6 0%, #efe7dd 100%);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width 0.22s ease;
    overflow: hidden;
    border-right: 1px solid rgba(90, 62, 46, 0.08);
}

.app-sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 16px 8px;
    border-bottom: 1px solid rgba(90, 62, 46, 0.08);
    text-decoration: none;
    flex-shrink: 0;
    min-height: var(--topbar-height);
}

.sidebar-logo-img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    filter: none;
}

.sidebar-logo-text {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    width: auto;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--color-clay-brown);
    white-space: nowrap;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    transition: opacity 0.15s ease;
    text-align: left;
    padding-left: 0.34em;
}

.sidebar-logo-title {
    font-family: "Montserrat", var(--font-family);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1;
}

.app-sidebar.collapsed .sidebar-logo-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    padding-left: 0;
    overflow: hidden;
}

.app-sidebar.collapsed .sidebar-logo {
    min-height: var(--topbar-height);
    padding: 8px 10px;
}

.app-sidebar.collapsed .sidebar-logo-img {
    width: 34px;
    height: 34px;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-footer {
    padding: 12px 14px 18px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(139, 99, 85, 0.14);
    background: rgba(255, 255, 255, 0.54);
    color: var(--color-clay-brown);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-collapse-btn:hover {
    background: rgba(220, 230, 204, 0.56);
    color: var(--color-deep-clay);
}

.sidebar-collapse-btn i {
    font-size: 0.95rem;
    transition: transform 0.18s ease;
}

.app-sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.sidebar-nav-item {
    position: relative;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    color: rgba(90, 62, 46, 0.8);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 600;
    border-radius: 16px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    position: relative;
    box-shadow: none;
}

.sidebar-nav-link:hover {
    background: rgba(220, 230, 204, 0.42);
    color: var(--color-deep-clay);
}

.sidebar-nav-link:active {
    transform: scale(0.985);
    background: rgba(220, 230, 204, 0.62);
    box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.08);
}

.sidebar-nav-link.active {
    background: rgba(220, 230, 204, 0.82);
    color: var(--color-deep-clay);
    box-shadow: none;
}

.sidebar-nav-icon {
    width: 18px;
    font-size: 0.96rem;
    text-align: center;
    flex-shrink: 0;
    color: inherit;
}

.sidebar-nav-icon-custom {
    width: 22px;
    height: 22px;
    display: block;
    position: relative;
    flex-shrink: 0;
    background-color: currentColor;
    opacity: 1;
}

.sidebar-nav-icon-custom::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: currentColor;
    opacity: 0.3;
}

.sidebar-nav-icon-dashboard {
    -webkit-mask-image: url('/img/dashboard.svg');
    mask-image: url('/img/dashboard.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.sidebar-nav-icon-dashboard::after {
    -webkit-mask-image: url('/img/dashboard.svg');
    mask-image: url('/img/dashboard.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    transform: scale(1.1);
    opacity: 0.5;
}

.sidebar-nav-icon-family {
    -webkit-mask-image: url('/img/family.svg');
    mask-image: url('/img/family.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.sidebar-nav-icon-family::after {
    -webkit-mask-image: url('/img/family.svg');
    mask-image: url('/img/family.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    transform: scale(1.01);
    opacity: 0.24;
}

.sidebar-nav-label {
    transition: opacity 0.15s ease;
    flex: 1;
}

.app-sidebar.collapsed .sidebar-nav-label {
    opacity: 0;
    pointer-events: none;
    flex: 0 0 0;
    width: 0;
    overflow: hidden;
}

.app-sidebar.collapsed .sidebar-nav {
    padding: 18px 8px;
}

.app-sidebar.collapsed .sidebar-nav-link {
    justify-content: center;
    gap: 0;
    padding: 10px 0;
}

.sidebar-badge {
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    line-height: 1.5;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.app-sidebar.collapsed .sidebar-badge {
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav-item .sidebar-tooltip {
    display: none;
    position: absolute;
    left: calc(var(--sidebar-width-collapsed) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(46, 32, 24, 0.92);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.app-sidebar.collapsed .sidebar-nav-item:hover .sidebar-tooltip {
    display: block;
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: linear-gradient(180deg, #f3eee6 0%, #efe7dd 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(90, 62, 46, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1030;
    transition: none;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: var(--color-clay-brown);
}

.topbar-brand:hover {
    color: var(--color-deep-clay);
}

.topbar-brand-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.topbar-brand-name {
    font-family: "Montserrat", var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-left: 0.18em;
}

.topbar-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid rgba(139, 99, 85, 0.14);
}

.topbar-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 14px;
    color: rgba(90, 62, 46, 0.72);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-nav-link:hover {
    background: rgba(220, 230, 204, 0.26);
    color: var(--color-deep-clay);
}

.topbar-nav-link:active {
    transform: scale(0.985);
    background: rgba(220, 230, 204, 0.42);
    box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.08);
}

.topbar-nav-link.active {
    background: rgba(220, 230, 204, 0.56);
    color: var(--color-deep-clay);
}

.topbar-nav-link i {
    font-size: 0.82rem;
}

.topbar-hamburger {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(139, 99, 85, 0.14);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-hamburger:hover {
    background: rgba(220, 230, 204, 0.48);
    color: var(--color-deep-clay);
}

.topbar-hamburger:active {
    transform: scale(0.96);
    background: rgba(220, 230, 204, 0.66);
    box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.08);
}

@media (min-width: 768px) {
    .topbar-hamburger {
        display: none;
    }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-bottom-nav {
    display: none;
}

.topbar-greeting {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.topbar-greeting-label {
    font-weight: 400;
}

.topbar-greeting-name {
    font-weight: 500;
    color: var(--color-clay-brown);
}

.btn-quick-add {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-terracotta);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn-quick-add:hover {
    background: var(--color-clay-brown);
    color: #fff;
}

.btn-quick-add:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 8px rgba(90, 62, 46, 0.16);
}

.quick-add-dropdown {
    min-width: 220px;
    padding: 6px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: rgba(255, 252, 245, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(90, 62, 46, 0.12);
}

.quick-add-dropdown .dropdown-item {
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-add-dropdown .dropdown-item:hover {
    background: rgba(184, 105, 58, 0.08);
    color: var(--color-terracotta);
}

.quick-add-dropdown .dropdown-item i {
    width: 16px;
    color: var(--color-terracotta);
}

.dropdown-item-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dropdown-item-label {
    font-weight: 600;
}

.dropdown-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.topbar-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.05rem;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-bell:hover {
    background: rgba(139, 99, 85, 0.1);
    color: var(--color-deep-clay);
}

.topbar-bell:active {
    transform: scale(0.96);
    background: rgba(139, 99, 85, 0.16);
    box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.08);
}

.topbar-bell-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #e53e3e;
    border-radius: 50%;
    border: 1.5px solid var(--bg-body);
}

.topbar-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius-md);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-avatar-btn:hover {
    background: rgba(139, 99, 85, 0.1);
}

.topbar-avatar-btn:active {
    transform: scale(0.98);
    background: rgba(139, 99, 85, 0.16);
    box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.08);
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--color-terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
}


.topbar-username {
    display: none;
}

.topbar-avatar-dropdown {
    min-width: 180px;
    padding: 6px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: rgba(255, 252, 245, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(90, 62, 46, 0.12);
}

.topbar-avatar-dropdown .dropdown-item {
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-avatar-dropdown .dropdown-item:hover {
    background: rgba(184, 105, 58, 0.08);
}

.topbar-avatar-dropdown .dropdown-item:active,
.quick-add-dropdown .dropdown-item:active {
    background: rgba(184, 105, 58, 0.14);
    transform: translateX(1px);
}

.topbar-avatar-dropdown .dropdown-item.text-danger:hover {
    background: rgba(229, 62, 62, 0.06);
    color: #c53030;
}

.topbar-avatar-dropdown .dropdown-item i {
    width: 16px;
    color: var(--text-muted);
}

.topbar-avatar-dropdown .dropdown-item.text-danger i {
    color: #e53e3e;
}

.topbar-avatar-dropdown .dropdown-divider {
    border-color: var(--color-border);
    margin: 4px 0;
}

.app-content {
    margin-left: 0;
    padding-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    min-height: calc(100dvh - var(--topbar-height));
    transition: none;
}

.tile-card:active {
    transform: scale(0.99);
}

.dashboard-layout-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 12px;
    align-items: start;
    width: 100%;
    margin: 0;
}

.dashboard-main-column,
.dashboard-side-column {
    width: 100%;
    max-width: none;
    margin: 0;
}

.dashboard-side-column {
    min-width: 0;
}

.dashboard-content-wrap {
    width: 100%;
}

.dashboard-content-wrap > div {
    width: 100%;
    margin: 0;
}

.app-content.sidebar-collapsed .dashboard-layout-row {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.app-content.sidebar-collapsed .dashboard-content-wrap {
    padding-left: 0.75rem !important;
}

.page-shell {
    padding: 24px 28px 32px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(139, 99, 85, 0.10);
    color: var(--color-clay-brown);
    font-size: 0.78rem;
    font-weight: 600;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--color-clay-brown);
}

.page-subtitle {
    margin: 0;
    max-width: 760px;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 252, 245, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow:
        0 14px 34px rgba(90, 62, 46, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.stat-card.olive {
    background: rgba(220, 230, 204, 0.62);
}

.stat-card.terracotta {
    background: rgba(240, 221, 208, 0.78);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 7px;
}

.stat-value {
    display: block;
    color: var(--color-clay-brown);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.stat-meta {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.toolbar-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(139, 99, 85, 0.14);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-pill:hover {
    color: var(--color-clay-brown);
    background: rgba(255, 255, 255, 0.92);
}

.filter-pill.active {
    color: var(--color-terracotta);
    background: rgba(240, 221, 208, 0.8);
    border-color: rgba(184, 105, 58, 0.18);
}

.surface-card {
    border-radius: var(--radius-lg);
    background: rgba(255, 252, 245, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow:
        0 14px 34px rgba(90, 62, 46, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.list-card-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.list-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-clay-brown);
}

.list-card-title-link {
    text-decoration: none;
    color: inherit;
}

.list-card-title-link:hover .list-card-title {
    text-decoration: underline;
    text-decoration-color: var(--color-clay-brown);
    text-underline-offset: 3px;
}

.list-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.78);
    color: var(--color-terracotta);
}

.list-card-icon.olive {
    color: var(--color-olive);
}

.priority-chip,
.status-chip,
.soft-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.priority-chip.high,
.status-chip.todo {
    background: rgba(240, 221, 208, 0.8);
    color: var(--color-terracotta);
}

.priority-chip.medium,
.status-chip.progress,
.soft-chip.olive {
    background: rgba(220, 230, 204, 0.78);
    color: var(--color-olive);
}

.priority-chip.low,
.status-chip.done,
.soft-chip.neutral {
    background: rgba(90, 62, 46, 0.08);
    color: var(--color-clay-brown);
}

.soft-chip.terracotta {
    background: rgba(240, 221, 208, 0.8);
    color: var(--color-terracotta);
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.section-grid-spaced {
    margin-top: 2rem;
}

.section-stack-full {
    grid-column: 1 / -1;
}

.section-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.family-main-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.family-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.family-panel-head {
    padding: 0 2px;
}

.family-panel-head-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 8px;
}

.family-panel-head-copy {
    min-width: 0;
}

.family-panel-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.family-panel-head-row .section-title {
    min-width: 0;
}

.family-panel-head-btn {
    display: inline-flex;
    align-items: center;
    width: 132px;
    min-width: 132px;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.family-panel-card {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(139, 99, 85, 0.09);
    border-radius: 16px;
    box-shadow: none;
    overflow: hidden;
}

.family-access-inline {
    margin: 18px 0 0;
}

.family-access-inline-head {
    margin-bottom: 8px;
}

.family-access-bottom {
    margin-top: 18px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-clay-brown);
}

.section-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.entity-list {
    display: flex;
    flex-direction: column;
}

.entity-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid rgba(139, 99, 85, 0.10);
}

.entity-row:first-child {
    border-top: 0;
}

.entity-row-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.entity-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.58);
    color: var(--color-clay-brown);
}

.entity-copy {
    min-width: 0;
}

.entity-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 100%;
}

.entity-name {
    display: block;
    font-weight: 600;
    color: var(--color-clay-brown);
    font-size: 0.92rem;
}

.entity-meta {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.entity-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.entity-actions form {
    margin: 0;
}

.family-panel .entity-actions {
    margin-left: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.family-panel .entity-actions .btn {
    white-space: nowrap;
}

.invite-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-clay-brown);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(139, 99, 85, 0.24);
}

.family-access-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.family-access-cluster {
    max-width: 860px;
}

.family-access-item {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(139, 99, 85, 0.09);
}

.family-access-form {
    margin-top: 10px;
}

.family-access-inline .section-subtitle {
    margin-bottom: 0;
}

.family-danger-zone {
    margin-top: 22px;
    max-width: 860px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 244, 242, 0.62);
    border: 1px solid rgba(229, 62, 62, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.family-danger-head {
    margin-bottom: 0;
}

.family-danger-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bf4b43;
}

.family-danger-title i {
    font-size: 0.9rem;
}

.family-danger-zone .section-subtitle {
    color: rgba(126, 74, 66, 0.92);
}

.family-danger-modal .modal-header {
    background: rgba(255, 244, 242, 0.55);
}

.family-danger-panel {
    background: rgba(255, 244, 242, 0.48);
    border-color: rgba(229, 62, 62, 0.14);
}

.family-danger-copy {
    color: rgba(126, 74, 66, 0.92);
}

.family-modal-content {
    border-radius: 22px;
    background: rgba(255, 252, 245, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.82);
    overflow: hidden;
    box-shadow:
        0 18px 40px rgba(90, 62, 46, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.family-modal-content .modal-header,
.family-modal-content .modal-footer {
    border-color: rgba(139, 99, 85, 0.12);
    padding: 18px 20px;
}

.family-modal-content .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-clay-brown);
}

.family-modal-body {
    padding: 20px;
}

.family-modal-panel {
    padding: 14px;
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(139, 99, 85, 0.09);
}

.family-modal-note {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(139, 99, 85, 0.12);
}

.page-inline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 18px;
    padding: 0 2px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.page-inline-summary strong {
    color: var(--color-clay-brown);
    font-weight: 600;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.catalog-card {
    padding: 18px 20px;
}

.event-detail-single {
    max-width: 820px;
}

.catalog-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.catalog-card-icon {
    flex-shrink: 0;
}

.catalog-copy {
    margin-bottom: 10px;
}

.catalog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.catalog-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notifications-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
}

.notification-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-card-icon {
    flex-shrink: 0;
}

.notification-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.notification-card-head-main {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notification-card-head-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.notification-card-type,
.notification-card-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.notification-state-chip {
    width: fit-content;
}

.notification-card-body {
    min-width: 0;
}

.notification-card-message {
    margin: 0;
    color: var(--color-clay-brown);
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.notification-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .notification-card {
        gap: 10px;
        padding: 14px 14px 13px;
    }

    .notification-card-head {
        gap: 10px;
    }

    .notification-card-head-main {
        gap: 8px;
    }

    .notification-card-meta-row {
        gap: 10px;
        font-size: 0.72rem;
    }

    .notification-card-message {
        font-size: 0.92rem;
        line-height: 1.32;
    }

    .notification-card-actions .btn {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 0.72rem;
    }
}

.empty-state {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.84rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.empty-state-icon {
    font-size: 2.2rem;
    color: var(--color-sandstone);
    margin-bottom: 6px;
}

.empty-state-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-clay-brown);
    margin: 0;
}

.empty-state-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin: 0 0 8px;
    max-width: 340px;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.auth-shell-minimal {
    background:
        radial-gradient(circle at top center, rgba(184, 105, 58, 0.08), transparent 26%),
        radial-gradient(circle at bottom center, rgba(107, 124, 74, 0.08), transparent 24%),
        linear-gradient(180deg, #f7f2ea 0%, #f3ede4 100%);
}

.auth-form-card {
    border-radius: 24px;
    background: rgba(255, 252, 245, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 18px 40px rgba(90, 62, 46, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.auth-form-card {
    padding: 28px 28px 24px;
}

.auth-minimal-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.auth-minimal-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    animation: auth-brand-settle 1.15s cubic-bezier(0.22, 0.82, 0.24, 1) both;
}

.auth-minimal-logo {
    width: 112px;
    height: 112px;
    filter: drop-shadow(0 10px 20px rgba(90, 62, 46, 0.10));
}

.auth-minimal-title {
    margin: 0;
    font-family: "Montserrat", var(--font-family);
    font-size: 1rem;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--color-clay-brown);
    padding-left: 0.42em;
}

.auth-form-card-minimal {
    width: 100%;
    max-width: 380px;
    padding: 22px 22px 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px);
    animation: auth-card-rise 0.56s ease 0.72s both;
}

.auth-form-card-no-splash {
    opacity: 1;
    max-height: none;
    overflow: visible;
    transform: none;
    animation: none;
}

.auth-form-card-wide {
    max-width: 520px;
}

.auth-form-top-minimal {
    margin-bottom: 14px;
    text-align: center;
}

.auth-form-top-minimal .auth-form-title {
    font-size: 1.35rem;
    margin-bottom: 0;
}

.auth-form-subtitle-minimal {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-minimal-links {
    margin-top: 16px;
}

@keyframes auth-card-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-color: transparent;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 520px;
        padding-top: 22px;
        padding-bottom: 18px;
        border-color: rgba(255, 255, 255, 0.8);
    }
}

@keyframes auth-brand-settle {
    from {
        opacity: 0;
        transform: translateY(64px) scale(1.08);
    }
    55% {
        opacity: 1;
        transform: translateY(18px) scale(1.03);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-form-top {
    margin-bottom: 18px;
}

.auth-form-title {
    margin: 0 0 6px;
    color: var(--color-clay-brown);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.auth-form-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--color-terracotta);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: var(--color-clay-brown);
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.72fr);
    gap: 18px;
    align-items: start;
}

.form-layout-single {
    grid-template-columns: minmax(0, 860px);
}

.form-panel {
    padding: 18px;
}

/* Event detail view */
.detail-row {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    flex: 0 0 160px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.family-setup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    max-width: 760px;
}

.family-setup-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.family-setup-card {
    padding: 18px;
}

.selection-panel {
    border-radius: var(--radius-md);
    border: 1px solid rgba(139,99,85,0.18);
    background: rgba(255,250,242,0.56);
    padding: 14px;
}

/* Event type selector */
.event-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-type-option {
    position: relative;
}

.event-type-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.event-type-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 12px;
    border: 1px solid rgba(139, 99, 85, 0.16);
    background: rgba(255, 252, 245, 0.72);
    color: var(--color-clay-brown);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    user-select: none;
}

.event-type-label:hover {
    border-color: rgba(184, 105, 58, 0.22);
    background: rgba(255, 255, 255, 0.86);
    color: var(--color-clay-brown);
    box-shadow: 0 6px 14px rgba(90, 62, 46, 0.05);
}

.event-type-radio:checked + .event-type-label {
    border-color: rgba(184, 105, 58, 0.26);
    background: rgba(240, 221, 208, 0.62);
    color: var(--color-terracotta);
    box-shadow: inset 0 0 0 1px rgba(184, 105, 58, 0.04);
}

.event-type-label i {
    color: inherit;
    opacity: 0.9;
}

.event-compact-block {
    margin-bottom: 12px !important;
}

.event-compact-block .form-label,
.event-compact-row .form-label {
    margin-bottom: 6px;
}

.event-compact-row {
    --bs-gutter-y: 0.45rem;
}

.event-description-input {
    min-height: calc(1.5em + 1.1rem + 2px);
}

.selection-group + .selection-group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(232, 220, 200, 0.45);
}

.selection-list-plain {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selection-list-plain .form-check {
    margin: 0;
}

.selection-group-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.detail-hero-card {
    padding: 22px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.detail-meta-item {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(139, 99, 85, 0.10);
}

.detail-meta-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
}

.detail-meta-value {
    display: block;
    color: var(--color-clay-brown);
    font-size: 0.92rem;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: rgba(90,62,46,0.05);
    color: var(--color-clay-brown);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 12px 16px;
}

.data-table tbody td {
    padding: 14px 16px;
    color: var(--color-clay-brown);
    font-size: 0.86rem;
    border-top: 1px solid rgba(232, 220, 200, 0.44);
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.45);
}

.table-card {
    overflow: hidden;
}

.dashboard-summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-summary-copy {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.dashboard-summary-label {
    color: var(--color-clay-brown);
    font-weight: 600;
    margin-right: 4px;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.calendar-toolbar-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.calendar-legend-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.calendar-month-label {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--color-clay-brown);
    letter-spacing: -0.01em;
}

.calendar-selected-date {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--color-olive);
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.calendar-legend-dot.event {
    background: rgba(107, 124, 74, 0.45);
}

.calendar-legend-dot.task {
    background: rgba(184, 105, 58, 0.42);
}

.calendar-legend-dot.holiday {
    background: rgba(201, 157, 126, 0.72);
}

.calendar-legend-dot.birthday {
    background: rgba(228, 186, 160, 0.74);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

.sidebar-backdrop.visible {
    display: block;
}

@media (max-width: 991px) {
    .dashboard-layout-row,
    .app-content.sidebar-collapsed .dashboard-layout-row {
        grid-template-columns: 1fr;
    }

    /* h-100 on the calendar widget must not constrain the grid row height and
       cause overflow:hidden on the side-column cards to clip their content
       on smaller screens. Force both columns to size from their own content. */
    .dashboard-main-column .widget-card {
        height: auto !important;
    }

    .dashboard-side-column {
        min-height: 0;
        height: auto;
    }

    .dashboard-side-column .widget-card {
        height: auto;
        max-height: none;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .family-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .family-setup-grid {
        grid-template-columns: 1fr;
    }

    .family-access-cluster {
        max-width: none;
    }

    .family-access-grid {
        grid-template-columns: 1fr;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    html {
        height: -webkit-fill-available;
    }

    body {
        min-height: -webkit-fill-available;
        min-height: 100svh;
        min-height: 100dvh;
    }

    .family-main-grid {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        width: var(--sidebar-width) !important;
        height: 100svh;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* When mobile sidebar is open, always show labels and brand name —
       even if desktop had the sidebar collapsed (collapsed state stored in localStorage) */
    .app-sidebar.mobile-open .sidebar-logo-text {
        opacity: 1;
        width: auto;
        padding-left: 0.34em;
        overflow: visible;
    }

    .app-sidebar.mobile-open .sidebar-nav-label {
        opacity: 1;
        flex: 1;
        width: auto;
        overflow: visible;
    }

    .app-sidebar.mobile-open .sidebar-nav {
        padding: 18px 12px;
    }

    .app-sidebar.mobile-open .sidebar-nav-link {
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }

    .sidebar-footer {
        display: none;
    }

    .app-topbar {
        position: sticky;
        left: 0 !important;
        top: 0;
        right: auto;
        padding: 0 12px;
        gap: 10px;
    }

    .app-content {
        margin-left: 0 !important;
        min-height: auto;
        padding-top: 0;
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .auth-shell {
        min-height: -webkit-fill-available;
        min-height: 100svh;
        min-height: 100dvh;
        display: block;
        padding-top: 24px;
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: 24px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .topbar-left {
        flex: 1;
        min-width: 0;
    }

    .topbar-nav {
        display: none;
    }

    .topbar-right {
        gap: 6px;
    }

    .topbar-greeting {
        display: none;
    }

    .topbar-username {
        display: none;
    }

    .topbar-quick-add-wrap {
        display: none;
    }

    .app-sidebar,
    .sidebar-backdrop,
    .sidebar-footer,
    .topbar-hamburger {
        display: none !important;
    }

    .topbar-brand {
        display: inline-flex;
    }

    .topbar-brand-name {
        font-size: 0.74rem;
        letter-spacing: 0.14em;
    }

    .mobile-bottom-nav {
        position: fixed;
        bottom: 8px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(3, auto);
        justify-content: center;
        gap: 3px;
        width: max-content;
        max-width: calc(100vw - 28px);
        margin: 0;
        padding: 4px;
        padding-bottom: 4px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
        border-radius: 17px;
        background: rgba(250, 245, 236, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(226, 211, 190, 0.88);
        box-shadow:
            0 10px 22px rgba(90, 62, 46, 0.09),
            0 2px 5px rgba(90, 62, 46, 0.04);
    }

    .mobile-bottom-nav-link {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        width: 64px;
        min-width: 64px;
        min-height: 38px;
        padding: 4px 4px;
        border-radius: 12px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.54rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    }

    .mobile-bottom-nav-link i {
        font-size: 0.76rem;
    }

    .mobile-bottom-nav-link:hover {
        background: rgba(220, 230, 204, 0.42);
        color: var(--color-deep-clay);
    }

    .mobile-bottom-nav-link:active {
        transform: scale(0.97);
        background: rgba(220, 230, 204, 0.62);
        box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.08);
    }

    .mobile-bottom-nav-link.active {
        background: rgba(220, 230, 204, 0.82);
        color: var(--color-deep-clay);
        box-shadow: inset 0 0 0 1px rgba(107, 124, 74, 0.14);
    }

    .mobile-bottom-nav-add-wrap {
        display: flex;
        align-items: stretch;
    }

    .mobile-bottom-nav-add {
        width: 64px;
        min-width: 64px;
        min-height: 38px;
        border: none;
        border-radius: 12px;
        background: var(--color-terracotta);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: 0;
        transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    }

    .mobile-bottom-nav-add-symbol {
        font-size: 1rem;
        line-height: 1;
        font-weight: 700;
    }

    .mobile-bottom-nav-add:hover {
        background: var(--color-clay-brown);
        color: #fff;
    }

    .mobile-bottom-nav-add:active {
        transform: scale(0.97);
        box-shadow: inset 0 2px 6px rgba(90, 62, 46, 0.12);
    }

    .mobile-bottom-nav-dropdown {
        min-width: 220px;
        margin-bottom: 10px !important;
    }

    .calendar-cell {
        height: 40px;
        padding: 2px 4px;
    }

    .calendar-footer-note {
        display: none;
    }

    /* On mobile: show only the icon in calendar pills — text is unreadable at this size.
       Event/task/holiday details are already visible in the Today+Tomorrow and Due Soon
       sections below the calendar, so no information is lost. */
    .cal-pill {
        font-size: 0.65rem;
        padding: 2px 4px;
        width: fit-content;
    }

    .cal-pill span {
        display: none;
    }


    .cal-participants {
        display: none;
    }

    .day-number {
        font-size: 0.72rem;
    }

    .today-circle {
        width: 18px;
        height: 18px;
        font-size: 0.68rem;
    }

    .calendar-table {
        border-spacing: 2px;
    }

    .mobile-calendar-agenda {
        display: block;
    }

    .desktop-calendar-table {
        display: none;
    }

    .calendar-toolbar {
        align-items: center;
    }

    .calendar-month-label {
        font-size: 1rem;
    }

    .calendar-selected-date {
        margin-left: auto;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .calendar-legend-row {
        display: none;
    }

    .widget-header {
        font-size: 0.82rem;
        padding: 8px 12px;
    }

    .dashboard-mobile-hide {
        display: none;
    }

    .widget-body {
        padding: 10px 12px;
    }

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

    .tile-grid-events-quad {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .tile-grid-tasks-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .tile-card {
        padding: 7px;
        min-height: 0;
        border-radius: 12px;
    }

    .tile-card-compact {
        padding: 7px 7px 6px;
    }

    .tile-card-event-quad {
        min-height: 82px;
        padding: 7px 8px 6px;
    }

    .tile-card-check-row {
        gap: 6px;
    }

    .tile-card-check {
        width: 16px;
        height: 16px;
    }

    .tile-card-title {
        font-size: 0.70rem;
        line-height: 1.2;
    }

    .tile-card-compact .tile-card-title,
    .tile-grid-tasks-two .tile-card-title {
        font-size: 0.68rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .tile-card-date,
    .tile-card-time,
    .tile-card-meta,
    .tile-card-badge,
    .tile-card-compact .tile-card-date,
    .tile-card-compact .tile-card-time,
    .tile-card-compact .tile-card-meta,
    .tile-card-compact .tile-card-badge {
        font-size: 0.58rem;
    }

    .todo-progress-copy {
        font-size: 0.72rem;
    }

    .dashboard-summary-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-shell {
        padding: 18px 14px 18px;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .list-card {
        flex-direction: column;
    }

    .list-card-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .entity-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .family-panel .entity-row {
        flex-direction: row;
        align-items: center;
    }

    .family-panel .entity-row-main {
        flex: 1;
        min-width: 0;
    }

    .family-panel .entity-actions {
        align-self: center;
    }

    .family-panel-head-row {
        align-items: flex-start;
    }

    .form-layout {
        grid-template-columns: 1fr;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .auth-form-card {
        padding: 22px 18px 20px;
    }

    .auth-minimal-logo {
        width: 96px;
        height: 96px;
    }

    .auth-minimal-title {
        font-size: 0.92rem;
        letter-spacing: 0.34em;
        padding-left: 0.34em;
    }

    .auth-form-card-minimal {
        max-width: 100%;
        padding: 20px 18px 18px;
    }

    .sidebar-logo-mark {
        width: 36px;
        height: 36px;
    }
}

/* Onboarding */

.onboarding-wrap {
    max-width: 1120px;
    margin: 0 auto 28px;
}

.onboarding-card {
    overflow: hidden;
    padding: 0;
    margin-bottom: 0;
    border: 1px solid rgba(214, 193, 171, 0.7);
    box-shadow: 0 18px 40px rgba(92, 69, 53, 0.08);
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.96) 0%, rgba(253, 248, 241, 0.92) 100%);
}

.onboarding-frame-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(220, 201, 180, 0.62);
    background: rgba(255, 252, 247, 0.76);
}

.onboarding-frame-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.onboarding-frame-logo {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.onboarding-frame-brand-title {
    font-family: "Montserrat", var(--font-family);
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--color-clay-brown);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding-left: 0.2em;
}

.onboarding-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 58px 28px 56px;
    background:
        radial-gradient(circle at center, rgba(240, 221, 208, 0.34), transparent 30%),
        linear-gradient(180deg, rgba(255, 251, 245, 0.74) 0%, rgba(253, 248, 241, 0.82) 100%);
}

.onboarding-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.onboarding-title {
    font-family: "Montserrat", var(--font-family);
    font-size: 2.35rem;
    font-weight: 500;
    line-height: 1.18;
    color: var(--color-clay-brown);
    margin: 0;
    max-width: 760px;
}

.onboarding-title-accent {
    color: var(--color-terracotta);
}

.onboarding-subtitle {
    color: var(--color-clay-brown);
    font-size: 1.02rem;
    line-height: 1.72;
    margin: 0;
    max-width: 620px;
    opacity: 0.9;
}

.onboarding-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.onboarding-action-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    min-width: 170px;
    padding-inline: 22px;
    text-align: center;
}

.content-narrow {
    max-width: 520px;
}

.content-medium {
    max-width: 720px;
}

.modal-confirm-dialog {
    max-width: 380px;
}

.modal-confirm-content {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(90, 62, 46, 0.15);
    box-shadow: 0 8px 32px rgba(90, 62, 46, 0.18);
    overflow: hidden;
}

.modal-confirm-icon {
    color: var(--color-terracotta);
    font-size: 1.1rem;
}

.btn-confirm-danger {
    background-color: var(--color-terracotta);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
}

.entity-row-compact {
    border-bottom: 1px solid rgba(232, 220, 200, 0.4);
}

.compact-action-btn {
    font-size: 0.75rem;
}

.compact-action-btn:active {
    transform: scale(0.98);
}

.pet-type-badge {
    background: rgba(184, 105, 58, 0.12);
    color: var(--color-terracotta);
    font-size: 0.65rem;
}

.status-select-compact {
    font-size: 0.78rem;
    min-width: 130px;
    font-weight: 600;
}

.status-select-detail {
    min-width: 150px;
}

.weekend-heading {
    color: var(--color-terracotta);
}

.calendar-footer-divider {
    border-color: rgba(232, 220, 200, 0.4) !important;
}

@media (max-width: 600px) {
    .onboarding-wrap {
        max-width: 100%;
    }

    .onboarding-card {
        padding: 0;
    }

    .onboarding-frame-head {
        padding: 14px 16px;
    }

    .onboarding-body {
        gap: 16px;
        padding: 34px 18px 30px;
    }

    .onboarding-title {
        font-size: 1.9rem;
    }

    .onboarding-frame-brand-title {
        font-size: 0.9rem;
        letter-spacing: 0.14em;
        padding-left: 0.14em;
    }
}
}

/* Very small phones (≤480px): shrink calendar cells further so the
   Today+Tomorrow and Due Soon widgets are reachable with minimal scrolling. */
@media (max-width: 480px) {
    .calendar-cell {
        height: 40px;
        padding: 2px 3px;
    }

    .container-fluid.dashboard-content-wrap {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Avatar images */

.topbar-user-photo {
    width: 38px;
    height: 38px;
}


/* Entity-row avatar: photo replaces the icon in the family member list.
   .entity-avatar already sets the 38x38 size and border-radius. */
.entity-avatar-img {
    object-fit: cover;
}

/* Avatar upload panel inside Edit Profile modal */
.avatar-upload-panel {
    margin-bottom: 20px;
}

.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

.avatar-upload-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(139, 99, 85, 0.18);
}

.avatar-upload-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
    border: 2px dashed rgba(139, 99, 85, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-clay-brown);
    font-size: 1.3rem;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    flex: 1;
}
