/* MI Brand Distillery - Style 3: "Polar Frost"
   Crisp ice-white expanses with bold blue anchors, geometric Swiss-design precision,
   monospace accents, and frosted-glass layering */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,800;1,9..144,300&family=IBM+Plex+Mono:wght@400;500;600&family=Sora:wght@300;400;500;600;700&display=swap');

:root {
    /* MI Brand Distillery Corporate — Inverted Light Mode: white dominance + blue power accents */
    --mibd-blue: #083A81;
    --mibd-blue-dark: #052658;
    --mibd-blue-ink: #021636;
    --mibd-blue-mid: #0c4da6;
    --mibd-blue-bright: #2b6ed4;
    --mibd-blue-tint: #dbe8f9;
    --mibd-blue-whisper: #eef4fc;

    --mibd-ice: #f2f0ef;
    --mibd-ice-pure: #fafaf9;
    --mibd-white: #ffffff;
    --mibd-black: #000000;
    --mibd-charcoal: #272727;
    --mibd-graphite: #3d3d3d;
    --mibd-slate: #5c5c5c;
    --mibd-ash: #797979;
    --mibd-mist: #b8b8b8;
    --mibd-frost: #e5e5e5;

    --mibd-red: #c0392b;
    --mibd-red-soft: #e74c3c;
    --mibd-green: #1a8a5c;
    --mibd-green-soft: #27ae60;
    --mibd-amber: #c27c0e;
    --mibd-amber-soft: #e8a31e;

    /* Typography */
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Sora', 'Helvetica Neue', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* Spacing */
    --sp-0: 0px;
    --sp-2: 2px;
    --sp-4: 4px;
    --sp-6: 6px;
    --sp-8: 8px;
    --sp-10: 10px;
    --sp-12: 12px;
    --sp-14: 14px;
    --sp-16: 16px;
    --sp-18: 18px;
    --sp-20: 20px;
    --sp-22: 22px;
    --sp-24: 24px;
    --sp-28: 28px;
    --sp-32: 32px;
    --sp-36: 36px;
    --sp-40: 40px;
    --sp-44: 44px;
    --sp-48: 48px;

    /* Radius */
    --r-none: 0;
    --r-sm: 3px;
    --r-md: 6px;
    --r-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 16px 50px rgba(0,0,0,0.1);
    --shadow-blue: 0 4px 20px rgba(8, 58, 129, 0.12);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.2s;
    --t-normal: 0.35s;
}

/* ═══════════════════════════════════════
   RESET
   ═══════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: var(--mibd-blue);
    color: var(--mibd-white);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--mibd-ice); }
::-webkit-scrollbar-thumb { background: var(--mibd-mist); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--mibd-blue); }

/* ═══════════════════════════════════════
   BODY
   ═══════════════════════════════════════ */
body {
    font-family: var(--font-body);
    background-color: var(--mibd-ice);
    background-image:
        linear-gradient(180deg, var(--mibd-white) 0%, var(--mibd-ice) 300px),
        url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h1v40H0zM40 0v1H0V0z' fill='%23083A81' opacity='.03'/%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--mibd-charcoal);
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: var(--sp-24) var(--sp-32);
}

/* ═══════════════════════════════════════
   NAVIGATION — solid blue bar, crisp white type
   ═══════════════════════════════════════ */
.navbar {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    padding: 0;
    border-bottom: 4px solid var(--mibd-blue-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(8, 58, 129, 0.25);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--sp-12);
    padding-bottom: var(--sp-12);
}

.navbar h1 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
    color: var(--mibd-white);
    display: flex;
    align-items: center;
    gap: var(--sp-10);
}

.navbar h1::before {
    content: '//';
    opacity: 0.4;
    font-weight: 400;
}

.logo-container svg {
    height: 44px;
    filter: brightness(0) invert(1);
}

.logo-part {
    stroke: var(--mibd-white);
    fill: none;
    stroke-width: 10px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-icon {
    margin-right: var(--sp-4);
    opacity: 0.8;
}

/* Style Switcher */
.style-switcher-container {
    position: relative;
    display: inline-block;
}

.style-switcher-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: var(--sp-8) var(--sp-10);
    border-radius: var(--r-sm);
    transition: all var(--t-fast) var(--ease-out);
    color: rgba(255, 255, 255, 0.7);
}

.style-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--mibd-white);
}

.style-switcher-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + var(--sp-8));
    width: 148px;
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    overflow: hidden;
}

.style-switcher-dropdown.show {
    display: block;
    animation: frostDrop 0.25s var(--ease-out);
}

@keyframes frostDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.style-switcher-dropdown a {
    display: block;
    padding: var(--sp-10) var(--sp-16);
    color: var(--mibd-charcoal);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    font-weight: 500;
    transition: all var(--t-fast) var(--ease-out);
    cursor: pointer;
    border-bottom: 1px solid var(--mibd-frost);
}

.style-switcher-dropdown a:last-child {
    border-bottom: none;
}

.style-switcher-dropdown a:hover,
.style-switcher-dropdown a.active {
    background: var(--mibd-blue);
    color: var(--mibd-white);
}

.navbar nav {
    display: flex;
    gap: 0;
}

.navbar nav a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: var(--sp-8) var(--sp-16);
    transition: all var(--t-fast) var(--ease-out);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    border-bottom: 3px solid transparent;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.navbar nav a:hover {
    color: var(--mibd-white);
    background: rgba(255, 255, 255, 0.08);
    border-bottom-color: var(--mibd-white);
}

