/* Container centré */
.container {
    padding: 15px;
}

/* Carte */
.card {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Groupe champ */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

/* Labels */
.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

/* Inputs */
.form-group input {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
}

/* Boutons */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Bouton principal */
.btn-primary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #007bff;
    color: white;
    font-size: 16px;
}

/* Bouton annuler */
.btn-cancel {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #ccc;
}

/* Responsive iPhone */
@media (max-width: 600px) {
    .form-actions {
        flex-direction: column;
    }

    .form-buttons {
        flex-direction: row;
    }
}


/* =======================
   1. Variables / palette
======================= */
:root {
    --bg-page: #f4f7ff;
    --bg-card: #ffffff;
    --border-light: #dbe6ff;

    --text-main: #1f2a44;
    --text-muted: #6b7280;

    --blue: #1a73e8;
    --blue-dark: #1669c1;
    --blue-light: #e9f2ff;

    --red: #ff3b30;
    --red-dark: #d92c23;

    --gray-btn: #e0e0e0;
    --gray-btn-dark: #d5d5d5;
    --gray-soft: #eef1f5;

    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

/* =======================
   2. Reset / base
======================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background: var(--bg-page);
    color: var(--text-main);
    overflow-x: hidden;
}

.container {
    max-width: 95%;
    margin: 20px auto 90px auto;
    padding: 0 10px;
}

p,
li {
    margin: 6px 0;
    font-size: 1em;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 10px;
    color: var(--text-main);
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3,
h4 {
    font-size: 18px;
}

a {
    text-decoration: none;
}

/* =======================
   3. Cartes
======================= */
.card {
    background: var(--bg-card);
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card p:last-child {
    margin-bottom: 0;
}

.card-header,
.card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    /* espace entre éléments */
}

/* =======================
   4. Boutons généraux
======================= */
button,
.add-button,
.form-inline button,
.btn-create,
.btn-primary,
.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Bouton par défaut */
button {
    background: var(--blue);
    color: #fff;
}

button:hover {
    background: var(--blue-dark);
}

/* Bouton principal */
.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

.btn-create {
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    min-height: 78px;
    padding: 50px 8px 6px;
    border: none;
    background: transparent url('../img/btn_coche.png') center top/42px 42px no-repeat;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.btn-create:hover {
    background: transparent url('../img/btn_coche.png') center top/42px 42px no-repeat;
}

/* Bouton annuler */
.btn-cancel {
    display: inline-flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    min-width: 120px;
    min-height: 78px;
    padding: 50px 8px 6px;
    border: none;
    background: transparent url('../img/btn_annuler.png') center top/42px 42px no-repeat;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    margin-left: 8px;
    flex: 0 0 auto;
    width: auto;
    text-decoration: none;
    text-align: center;
}

.btn-cancel:hover {
    background: transparent url('../img/btn_annuler.png') center top/42px 42px no-repeat;
}

/* =======================
   5. Boutons d’action
======================= */
.card-actions {
    display: flex;
    justify-content: flex-start;
}

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

.card-actions.back-fixed {
    margin-bottom: 12px;
}

.page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 95%;
    margin: 12px auto 8px;
    padding: 0 10px;
}

.page-topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.page-topbar-user-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 20px;
}