/* ═══════════════════════════════════════
   CARDS — sharp-edged white panels, blue left-stripe
   ═══════════════════════════════════════ */
.card {
    background: var(--mibd-white);
    border: 1px solid var(--mibd-frost);
    border-left: 5px solid var(--mibd-blue);
    border-radius: var(--r-none);
    padding: var(--sp-32);
    margin-bottom: var(--sp-24);
    transition: all var(--t-normal) var(--ease-out);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, transparent 50%, var(--mibd-blue-whisper) 50%);
    opacity: 0;
    transition: opacity var(--t-normal) var(--ease-out);
}

.card:hover {
    border-left-width: 8px;
    box-shadow: var(--shadow-lg), var(--shadow-blue);
    transform: translateY(-2px);
}

.card:hover::after {
    opacity: 1;
}

.card h2 {
    font-family: var(--font-display);
    color: var(--mibd-blue-ink);
    margin-bottom: var(--sp-24);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    padding-bottom: var(--sp-16);
    border-bottom: 2px solid var(--mibd-blue);
    position: relative;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--mibd-blue-dark);
}

.card h3 {
    color: var(--mibd-blue-mid);
    margin-bottom: var(--sp-16);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════
   FORMS — blueprint-style inputs with monospace labels
   ═══════════════════════════════════════ */
.form-group {
    margin-bottom: var(--sp-0);
}

.form-group label {
    display: block;
    margin-bottom: var(--sp-8);
    font-weight: 600;
    color: var(--mibd-blue);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: var(--sp-12) var(--sp-16);
    border: 2px solid var(--mibd-frost);
    border-radius: var(--r-none);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all var(--t-fast) var(--ease-out);
    background: var(--mibd-ice-pure);
    color: var(--mibd-charcoal);
    border-left: 4px solid var(--mibd-mist);
}

.form-control::placeholder {
    color: var(--mibd-mist);
    font-style: italic;
}

.form-control:focus {
    outline: none;
    border-color: var(--mibd-blue);
    border-left-color: var(--mibd-blue);
    box-shadow: 0 0 0 3px var(--mibd-blue-tint);
    background: var(--mibd-white);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%23083A81'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-14) center;
    padding-right: calc(var(--sp-14) + var(--sp-22));
}

/* ═══════════════════════════════════════
   BUTTONS — Swiss-style, flat, high-contrast
   ═══════════════════════════════════════ */
.btn {
    display: inline-block;
    padding: var(--sp-12) var(--sp-28);
    border: 2px solid transparent;
    border-radius: var(--r-none);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: all var(--t-fast) var(--ease-out);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left var(--t-normal) var(--ease-out);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    border-color: var(--mibd-blue);
}

.btn-primary:hover {
    background: var(--mibd-blue-dark);
    border-color: var(--mibd-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 58, 129, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--mibd-green);
    color: var(--mibd-white);
    border-color: var(--mibd-green);
}

.btn-success:hover {
    background: #15724c;
    border-color: #15724c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 138, 92, 0.3);
}

.btn-danger {
    background: var(--mibd-red);
    color: var(--mibd-white);
    border-color: var(--mibd-red);
}

.btn-danger:hover {
    background: #a93226;
    border-color: #a93226;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.3);
}

.btn-warning {
    background: var(--mibd-amber);
    color: var(--mibd-white);
    border-color: var(--mibd-amber);
}

.btn-warning:hover {
    background: #a3680b;
    border-color: #a3680b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(194, 124, 14, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--mibd-blue);
    border-color: var(--mibd-blue);
}

.btn-secondary:hover {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    transform: translateY(-2px);
}

/* Filter Buttons */
.filter-btn {
    min-width: 120px;
    margin-bottom: var(--sp-8);
    padding: var(--sp-10) var(--sp-20);
    background: var(--mibd-white);
    border: 2px solid var(--mibd-frost);
    border-radius: var(--r-none);
    cursor: pointer;
    font-size: 0.76rem;
    font-family: var(--font-mono);
    text-align: center;
    transition: all var(--t-fast) var(--ease-out);
    color: var(--mibd-slate);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-btn:hover {
    border-color: var(--mibd-blue);
    color: var(--mibd-blue);
    background: var(--mibd-blue-whisper);
}

.filter-btn.active {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    border-color: var(--mibd-blue);
    box-shadow: var(--shadow-blue);
}

/* Active Filters */
.active-filters {
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    border-radius: var(--r-none);
    padding: var(--sp-12) var(--sp-24);
    margin-bottom: var(--sp-24);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-8);
}

.active-filters strong {
    color: var(--mibd-blue);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: var(--sp-8);
}

.filter-badge {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    padding: var(--sp-4) var(--sp-14);
    border-radius: var(--r-none);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.reset-filters-btn {
    font-size: 0.76rem;
    padding: var(--sp-6) var(--sp-14);
    white-space: nowrap;
}

/* ═══════════════════════════════════════
   TABLES — ruled, editorial grid
   ═══════════════════════════════════════ */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    border-radius: var(--r-none);
    table-layout: fixed;
    box-shadow: var(--shadow-md);
}

/* Column widths */
table td:nth-child(1),
table th:nth-child(1),
table td:nth-child(3),
table th:nth-child(3) {
    width: 15%;
    white-space: normal;
    word-wrap: break-word;
}

table td:nth-child(2),
table th:nth-child(2) {
    width: 15%;
    white-space: normal;
    word-wrap: break-word;
}

table td:nth-child(4),
table th:nth-child(4) {
    width: 12%;
    white-space: normal;
    word-wrap: break-word;
}

table td:nth-child(5),
table th:nth-child(5) {
    width: 9%;
    white-space: nowrap;
    text-align: center;
}

table td:nth-child(6),
table th:nth-child(6) {
    width: 8%;
    white-space: nowrap;
    text-align: center;
}

table td:nth-child(7),
table th:nth-child(7) {
    width: 7%;
    white-space: nowrap;
    text-align: center;
}

table td:nth-child(8),
table th:nth-child(8) {
    width: 5%;
    white-space: nowrap;
    text-align: center;
}

table td:nth-child(9),
table th:nth-child(9) {
    width: 21%;
    white-space: nowrap;
}

table thead th {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    padding: var(--sp-14) var(--sp-18);
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: none;
}

table tbody tr {
    transition: all var(--t-fast) var(--ease-out);
    border-bottom: 1px solid var(--mibd-frost);
}

table tbody tr:nth-child(even) {
    background: var(--mibd-ice-pure);
}

table tbody tr:hover {
    background: var(--mibd-blue-whisper);
    box-shadow: inset 4px 0 0 var(--mibd-blue);
}

table td {
    padding: var(--sp-14) var(--sp-18);
    color: var(--mibd-charcoal);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--mibd-frost);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════
   CALENDAR — blueprint-grid aesthetic
   ═══════════════════════════════════════ */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--sp-32);
    padding: var(--sp-24) 0;
    border-bottom: 3px solid var(--mibd-blue);
}

.calendar-header h1 {
    font-family: var(--font-display);
    color: var(--mibd-blue-ink);
    letter-spacing: -0.03em;
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    border-radius: var(--r-none);
    box-shadow: var(--shadow-lg);
}

.calendar-table th,
.calendar-table td {
    width: calc(100% / 7) !important;
}

.calendar-table th {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    padding: var(--sp-14) var(--sp-8);
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

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

.calendar-table td {
    background: var(--mibd-white);
    border: 1px solid var(--mibd-frost);
    border-radius: var(--r-none);
    padding: var(--sp-10) var(--sp-8);
    height: 130px;
    vertical-align: top;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
    position: relative;
}

.calendar-table td:hover {
    background: var(--mibd-blue-whisper);
    box-shadow: inset 0 0 0 2px var(--mibd-blue);
    z-index: 2;
}

.calendar-table td.empty {
    background: repeating-linear-gradient(
        -45deg,
        var(--mibd-ice),
        var(--mibd-ice) 4px,
        var(--mibd-ice-pure) 4px,
        var(--mibd-ice-pure) 8px
    );
    cursor: default;
}

.calendar-table td.empty:hover {
    box-shadow: none;
    background: repeating-linear-gradient(
        -45deg,
        var(--mibd-ice),
        var(--mibd-ice) 4px,
        var(--mibd-ice-pure) 4px,
        var(--mibd-ice-pure) 8px
    );
}

.calendar-table td.today,
.calendar-table td.current-day {
    background: var(--mibd-blue-whisper);
    box-shadow: inset 0 0 0 3px var(--mibd-blue);
}

.calendar-day-number {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--mibd-blue-ink);
    margin-bottom: var(--sp-4);
    display: block;
    font-size: 1.2rem;
    line-height: 1;
    padding: var(--sp-2) 0 var(--sp-6) var(--sp-2);
    border-bottom: 1px solid var(--mibd-frost);
}

.calendar-entry {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 500;
    background: var(--mibd-blue);
    color: var(--mibd-white);
    padding: var(--sp-3) var(--sp-8);
    border-radius: var(--r-none);
    margin-top: var(--sp-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.02em;
    border-left: 3px solid var(--mibd-blue-dark);
}

.calendar-more-indicator {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--mibd-ash);
    margin-top: var(--sp-3);
    text-align: right;
    letter-spacing: 0.04em;
}

.weekend-day {
    background: var(--mibd-ice) !important;
}