.page-topbar-user-name {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-button {
    flex-direction: column;
    min-width: 110px;
    padding: 12px 18px;
    background: var(--blue);
    color: #fff;
    box-shadow: var(--shadow);
}

.add-button:hover {
    background: var(--blue-dark);
}

.add-button .icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.add-button .label {
    font-size: 14px;
    font-weight: bold;
}

/*.btn-add {
    padding: 14px 16px;
    font-size: 18px;
}*/

.btn-add {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3B82F6, #1E40AF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-add:active {
    transform: scale(0.95);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.btn-back-arrow {
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    transform: translateY(-1px);
    font-weight: 400;
}

.btn-back:hover {
    background: #000;
    color: #fff;
}

/* =======================
   6. Formulaires
======================= */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.form-inline input,
.form-inline select,
.form-inline button,
.login-card input {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #cfd8e3;
    border-radius: var(--radius-sm);
}

.form-inline input,
.form-inline select {
    background: #fff;
    color: var(--text-main);
}

/* =======================
   7. Login
======================= */
.login-page {
    padding: 20px;
}

.login-container {
    max-width: 95%;
    margin: 20px auto 90px auto;
    padding: 0 10px;
}

.login-card {
    max-width: 400px;
    margin: 60px auto;
    padding: 24px 28px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    display: block;
    margin: 0 auto 16px;
    height: auto;
}

.login-title {
    display: block;
    width: 100%;
    margin: 0 0 8px 0;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
}

.login-subtitle {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.login-form-group {
    margin-bottom: 14px;
}

.login-label {
    display: block;
    margin: 0 0 5px 0;
    font-weight: bold;
    text-align: left;
    color: var(--text-main);
}

.login-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    margin-top: 20px;
}

.login-error {
    margin-bottom: 15px;
    padding: 10px;
    font-size: 14px;
    color: #fff;
    background: var(--red);
    border-radius: 8px;
    text-align: center;
}

.login-card .login-title {
    text-align: center;
}

/* =======================
   8. Tableaux
======================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

th,
td {
    padding: 10px;
    text-align: left;
}

.table-depenses {
    margin-top: 10px;
    font-family: Arial, sans-serif;
}

.table-depenses th,
.table-depenses td {
    border: 1px solid #d6deea;
}

.table-depenses thead th {
    background: var(--blue-dark);
    color: #fff;
}

.table-depenses tbody tr:nth-child(even) {
    background: #f7faff;
}

.table-depenses tbody tr:last-child {
    font-weight: bold;
    color: #fff;
    background: #1f2a44;
}

.table-etapes {
    margin-top: 10px;
    font-family: Arial, sans-serif;
}

.table-etapes th,
.table-etapes td {
    border: 1px solid #d6deea;
}

.table-etapes thead th {
    background: var(--blue-dark);
    color: #fff;
}

.table-etapes tbody tr:nth-child(even) {
    background: #f7faff;
}

.day-label-mobile {
    display: none;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.table-scroll table {
    min-width: 1100px;
}

.shopping-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

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

.shopping-trigger,
.shopping-trigger-cancel {
    flex: 0 0 auto;
    min-width: 140px;
}

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

.shopping-trigger-cancel {
    min-height: auto;
    padding: 10px 14px;
    background-position: 10px center;
    background-size: 28px 28px;
    padding-left: 44px;
    margin-left: 0;
}

.shopping-item {
    padding: 12px 14px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.shopping-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.shopping-quantity {
    font-weight: 700;
    color: var(--blue-dark);
}

.shopping-name {
    font-weight: 600;
}

.shopping-details {
    margin-top: 6px;
    font-size: 0.92em;
    color: var(--text-muted);
}

.shopping-meta {
    margin-top: 12px;
    font-size: 0.92em;
    color: var(--text-muted);
}

.mobile-week-view {
    display: none;
}

.mobile-week-days {
    display: flex;
    gap: 8px;
    margin: 12px 0 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.mobile-week-day-button {
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.mobile-week-day-button.is-active {
    background: var(--blue-dark);
    color: #fff;
}

.mobile-day-panel {
    display: none;
}

.mobile-day-panel.is-active {
    display: block;
}

.mobile-day-title {
    margin-bottom: 10px;
    font-size: 17px;
}

.mobile-meal-card {
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.mobile-meal-label {
    margin-bottom: 6px;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-meal-name {
    font-size: 16px;
    font-weight: 700;
}

.mobile-meal-recipe {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-muted);
}

.mobile-meal-empty {
    color: var(--text-muted);
    font-style: italic;
}

.vote-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.vote-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f7faff;
    border: 1px solid #d6deea;
    border-radius: 10px;
}

.vote-row label {
    min-width: 110px;
    font-weight: 600;
}

.vote-row select {
    min-width: 130px;
}

.votes-list {
    margin: 10px 0 0;
    padding-left: 18px;
}



/* =======================
   9. Participants (compact)
======================= */

.participants-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Ligne */
.participant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    /* ↓ réduit */
    border-bottom: none;
}

/* Texte */
.participant-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* ↓ réduit */
    font-size: 15px;
}