/* User color classes */
.calendar-entry.user-color-0 { background: var(--mibd-amber); border-left-color: var(--mibd-amber-soft); }
.calendar-entry.user-color-1 { background: var(--mibd-blue); border-left-color: var(--mibd-blue-dark); }
.calendar-entry.user-color-2 { background: var(--mibd-green); border-left-color: var(--mibd-green-soft); }
.calendar-entry.user-color-3 { background: var(--mibd-red); border-left-color: var(--mibd-red-soft); }
.calendar-entry.user-color-4 { background: #6c3fa0; border-left-color: #8e5cc5; }
.calendar-entry.user-color-5 { background: #1a7aad; border-left-color: #2b9bd4; }
.calendar-entry.user-color-6 { background: #b5366b; border-left-color: #d94e88; }
.calendar-entry.user-color-7 { background: var(--mibd-graphite); border-left-color: var(--mibd-slate); }
.calendar-entry.user-color-8 { background: var(--mibd-ash); border-left-color: var(--mibd-mist); }
.calendar-entry.user-color-9 { background: #0e8a7d; border-left-color: #14b8a6; }

/* ═══════════════════════════════════════
   WEEKLY VIEW — column-ruled
   ═══════════════════════════════════════ */
.week-container {
    display: flex;
    gap: 0;
    border: 2px solid var(--mibd-blue);
    background: var(--mibd-white);
    box-shadow: var(--shadow-lg);
    width: 100%;
    overflow-x: hidden;
}

.week-day {
    background: var(--mibd-white);
    border-right: 1px solid var(--mibd-frost);
    border-radius: var(--r-none);
    padding: var(--sp-16);
    min-height: 340px;
    flex: 1 1 0%;
    min-width: 0;
    transition: all var(--t-fast) var(--ease-out);
    box-sizing: border-box;
}

.week-day:last-child {
    border-right: none;
}

.week-day:hover {
    background: var(--mibd-blue-whisper);
}

.week-day-header {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--mibd-blue);
    margin-bottom: var(--sp-16);
    padding: var(--sp-8);
    border-bottom: 2px solid var(--mibd-blue);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: var(--mibd-blue-whisper);
}

.week-day.current-day-week {
    background: var(--mibd-blue-whisper);
    box-shadow: inset 0 4px 0 var(--mibd-blue);
}

.week-entry {
    background: var(--mibd-ice-pure);
    border-left: 3px solid var(--mibd-blue);
    padding: var(--sp-8) var(--sp-10);
    margin-top: var(--sp-8);
    border-radius: var(--r-none);
    font-size: 0.8rem;
    color: var(--mibd-charcoal);
}

/* ═══════════════════════════════════════
   DAILY VIEW
   ═══════════════════════════════════════ */
.daily-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--sp-32);
    padding: var(--sp-24) 0;
    border-bottom: 3px solid var(--mibd-blue);
}

.daily-header h1 {
    font-family: var(--font-display);
    color: var(--mibd-blue-ink);
    letter-spacing: -0.03em;
    font-weight: 800;
}

.entry-form {
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    padding: var(--sp-32);
    border-radius: var(--r-none);
    margin-bottom: var(--sp-32);
    box-shadow: var(--shadow-md);
    position: relative;
}

.entry-form::before {
    content: 'NEW ENTRY';
    position: absolute;
    top: -1px;
    left: var(--sp-24);
    background: var(--mibd-blue);
    color: var(--mibd-white);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    padding: var(--sp-4) var(--sp-14);
    text-transform: uppercase;
}

.entry-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-24);
    align-items: start;
}

.form-row {
    display: contents;
}

.form-row.comments-row .form-group {
    grid-column: 1 / -1;
}

.form-row.time-row {
    grid-template-columns: repeat(3, 1fr);
}

.entry-form-grid .form-group {
    margin-bottom: var(--sp-0);
}

.entry-list {
    margin-top: var(--sp-32);
}

.entry-item {
    background: var(--mibd-white);
    border: 1px solid var(--mibd-frost);
    border-left: 5px solid var(--mibd-blue);
    border-radius: var(--r-none);
    padding: var(--sp-16) var(--sp-24);
    margin-bottom: var(--sp-2);
    transition: all var(--t-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.entry-item:hover {
    border-left-width: 8px;
    background: var(--mibd-blue-whisper);
    box-shadow: var(--shadow-md);
}

.entry-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--sp-8);
}

.entry-item-actions {
    display: flex;
    gap: var(--sp-8);
}

/* ═══════════════════════════════════════
   STATS — oversized numbers, blueprint cards
   ═══════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-2);
    margin-bottom: var(--sp-48);
    border: 2px solid var(--mibd-blue);
    box-shadow: var(--shadow-lg);
}

.stat-card {
    background: var(--mibd-white);
    color: var(--mibd-charcoal);
    border-radius: var(--r-none);
    padding: var(--sp-32) var(--sp-24);
    position: relative;
    overflow: hidden;
    transition: all var(--t-normal) var(--ease-out);
    border-right: 1px solid var(--mibd-frost);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--mibd-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-out);
}

.stat-card:hover {
    background: var(--mibd-blue-whisper);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card h3 {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    margin-bottom: var(--sp-16);
    color: var(--mibd-blue);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--mibd-blue-ink);
    line-height: 1;
    letter-spacing: -0.04em;
}

/* ═══════════════════════════════════════
   ALERTS — stark, bordered
   ═══════════════════════════════════════ */
.sticky-alerts-container {
    position: fixed;
    top: var(--sp-62);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 100%;
    max-width: var(--sp-1200);
    padding-left: var(--sp-16);
    padding-right: var(--sp-16);
}

.alert {
    padding: var(--sp-14) var(--sp-22);
    border-radius: var(--r-none);
    margin-bottom: var(--sp-8);
    box-shadow: var(--shadow-lg);
    border: 2px solid;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background: #edfcf3;
    color: #0f5132;
    border-color: var(--mibd-green);
}

.alert-danger {
    background: #fef2f2;
    color: #7f1d1d;
    border-color: var(--mibd-red);
}

.alert-warning {
    background: #fffbeb;
    color: #713f12;
    border-color: var(--mibd-amber);
}

.alert-info {
    background: var(--mibd-blue-whisper);
    color: var(--mibd-blue-dark);
    border-color: var(--mibd-blue);
}

.alert .alert-close {
    float: right;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0 var(--sp-6);
    cursor: pointer;
    opacity: 0.5;
    transition: all var(--t-fast) var(--ease-out);
    font-family: var(--font-mono);
}

.alert .alert-close:hover {
    opacity: 1;
}

.alert.fade-out {
    animation: frostFadeOut 0.35s forwards;
}

@keyframes frostFadeOut {
    to {
        opacity: 0;
        transform: translateY(-16px) scaleY(0.8);
        height: 0;
        padding: 0;
        margin: 0;
        border-width: 0;
        overflow: hidden;
    }
}

.alert.fade-in {
    animation: frostFadeIn 0.35s var(--ease-out) forwards;
}

@keyframes frostFadeIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   LOGIN — centered monolith
   ═══════════════════════════════════════ */
.login-container {
    max-width: 440px;
    margin: var(--sp-80) auto;
}

.login-card {
    background: var(--mibd-white);
    border: 3px solid var(--mibd-blue);
    border-radius: var(--r-none);
    box-shadow: var(--shadow-xl), 12px 12px 0 var(--mibd-blue-tint);
    padding: var(--sp-48);
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    height: 8px;
    background: var(--mibd-blue);
}

.login-card h1 {
    color: var(--mibd-blue-ink);
    text-align: center;
    margin-bottom: var(--sp-32);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* ═══════════════════════════════════════
   MODAL — stark panel
   ═══════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 22, 54, 0.6);
    backdrop-filter: blur(8px) grayscale(0.3);
}

.modal-content {
    background: var(--mibd-white);
    border: 3px solid var(--mibd-blue);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--r-none);
    width: 90%;
    max-width: min(780px, 95vw);
    position: relative;
    box-shadow: var(--shadow-xl), 8px 8px 0 var(--mibd-blue-tint);
    animation: frostModalIn 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes frostModalIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-form-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-32) var(--sp-48);
}

.modal-content .modal-form-container .form-group:first-of-type {
    margin-top: var(--sp-16);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-16);
    padding-bottom: var(--sp-8);
    border-bottom: 3px solid var(--mibd-blue);
    flex-shrink: 0;
}

.modal-header h2 {
    color: var(--mibd-blue-ink);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: var(--sp-8);
    margin-left: var(--sp-8);
}

.close {
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    color: var(--mibd-mist);
    transition: all var(--t-fast) var(--ease-out);
    line-height: 1;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    border: 2px solid transparent;
}

.close:hover {
    color: var(--mibd-red);
    border-color: var(--mibd-red);
    background: rgba(192, 57, 43, 0.06);
}

/* Day Detail Modal */
.day-modal-content {
    max-width: 900px;
}

.day-entries-list {
    max-height: 550px;
    overflow-y: auto;
    margin-bottom: var(--sp-24);
}

.day-entry-item {
    background: var(--mibd-ice-pure);
    border-left: 5px solid var(--mibd-blue);
    padding: var(--sp-16) var(--sp-20);
    margin-bottom: var(--sp-2);
    border-radius: var(--r-none);
    transition: all var(--t-fast) var(--ease-out);
}

.day-entry-item:hover {
    background: var(--mibd-blue-whisper);
    border-left-width: 8px;
}

.day-entry-item strong {
    color: var(--mibd-blue-ink);
    display: block;
    margin-bottom: var(--sp-4);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
}

.day-entry-details {
    font-size: 0.85rem;
    color: var(--mibd-slate);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.modal-actions {
    text-align: center;
    padding: var(--sp-24) 0;
    border-top: 3px solid var(--mibd-blue);
    flex-shrink: 0;
    background: var(--mibd-white);
}

.modal-form-container .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
}

/* ═══════════════════════════════════════
   CALENDAR NAVIGATION & FILTERS
   ═══════════════════════════════════════ */

/* Main container using CSS Grid for precise column control */
.main-calendar-container {
    display: grid;
    /* Calendar takes remaining space, sidebar has constrained width */
    grid-template-columns: 1fr auto;
    gap: var(--sp-32);
    align-items: flex-start;
}

/* Calendar content wrapper - prevents overflow into sidebar area */
.calendar-content {
    min-width: 0; /* Allow shrinking below natural size in flex/grid */
}

/* Filter buttons sidebar - Team/Client/Project/Task/User (right side) 
   Fixed positioning for scrollability, with constrained width */
.calendar-navbar.vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--sp-8);
    position: fixed; /* Keep sidebar visible while scrolling */
    top: var(--sp-64);
    right: var(--sp-20);
    z-index: 1000;
    width: auto; /* Let content determine width, max constrained by grid */
}

/* Sidebar button container - ensure buttons don't exceed sidebar width */
.calendar-navbar.vertical > * {
    min-width: 100px; /* Minimum width for filter buttons */
    max-width: 100%;   /* But never exceed parent sidebar */
}

/* Small screens - stack vertically, remove fixed positioning (preserve existing behavior) */
@media (max-width: 768px) {
    .main-calendar-container {
        display: flex;
        flex-direction: column;
    }
    
    .calendar-navbar.vertical {
        position: static;
        margin-top: var(--sp-32);
        width: 100%;
    }
}

/* Above small screens - reserve space for fixed sidebar to prevent overlap */
@media (min-width: 769px) {
    .main-calendar-container {
        margin-right: calc(75px + var(--sp-32)); /* Reserve ~135px for sidebar + gap */
    }
    
    .calendar-content {
        max-width: calc(100% - 135px); /* Prevent calendar from extending under sidebar */
    }
}

/* Medium screens - use flexible grid columns to utilize available space */
@media (min-width: 769px) and (max-width: 1599px) {
    .main-calendar-container {
        /* Calendar takes remaining space, sidebar has min/max constraints */
        grid-template-columns: 1fr minmax(auto, 200px);
    }
    
    .calendar-content {
        max-width: none; /* Let grid column determine width */
        min-width: 45vw; /* Minimum calendar width for usability */
    }
}

/* Extra large screens - give more space to calendar (2fr vs auto sidebar) */
@media (min-width: 1600px) {
    .main-calendar-container {
        grid-template-columns: 2fr auto;
    }
    
    .calendar-content {
        max-width: none; /* Let grid column determine width */
    }
}