/* Nom */
.participant-nom {
    font-weight: 500;
}

/* alias */
.participant-alias {
    color: var(--text-muted);
    font-size: 13px;
}

/* Surnom */
.participant-surnom {
    font-weight: 600;
}

.participant-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;

    background: #e7f0ff;
    /* bleu très clair */
    color: #1a73e8;
    /* bleu doux */
    font-size: 18px;
    margin-left: 10px;
    /* espace spécifique */
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.participant-action:hover {
    background: #d6e6ff;
}

/* =======================
   10. Toggle
======================= */
.toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent url('../img/btn_plus.png') center/contain no-repeat;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    vertical-align: middle;
}

.toggle-button:hover {
    transform: none;
}

/* =======================
   11. Popup
======================= */
.popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.popup-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    padding: 20px;
    text-align: center;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.popup-box h3 {
    margin-bottom: 8px;
}

.popup-box button {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
}

.popup-box .edit {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 54px;
    background: #a3c9fc url('../img/btn_modifier.png') 12px center/32px 32px no-repeat;
    color: #0146a0;

    min-height: 54px;
}

.popup-box .edit:hover {
    background: #7db2f8;
    background: #4e9bff url('../img/btn_modifier.png') 12px center/32px 32px no-repeat;
}

.popup-box .delete {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 54px;
    background: #fff5f5 url('../img/btn_supprimer.png') 12px center/32px 32px no-repeat;
    color: var(--red-dark);

    min-height: 54px;
}

.popup-box .delete:hover {
    background: #ffe9e7 url('../img/btn_supprimer.png') 12px center/32px 32px no-repeat;
    color: var(--red-dark);
}

.popup-box .cancel {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 54px;
    background: #b4b4b4 url('../img/btn_annuler.png') 12px center/32px 32px no-repeat;
    color: var(--text-main);
    min-height: 54px;
}

.popup-box .cancel:hover {
    background: #5c5c5c url('../img/btn_annuler.png') 12px center/32px 32px no-repeat;

}

/* =======================
   12. Menu fixe bas
======================= */
.menu-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2px 0;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #d6deea;
    box-shadow: 0 -8px 24px rgba(31, 42, 68, 0.12);
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-container,
.mobile-menu-overlay {
    display: none;
}

.current-user-badge {
    position: absolute;
    top: 22px;
    right: 12px;
    left: auto;
    z-index: 1001;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    padding: 8px 12px;
    background: transparent;
    color: var(--text-main);
    border-radius: 999px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.current-user-badge-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 20px;
}

.current-user-badge span {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0 6px;
    width: 100%;
    min-width: 100%;
}

.menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex: 1 1 0;
    max-width: 160px;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: bold;
    color: #1f2a44;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.menu-icon {
    display: block;
    width: auto;
    height: 92px;
    max-width: 148px;
    margin-bottom: 6px;
    object-fit: contain;
}

.menu a:hover {
    color: #0f4fa8;
}

.mobile-menu {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #d6deea;
    box-shadow: 0 -8px 24px rgba(31, 42, 68, 0.12);
}

.mobile-menu-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 64px;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.mobile-menu-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.mobile-menu-more {
    cursor: pointer;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.32);
}

.mobile-menu-sheet {
    width: 100%;
    max-width: 420px;
    padding: 16px;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 30px rgba(17, 24, 39, 0.2);
}

.mobile-menu-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mobile-menu-close {
    width: auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--text-main);
    font-size: 13px;
}

.mobile-menu-sheet-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-menu-sheet-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #d6deea;
    border-radius: 12px;
    background: #f7faff;
    color: var(--text-main);
    font-weight: 700;
}

.mobile-menu-sheet-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