/* Large screens - slightly more sidebar room (1.5fr vs auto) */
@media (min-width: 1400px) and (max-width: 1599px) {
    .main-calendar-container {
        grid-template-columns: 1.5fr auto;
    }
    
    .calendar-content {
        max-width: none; /* Let grid column determine width */
    }
}

/* Medium-large screens - balanced split (1.2fr vs auto) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .main-calendar-container {
        grid-template-columns: 1.2fr auto;
    }
    
    .calendar-content {
        max-width: none; /* Let grid column determine width */
    }
}

/* Medium screens - closer to equal split (1.1fr vs auto) */
@media (min-width: 769px) and (max-width: 1199px) {
    .main-calendar-container {
        grid-template-columns: 1.1fr auto;
    }
    
    .calendar-content {
        max-width: none; /* Let grid column determine width */
    }
}

/* Calendar navbar - horizontal layout for top filters */
.calendar-navbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-8);
    margin-bottom: var(--sp-24);
}

.filter-container {
    position: relative;
}

.filter-dropdown {
    position: fixed;
    right: 135px;/*CHANGED FROM calc(var(--sp-20) + 420px);*/
    bottom: var(--sp-12);
    /*top: calc(var(--sp-64) + var(--sp-32));*/
    top: 64px;
    width: 420px;
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    border-radius: var(--r-none);
    box-shadow: var(--shadow-xl), 6px 6px 0 var(--mibd-blue-tint);
    padding: var(--sp-24);
    z-index: 100;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 65vh; /* Master height based on viewport - entire container */
    overflow-y: hidden; /* No outer scrollbar */
}

/* Ensure dropdown fills available space when content is short */
.filter-dropdown {
    flex-grow: 1;
}

/* Remove bottom margin from actions to eliminate gap at bottom */
.filter-actions {
    margin-bottom: 0 !important;
    padding-bottom: var(--sp-8) !important; /* Reduce padding slightly */
}

.filter-search {
    width: 100%;
    padding: var(--sp-10) var(--sp-14);
    border: 2px solid var(--mibd-frost);
    border-radius: var(--r-none);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    background: var(--mibd-ice-pure);
    color: var(--mibd-charcoal);
    border-left: 4px solid var(--mibd-mist);
    flex-shrink: 0;
    margin-bottom: var(--sp-12);
}

.filter-search:focus {
    outline: none;
    border-color: var(--mibd-blue);
    border-left-color: var(--mibd-blue);
    box-shadow: 0 0 0 3px var(--mibd-blue-tint);
}

.filter-list {
    /* Ensure list fills remaining space between search and actions */
    flex-grow: 1;
    min-height: 50px;
    max-height: calc(65vh - 240px);
    overflow-y: auto;
}

.filter-list label {
    display: block;
    padding: var(--sp-6) var(--sp-4);
    cursor: pointer;
    color: var(--mibd-charcoal);
    font-size: 0.88rem;
    transition: all var(--t-fast) var(--ease-out);
}

.filter-list label:hover {
    background: var(--mibd-blue-whisper);
    color: var(--mibd-blue);
}

.filter-list input[type="checkbox"] {
    margin-right: var(--sp-10);
    accent-color: var(--mibd-blue);
}

/* Ensure filter-actions stays at bottom and doesn't shrink */
.filter-actions {
    display: flex;
    gap: var(--sp-8);
    background: var(--mibd-ice);
    padding: var(--sp-12);
    border-top: 2px solid var(--mibd-blue);
    flex-shrink: 0;
    align-items: center;
}

/* Remove any margin that could create extra gap */
.filter-actions {
    margin-bottom: 0;
    padding-bottom: var(--sp-12);
}

.filter-actions > label {
    margin-right: auto; /* Push buttons to the right */
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    font-size: 0.82rem;
    font-weight: 600;
}

.filter-actions > label input[type="checkbox"] {
    accent-color: var(--mibd-blue);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-actions button {
    flex: 1;
    padding: var(--sp-8);
    border-radius: var(--r-none);
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 2px solid var(--mibd-frost);
    background: var(--mibd-white);
    color: var(--mibd-charcoal);
    transition: all var(--t-fast) var(--ease-out);
}

.filter-actions button:hover {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    border-color: var(--mibd-blue);
}

.hidden-team {
    display: none;
}

/* ═══════════════════════════════════════
   USER & PROJECT FILTER DROPDOWNS
   ═══════════════════════════════════════ */
.user-filter-container-wrapper,
.project-filter-container-wrapper {
    position: relative;
}

.user-filter-container-wrapper { z-index: 1001; }
.project-filter-container-wrapper { z-index: 1003; }

.user-filter-btn,
.project-filter-btn {
    width: 100%;
    padding: var(--sp-12) var(--sp-18);
    border: 2px solid var(--mibd-frost);
    border-radius: var(--r-none);
    background: var(--mibd-ice-pure);
    color: var(--mibd-charcoal);
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--t-fast) var(--ease-out);
    font-family: var(--font-body);
    border-left: 4px solid var(--mibd-mist);
}

.user-filter-btn:hover,
.project-filter-btn:hover {
    border-color: var(--mibd-blue);
    border-left-color: var(--mibd-blue);
    box-shadow: 0 0 0 3px var(--mibd-blue-tint);
}

.user-filter-btn::after,
.project-filter-btn::after {
    content: "▼";
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--mibd-blue);
}

.user-filter-dropdown,
.project-filter-dropdown {
    position: auto;
    top: calc(100% + var(--sp-6));
    left: 0;
    right: 0;
    background: var(--mibd-white);
    border: 2px solid var(--mibd-blue);
    border-radius: var(--r-none);
    box-shadow: var(--shadow-xl), 6px 6px 0 var(--mibd-blue-tint);
    padding: var(--sp-16);
    max-height: 65vh; /* Master height based on viewport - entire container */
    overflow-y: hidden; /* No outer scrollbar - inner list handles scrolling */
    display: flex;
    flex-direction: column;
}

.user-filter-dropdown { z-index: 1002; }
.project-filter-dropdown { z-index: 1004; }

/* Ensure user/project filter dropdowns fill space */
.user-filter-dropdown,
.project-filter-dropdown {
    flex-grow: 1;
}

/* Remove any gap between actions and bottom of container */
.user-filter-actions,
.project-filter-actions {
    margin-bottom: 0 !important;
    padding-bottom: var(--sp-8) !important; /* Reduce padding slightly */
}

.user-filter-search,
.project-filter-search {
    width: 100%;
    padding: var(--sp-10) var(--sp-14);
    border: 2px solid var(--mibd-frost);
    border-radius: var(--r-none);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    box-sizing: border-box;
    margin-bottom: var(--sp-12);
    background: var(--mibd-ice-pure);
    color: var(--mibd-charcoal);
    border-left: 4px solid var(--mibd-mist);
}

.user-filter-search:focus,
.project-filter-search:focus {
    outline: none;
    border-color: var(--mibd-blue);
    border-left-color: var(--mibd-blue);
    box-shadow: 0 0 0 3px var(--mibd-blue-tint);
}

.user-filter-list,
.project-filter-list {
    /* Ensure list fills remaining space between search and actions */
    flex-grow: 1;
    max-height: calc(65vh - 240px);
    overflow-y: auto;
    margin-bottom: var(--sp-8);
    border: 1px solid var(--mibd-frost);
}

.user-filter-item,
.project-filter-item {
    padding: var(--sp-8) var(--sp-14);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all var(--t-fast) var(--ease-out);
    color: var(--mibd-charcoal);
    border-bottom: 1px solid var(--mibd-frost);
}

.user-filter-item:last-child,
.project-filter-item:last-child {
    border-bottom: none;
}

.user-filter-item:hover,
.project-filter-item:hover {
    background: var(--mibd-blue-whisper);
}

.user-filter-item input[type="checkbox"],
.project-filter-item input[type="radio"] {
    margin-right: var(--sp-10);
    accent-color: var(--mibd-blue);
}

.user-filter-item-name,
.project-filter-item-name {
    font-size: 0.88rem;
    color: var(--mibd-charcoal);
}

.user-filter-item-username {
    color: var(--mibd-ash);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.user-filter-actions,
.project-filter-actions {
    display: flex;
    gap: var(--sp-8);
    position: sticky;
    bottom: 0;
    background: var(--mibd-white);
    padding: var(--sp-8) 0;
    border-top: 2px solid var(--mibd-blue);
}

.user-filter-actions button,
.project-filter-actions button {
    padding: var(--sp-7) var(--sp-14);
    font-size: 0.74rem;
    border-radius: var(--r-none);
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 2px solid var(--mibd-frost);
    background: var(--mibd-white);
    color: var(--mibd-charcoal);
    transition: all var(--t-fast) var(--ease-out);
}

.user-filter-actions button:hover,
.project-filter-actions button:hover {
    background: var(--mibd-blue);
    color: var(--mibd-white);
    border-color: var(--mibd-blue);
}

.user-filter-count,
.project-filter-count {
    color: var(--mibd-ash);
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════
   TEMPLATE STYLES
   ═══════════════════════════════════════ */
.template-section {
    background: var(--mibd-ice-pure);
    border: 2px solid var(--mibd-frost);
    border-top: 4px solid var(--mibd-blue);
    border-radius: var(--r-none);
    padding: var(--sp-24);
    margin-bottom: var(--sp-24);
}

.template-header {
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--mibd-blue);
    margin-bottom: var(--sp-16);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--mibd-frost);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.template-controls {
    display: flex;
    gap: var(--sp-8);
    align-items: center;
    flex-wrap: wrap;
}

.template-select {
    flex: 1;
    min-width: 150px;
    padding: var(--sp-10) var(--sp-18);
    border: 2px solid var(--mibd-frost);
    border-radius: var(--r-none);
    font-size: 0.92rem;
    font-family: var(--font-body);
    cursor: pointer;
    background: var(--mibd-white);
    color: var(--mibd-charcoal);
    border-left: 4px solid var(--mibd-mist);
}

.template-select:focus {
    outline: none;
    border-color: var(--mibd-blue);
    border-left-color: var(--mibd-blue);
}

.template-save-btn {
    background: var(--mibd-green);
    color: var(--mibd-white);
    padding: var(--sp-10) var(--sp-20);
    border: none;
    border-radius: var(--r-none);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all var(--t-fast) var(--ease-out);
}

.template-save-btn:hover {
    background: #15724c;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(26, 138, 92, 0.3);
}

.template-delete-btn {
    background: var(--mibd-red);
    color: var(--mibd-white);
    padding: var(--sp-8) var(--sp-16);
    border: none;
    border-radius: var(--r-none);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: auto;
    transition: all var(--t-fast) var(--ease-out);
}

.template-delete-btn:hover {
    background: #a93226;
    transform: translateY(-2px);
}

/* Template List Item Styles (used in dynamic JS-generated lists) */
.template-list-item {
    display: flex;
    align-items: center;
    padding: var(--sp-8) var(--sp-10);
    background: var(--mibd-white);
    border: 1px solid var(--mibd-frost);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-5);
}