/* =======================
   13. Responsive
======================= */
@media (max-width: 600px) {
    body {
        font-size: 17px;
    }

    .container {
        padding: 0 8px;
    }

    .card {
        padding: 16px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 19px;
    }

    .form-inline {
        flex-direction: column;
    }

    .day-label-desktop {
        display: none;
    }

    .day-label-mobile {
        display: inline;
    }

    .mobile-week-view {
        display: block;
    }

    .table-scroll {
        display: none;
    }

    .form-inline input,
    .form-inline select,
    .form-inline button,
    button {
        width: 100%;
    }

    .form-buttons button,
    .form-buttons .btn-cancel,
    .form-buttons .btn-create {
        width: auto;
    }

    .login-card {
        margin: 40px 20px;
        padding: 20px;
    }

    .menu a {
        font-size: 12px;
        min-width: 74px;
    }

    .current-user-badge {
        top: 8px;
        right: 8px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .menu-icon {
        width: 48px;
        height: 48px;
    }

    .menu-container {
        display: none;
    }

    .mobile-menu-container {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        display: block;
    }

    .btn-cancel {
        margin-left: 0;
    }
}

.lock-icon {
    color: #666;
    font-size: 0.9em;
    margin-left: 6px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 250px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;

    opacity: 0;
    transform: translateY(-20px);
    animation: fadeIn 0.3s forwards;
}

.toast.success {
    background: #2ecc71;
}

.toast.error {
    background: #e74c3c;
}

.calendar-view-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-intro {
    display: grid;
    grid-template-columns: fit-content(620px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.calendar-intro .calendar-intro-main h2 {
    margin-bottom: 6px;
}

.calendar-intro-main,
.calendar-intro-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calendar-intro-main {
    min-width: 0;
}

.calendar-intro-text {
    margin: 0;
    line-height: 1.45;
    font-size: 0.98rem;
}

.calendar-intro-side {
    gap: 12px;
    align-items: flex-start;
    justify-self: start;
    padding-right: 18px;
    border-right: 1px solid var(--border-light);
    flex-direction: row;
    flex-wrap: wrap;
}

.add-button.calendar-intro-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    min-width: 260px;
    min-height: 138px;
    padding: 12px 0;
    background: transparent;
    color: var(--text-main);
    border: none;
    box-shadow: none;
}

.add-button.calendar-intro-button .icon {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 72px;
    margin-bottom: 0;
}

.add-button.calendar-intro-button .label {
    text-align: left;
    width: 100%;
}

.calendar-intro-button-icon {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.calendar-intro-button-secondary {
    color: var(--text-main);
}

.calendar-intro-button:hover,
.calendar-intro-button-secondary:hover {
    background: transparent;
}

.calendar-view-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.calendar-view-switch-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: #f7faff;
    color: var(--text-main);
    font-weight: 800;
}

.calendar-view-switch-item.is-active {
    background: #e9f2ff;
    border-color: var(--blue);
    color: var(--blue-dark);
    box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.15);
}

.calendar-view-help {
    color: var(--text-muted);
    font-size: 14px;
}

.calendar-filter-form {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.calendar-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
}

.calendar-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

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

.calendar-selector-action {
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: #eef4ff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
}

.calendar-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-selector-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: #f7faff;
    font-size: 14px;
    font-weight: 600;
}

.calendar-selector-item span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-selector-meta {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.calendar-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: #f7faff;
    color: var(--text-main);
    font-weight: 700;
}

.calendar-view-tab.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

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

.calendar-nav-arrow {
    flex: 0 0 auto;
    min-width: 38px;
    min-height: 34px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.calendar-planning-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
}

.calendar-planning-table {
    width: auto;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.calendar-planning-table th,
.calendar-planning-table td {
    min-width: 72px;
    padding: 4px;
    border: 1px solid #d9e2f2;
    vertical-align: top;
}

.calendar-planning-sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #ffffff;
}

.calendar-planning-name-head {
    min-width: 150px;
    background: #eaf2ff;
    color: #17325c;
}

.calendar-planning-name-cell {
    min-width: 150px;
    background: #f8fbff;
}

.calendar-planning-day-head {
    text-align: center;
    background: #eef4ff;
    color: #2d4a73;
}

.calendar-planning-day-head.is-weekend {
    background: #fff5d9;
}

.calendar-planning-day-head.is-today {
    background: #fff1f1;
}

.calendar-planning-list-table .calendar-planning-name-cell.is-weekend {
    background: #fff5d9;
}

.calendar-planning-list-table .calendar-planning-name-cell.is-today {
    background: #fff1f1;
}

.calendar-planning-weekday,
.calendar-planning-daynum {
    display: block;
}