.template-list-item:hover {
    background-color: var(--mibd-blue-whisper);
}

.template-list-name {
    flex: 1;
    font-size: 12px;
    color: var(--mibd-charcoal);
}

.template-list-empty,
.template-list-error {
    font-size: 12px;
    margin: var(--sp-8) 0;
}

.template-list-empty {
    color: var(--mibd-ash);
}

.template-list-error {
    color: var(--mibd-red-soft);
}

.template-name-display {
    flex: 1;
    text-align: center;
    color: var(--mibd-ash);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: var(--sp-24); }
.mb-20 { margin-bottom: var(--sp-24); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: var(--sp-12); }

/* ═══════════════════════════════════════
   MONTH LOCK MANAGEMENT STYLES
   ═══════════════════════════════════════ */
.month-lock-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-15);
}

.month-lock-item {
    padding: var(--sp-12);
    background: var(--mibd-ice-pure);
    border: 1px solid var(--mibd-frost);
    border-radius: var(--r-md);
}

.month-lock-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--mibd-charcoal);
    font-size: 0.9rem;
}

.month-lock-checkbox {
    margin-right: var(--sp-10);
    accent-color: var(--mibd-blue);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1400px) {
    .container {
        padding-left: var(--sp-16);
        padding-right: var(--sp-24);
    }
}

/* Responsive for ~14 inch screens and below - constrain calendar width to leave room for filter navbar */
/* For screens smaller than 968px, use even tighter spacing */
@media (min-width: 769px) and (max-width: 968px) {
    .calendar-content {
        max-width: calc(80vw);
    }
}

/* Responsive weekly view - ensure full parent container utilization */
@media (min-width: 769px) and (max-width: 1399px) {
    .week-container {
        max-width: none;
        width: calc(100% - var(--sp-64));
    }
}

/* Ensure all 7 days are visible without scrollbar on all screen sizes */
@media (min-width: 769px) {
    .week-container {
        overflow-x: hidden;
    }
    
    .week-day {
        flex: 1 1 0%;
        min-width: 0;
    }
}

/* Small screens (< 768px): ensure week-container fills parent container width */
@media (max-width: 768px) {
    /* Responsive filter dropdowns - position centered below filter buttons */
    .filter-dropdown,
    .user-filter-dropdown,
    .project-filter-dropdown {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        top: calc(var(--sp-48)); /* Below navbar and filter buttons */
        right: auto;
        width: calc(90vw);
        max-width: 420px;
    }
    
    /* Fix sticky positioning for small screens */
    .filter-search,
    .filter-actions {
        position: static;
    }
    
    .user-filter-search,
    .project-filter-search,
    .user-filter-actions,
    .project-filter-actions {
        position: static;
    }
    
    .week-container {
        width: 100%;
        max-width: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .week-day {
        flex: 1 1 0%;
        min-width: 0;
        width: auto;
    }

    .calendar-table {
        max-width: calc(100vw - var(--sp-24));
    }
    
    .calendar-table th {
        padding: var(--sp-10) var(--sp-4);
        font-size: 0.64rem;
    }
    
    .calendar-table td {
        height: var(--sp-100);
        padding: var(--sp-8);
    }
    
    .entry-form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .stat-card {
        border-right: none;
        border-bottom: 1px solid var(--mibd-frost);
    }
    
    .week-container {
        flex-direction: column;
        border: 2px solid var(--mibd-blue);
    }
    
    .week-day {
        border-right: none;
        border-bottom: 1px solid var(--mibd-frost);
    }
    
    .week-day:last-child {
        border-bottom: none;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: var(--sp-12);
    }
    
    .navbar nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .calendar-table td {
        height: var(--sp-80);
        padding: var(--sp-6);
    }
    
    .calendar-header h1 {
        font-size: 1.8rem;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .active-filters strong {
        margin-bottom: var(--sp-8);
    }
    
    .filter-badge {
        margin-bottom: var(--sp-8);
    }
    
    .user-filter-container-wrapper {
        z-index: 1003;
    }
    
    .user-filter-dropdown,
    .project-filter-dropdown {
        position: fixed;
        top: var(--sp-64);
        left: var(--sp-10);
        right: var(--sp-10);
        max-height: 65vh; /* Unified with other filter dropdowns */
        overflow-y: hidden;
        bottom: auto;
        display: flex;
        flex-direction: column;
    }
    
    .user-filter-list,
    .project-filter-list {
        flex-grow: 1; /* Allow growing to fill space between search and actions */
        max-height: calc(65vh - 240px); /* Must be smaller than parent to leave room for actions */
    }
    
    .stat-card .stat-value {
        font-size: 2.2rem;
    }
    
    .login-card {
        padding: var(--sp-32);
        box-shadow: var(--shadow-lg), 8px 8px 0 var(--mibd-blue-tint);
    }
}

/* ═══════════════════════════════════════
   ANIMATIONS — precise, mechanical reveals
   ═══════════════════════════════════════ */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideInFromBottom 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(5) { animation-delay: 0.33s; }

@keyframes statPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.stat-card:hover .stat-value {
    animation: statPulse 0.6s ease-in-out;
}

a, button, .card, .form-control, .filter-btn {
    transition-property: color, background-color, border-color, box-shadow, transform, opacity;
}