.calendar-planning-weekday {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.calendar-planning-daynum {
    margin-top: 1px;
    font-size: 14px;
    font-weight: 800;
}

.calendar-planning-person {
    display: block;
    font-weight: 800;
}

.calendar-planning-calendar-name {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
}

.calendar-planning-cell {
    height: 68px;
    background: #ffffff;
}

.calendar-planning-cell.is-weekend {
    background: #fffdf3;
}

.calendar-planning-cell.is-today {
    background: #fff8f8;
}

.calendar-planning-event {
    display: block;
    width: 100%;
    margin-bottom: 3px;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-month-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
}

.calendar-month-weeks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-months-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.calendar-month-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-month-section-title {
    font-size: 18px;
    font-weight: 800;
    color: #16345f;
}

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

.calendar-month-week {
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: linear-gradient(180deg, #fcfdff 0%, #f4f8ff 100%);
    box-shadow: 0 8px 18px rgba(26, 115, 232, 0.06);
}

.calendar-month-head {
    padding: 8px;
    font-weight: 700;
    text-align: center;
    border-radius: 10px;
    background: #eef4ff;
    color: #35507a;
}

.calendar-day {
    position: relative;
    min-height: 150px;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    overflow: hidden;
}

.calendar-day > * {
    position: relative;
    z-index: 1;
}

.calendar-day.has-guard-transition {
    border-color: rgba(31, 42, 68, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.calendar-day.is-muted {
    background: #f3f4f6;
    opacity: 0.75;
}

.calendar-day.is-weekend {
    background: linear-gradient(180deg, #fffef8 0%, #fff9ea 100%);
}

.calendar-day.is-today {
    border-color: #f3b1b1;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.10);
}

.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    font-weight: 700;
    font-size: 15px;
    color: #16345f;
    border-radius: 999px;
}

.calendar-day.is-today .calendar-day-number {
    border: 2px solid #dc2626;
    color: #b91c1c;
    background: #fff5f5;
}

.calendar-day-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: 700;
}

.calendar-chip {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-chip-block {
    display: block;
    width: 100%;
}

.calendar-event-trigger {
    border: none;
    cursor: pointer;
}

.calendar-chip-owner {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    opacity: 0.85;
    text-transform: uppercase;
}

.calendar-guard-chip {
    position: relative;
    min-height: 42px;
    padding: 6px 78px;
    border: none;
    border-radius: 10px;
    color: #fff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.calendar-guard-chip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--guard-bottom-color, #e56be8);
    z-index: 0;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.calendar-guard-chip > * {
    position: relative;
    z-index: 1;
}

.calendar-guard-chip-main,
.calendar-guard-chip-alt,
.calendar-guard-chip-owner {
    display: block;
    color: #fff;
    line-height: 1.05;
}

.calendar-guard-chip-main,
.calendar-guard-chip-alt {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 68px;
}

.calendar-guard-chip-main {
    left: 10px;
    text-align: left;
}

.calendar-guard-chip-alt {
    right: 10px;
    text-align: right;
}

.calendar-guard-chip-owner {
    margin: 0;
    padding: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: center;
    white-space: normal;
    width: 100%;
}

.calendar-more-events {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

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

.calendar-week-column {
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: #fff;
}

.calendar-empty {
    color: var(--text-muted);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .calendar-week-grid {
        grid-template-columns: 1fr;
    }

    .calendar-nav {
        justify-content: center;
    }

    .calendar-view-tabs {
        justify-content: center;
    }

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

    .calendar-intro-side {
        align-items: stretch;
        padding-right: 0;
        padding-top: 14px;
        border-right: none;
        border-top: 1px solid var(--border-light);
    }

    .calendar-intro-button {
        width: 100%;
        min-width: 0;
    }

    .calendar-filter-form {
        align-items: stretch;
    }

    .calendar-selector {
        min-width: 100%;
    }

    .calendar-month-grid {
        min-width: 840px;
    }

    .calendar-planning-table {
        min-width: 860px;
    }

    .calendar-month-week {
        padding: 8px;
    }

    .calendar-day {
        min-height: 120px;
        padding: 8px;
    }

    .calendar-chip {
        font-size: 11px;
        padding: 3px 6px;
    }
}
