/* /root/vkbot/web/static/calendar.css — версия «Кондитер 2.1» */

* { box-sizing: border-box; }

/* ===== CSS-ПЕРЕМЕННЫЕ ===== */
:root {
    --bg: #faf7f2;
    --surface: #ffffff;
    --surface-hover: #fdf5e6;
    --border: #f0e6d2;
    --text: #4a3728;
    --text-secondary: #8b7355;
    --text-muted: #b8a088;
    --accent: #e07a5f;
    --accent-soft: #fef0eb;
    --green: #6b8f71;
    --green-soft: #edf5ee;
    --blue: #6b8f9e;
    --blue-soft: #edf3f5;
    --orange: #e09f5f;
    --orange-soft: #fef5eb;
    --red: #c97d7d;
    --red-soft: #fef0f0;
    --shadow: 0 2px 12px rgba(74, 55, 40, 0.06);
    --shadow-hover: 0 4px 20px rgba(74, 55, 40, 0.10);
    --radius: 16px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== СВЕТЛАЯ ТЕМА ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

#calendar {
    max-width: 1000px; margin: 0 auto; padding: 20px;
    border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow);
    transition: background var(--transition), box-shadow var(--transition);
}

.fc .fc-toolbar { padding-top: 4px; }
.fc .fc-toolbar-title { color: var(--text); font-weight: 600; }
.fc .fc-button {
    background: var(--border); border: none; color: var(--text-secondary);
    border-radius: 10px; padding: 6px 14px; font-weight: 500;
    transition: all var(--transition);
}
.fc .fc-button:hover { background: #e8d5b7; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--accent); color: #fff; }
.fc .fc-daygrid-day-number { color: var(--text-secondary); font-weight: 500; }
.fc .fc-col-header-cell-cushion { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.fc .fc-day-today { background: var(--accent-soft) !important; }

.fc-event {
    font-size: 12px; padding: 3px 6px; border-radius: 8px;
    cursor: pointer; border: none; transition: transform 0.15s, box-shadow 0.15s;
}
.fc-event:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.fc-event-title { font-weight: 500; }

/* ===== МОБИЛЬНЫЙ СПИСОК ===== */
#mobileList {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    font-size: 16px;
    min-height: 100vh;
}

.mobile-header {
    margin-bottom: 16px;
    text-align: center;
}

.mobile-greeting {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #d4a574);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.mobile-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0;
}

.mobile-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    min-width: 180px;
}

.week-arrow {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    padding: 0;
    line-height: 1;
}

.week-arrow:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.week-arrow:active {
    transform: scale(0.92);
    background: var(--accent-soft);
}

.mobile-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.day-pills {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 4px 0 20px;
    overflow-x: visible;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.day-pills::-webkit-scrollbar { display: none; }

.day-pill {
    min-width: unset;
    width: 100%;
    padding: 8px 2px 6px;
    border-radius: 16px;
    background: var(--surface);
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    position: relative;
}

.day-pill:active {
    transform: scale(0.94);
}

.day-pill.today {
    background: linear-gradient(135deg, #fce4d6, #fef0eb);
    border-color: var(--accent);
    box-shadow: 0 4px 18px rgba(224, 122, 95, 0.2);
}

.day-pill.today .day-pill-weekday { color: var(--accent); }
.day-pill.today .day-pill-num { color: var(--accent); }

.day-pill.load-high .day-pill-num::after {
    content: '';
    position: absolute;
    top: 4px; right: 8px;
    width: 7px; height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 1; }
}

.day-pill-weekday {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.day-pill-num {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    position: relative;
}

.day-pill-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(224, 122, 95, 0.4);
    padding: 0 4px;
}

.mobile-day-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease-out;
}

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

.mobile-day-header {
    font-size: 15px;
    font-weight: 700;
    padding: 8px 0 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.mobile-day-header.today-header {
    color: var(--accent);
}

.mobile-day-header.today-header::before {
    content: '⭐';
    font-size: 18px;
}

.day-count {
    font-size: 12px;
    font-weight: 600;
    background: var(--border);
    padding: 3px 12px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.mobile-event-card {
    display: flex;
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                border-color 0.25s;
    border: 1.5px solid transparent;
}

.mobile-event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.mobile-event-card:active {
    transform: scale(0.985);
    box-shadow: var(--shadow);
}

.card-status-bar {
    width: 5px;
    flex-shrink: 0;
    border-radius: 0 0 0 var(--radius);
}

.status-new .card-status-bar { background: #d4c5b2; }
.status-confirmed .card-status-bar { background: linear-gradient(180deg, var(--orange), #e09f5f); }
.status-done .card-status-bar { background: linear-gradient(180deg, var(--green), #6b8f71); }
.status-cancelled .card-status-bar { background: #e0d5c5; }

.status-confirmed { border-color: #fef5eb; }
.status-done { border-color: #edf5ee; }

.card-body {
    padding: 16px;
    flex: 1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-customer {
    font-weight: 700;
    flex: 1;
    color: var(--text);
    font-size: 15px;
}

.card-time {
    font-size: 13px;
    font-weight: 600;
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 10px;
    color: var(--text-secondary);
}

.card-status-text {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--border);
    color: var(--text-secondary);
}

.status-done .card-status-text {
    background: var(--green-soft);
    color: var(--green);
}

.status-confirmed .card-status-text {
    background: var(--orange-soft);
    color: #c07d3a;
}

.status-new .card-status-text {
    background: #f5f0eb;
    color: #8b7355;
}

.status-cancelled .card-status-text {
    background: var(--red-soft);
    color: var(--red);
    text-decoration: line-through;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.product-icon {
    font-size: 20px;
}

.product-name {
    font-weight: 600;
    color: var(--text);
}

.product-weight, .product-filling {
    font-size: 13px;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.card-info {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-event-empty {
    text-align: center;
    padding: 28px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.empty-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.mobile-event-item {
    display: none;
}

/* ===== МОДАЛКА ===== */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    margin: 5% auto; padding: 28px 28px 0 28px;
    border-radius: 20px;
    max-width: 550px; font-size: 15px; line-height: 1.6;
    max-height: 85vh; overflow-y: auto;
    background: var(--surface); color: var(--text);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.modal-date-row {
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-row { margin-bottom: 10px; }
.modal-row span {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-row input,
.modal-row select,
.modal-row textarea {
    width: 100%; padding: 12px 14px; margin-top: 4px;
    border: 2px solid var(--border);
    border-radius: 12px; font-size: 15px;
    background: var(--bg); color: var(--text);
    transition: border var(--transition), box-shadow var(--transition);
}

.modal-row input:focus,
.modal-row select:focus,
.modal-row textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.1);
}

.modal-row textarea { resize: vertical; min-height: 60px; }

.item-block {
    border-radius: var(--radius-sm);
    padding: 14px; margin: 10px 0; position: relative;
    background: var(--bg);
    border: 1.5px solid var(--border);
    transition: background var(--transition), border var(--transition), opacity 0.3s;
}

.item-deleted {
    opacity: 0.35;
    text-decoration: line-through;
    background: var(--red-soft);
    border-color: #f5d5d5;
}

.customer-link {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 1px dashed var(--accent);
}
.customer-link:hover { color: #c96e4e; border-bottom-style: solid; }

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn {
    padding: 10px 18px; border: none; border-radius: 12px;
    cursor: pointer; font-size: 14px; font-weight: 700; color: #fff;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-confirm { background: linear-gradient(135deg, #6b8f71, #5a7d60); }
.btn-cancel { background: linear-gradient(135deg, #c97d7d, #b56b6b); }
.btn-done { background: linear-gradient(135deg, #6b8f9e, #5a7d8c); }
.btn-edit { background: linear-gradient(135deg, #e09f5f, #d48d4c); }
.btn-save { background: linear-gradient(135deg, #6b8f71, #5a7d60); }
.btn-close { background: #b8a088; }

.btn-delete,
.btn-restore {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-delete {
    color: var(--red);
    border: 2px solid var(--red);
}
.btn-delete:hover { background: var(--red); color: #fff; }

.btn-restore {
    color: var(--orange);
    border: 2px solid var(--orange);
}
.btn-restore:hover { background: var(--orange); color: #fff; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.status-msg { margin-top: 10px; font-size: 13px; font-weight: 600; }
.status-msg.success { color: var(--green); }
.status-msg.error { color: var(--red); }

.modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding: 16px 28px;
    margin: 16px -28px 0 -28px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 20px 20px;
    z-index: 5;
}

/* ===== ТЁМНАЯ ТЕМА ===== */
body.dark {
    --bg: #1a1a24;
    --surface: #23232e;
    --surface-hover: #2a2a38;
    --border: #33334a;
    --text: #e8e0d5;
    --text-secondary: #b8a088;
    --text-muted: #7a6e60;
    --accent: #f0a58a;
    --accent-soft: #2a1f1a;
    --green: #81b895;
    --green-soft: #1a2a1f;
    --blue: #81b0c0;
    --blue-soft: #1a252a;
    --orange: #e0b080;
    --orange-soft: #2a241a;
    --red: #d49595;
    --red-soft: #2a1f1f;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.5);
}

body.dark #calendar { background: var(--surface); box-shadow: var(--shadow); }
body.dark .fc .fc-toolbar-title { color: var(--text); }
body.dark .fc .fc-button { background: var(--border); color: var(--text-secondary); }
body.dark .fc .fc-button:hover { background: #44445a; }
body.dark .fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--accent); color: #1a1a24; }
body.dark .fc .fc-daygrid-day-number { color: var(--text-muted); }
body.dark .fc .fc-col-header-cell-cushion { color: var(--text-muted); }
body.dark .fc .fc-day-today { background: var(--accent-soft) !important; }
body.dark .fc .fc-scrollgrid { border-color: var(--border); }
body.dark .fc .fc-daygrid-day-frame { border-color: var(--border); }
body.dark .fc-event:hover { box-shadow: var(--shadow-hover); }

body.dark .mobile-greeting {
    background: linear-gradient(135deg, var(--accent), #e0b080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark .week-arrow {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

body.dark .week-arrow:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

body.dark .day-pill {
    background: var(--surface);
    border-color: var(--border);
}
body.dark .day-pill.today {
    background: var(--accent-soft);
    border-color: var(--accent);
}
body.dark .day-pill-num { color: var(--text); }

body.dark .mobile-day-header { color: var(--text); }
body.dark .mobile-day-header.today-header { color: var(--accent); }
body.dark .day-count { background: var(--border); color: var(--text-secondary); }

body.dark .mobile-event-card {
    background: var(--surface);
    box-shadow: var(--shadow);
    border-color: var(--border);
}
body.dark .mobile-event-card:hover { box-shadow: var(--shadow-hover); }
body.dark .card-customer { color: var(--text); }
body.dark .card-desc { color: var(--text-secondary); }
body.dark .card-time { background: var(--bg); color: var(--text-secondary); }
body.dark .product-weight, body.dark .product-filling { background: var(--bg); }
body.dark .card-info { color: var(--text-muted); }
body.dark .card-status-text { background: var(--border); color: var(--text-secondary); }
body.dark .status-done .card-status-text { background: var(--green-soft); color: var(--green); }
body.dark .status-confirmed .card-status-text { background: var(--orange-soft); color: var(--orange); }
body.dark .status-new .card-status-text { background: #2a2a38; color: #8b8b8b; }
body.dark .status-cancelled .card-status-text { background: var(--red-soft); color: var(--red); }

body.dark .mobile-event-empty {
    background: var(--surface);
    border-color: var(--border);
}
body.dark .empty-text { color: var(--text-muted); }

body.dark .modal-content { background: var(--surface); box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
body.dark .modal-content h3 { color: var(--text); }
body.dark .modal-row span { color: var(--text-muted); }
body.dark .modal-row input,
body.dark .modal-row select,
body.dark .modal-row textarea {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}
body.dark .modal-row input:focus,
body.dark .modal-row select:focus,
body.dark .modal-row textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(240, 165, 138, 0.15);
}
body.dark .item-block { background: var(--bg); border-color: var(--border); }
body.dark .item-deleted { background: var(--red-soft); border-color: #4a3030; }
body.dark .customer-link { color: var(--accent); }
body.dark .btn-close { background: #55556a; }
body.dark .btn-delete { background: rgba(212, 149, 149, 0.15); }
body.dark .btn-restore { background: rgba(224, 176, 128, 0.15); }
body.dark input[type=number]::-webkit-inner-spin-button,
body.dark input[type=number]::-webkit-outer-spin-button { filter: invert(1); }
body.dark select { color-scheme: dark; }
body.dark .modal-footer { background: var(--surface); border-top-color: var(--border); }

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 768px) {
    body {
        margin: 0;
        font-size: 17px;
    }

    #calendar {
        max-width: 100%;
        margin: 0;
        padding: 8px;
        border-radius: 0;
        box-shadow: none;
        font-size: 14px;
    }

    #mobileList {
        max-width: 100%;
        padding: 20px 16px 60px;
    }

    .mobile-header {
        margin-bottom: 20px;
        text-align: center;
    }

    .mobile-greeting {
        font-size: 28px;
        font-weight: 800;
        background: linear-gradient(135deg, #e07a5f, #d4a574);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-bottom: 4px;
    }

    .mobile-title-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        margin: 8px 0;
    }

    .mobile-title {
        font-size: 18px;
        font-weight: 700;
        color: var(--text);
        min-width: 200px;
    }

    .week-arrow {
        background: var(--surface);
        border: 2px solid var(--border);
        border-radius: 50%;
        width: 42px;
        height: 42px;
        font-size: 20px;
        cursor: pointer;
        color: var(--text);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        box-shadow: var(--shadow);
        padding: 0;
        line-height: 1;
    }

    .week-arrow:active {
        transform: scale(0.92);
        background: var(--accent-soft);
    }

    .mobile-subtitle {
        font-size: 14px;
        color: var(--text-muted);
        margin-top: 2px;
    }

    .day-pills {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
        padding: 8px 0 20px;
    }

    .day-pill {
        min-width: unset;
        width: 100%;
        padding: 10px 2px 8px;
        border-radius: 16px;
    }

    .day-pill-weekday {
        font-size: 10px;
    }

    .day-pill-num {
        font-size: 20px;
    }

    .day-pill-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: #e07a5f;
        color: white;
        font-size: 10px;
        font-weight: 800;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(224, 122, 95, 0.4);
        padding: 0 4px;
    }

    .mobile-day-header {
        font-size: 17px;
        padding: 10px 0 14px;
        gap: 12px;
    }

    .day-count {
        font-size: 13px;
        padding: 4px 14px;
    }

    .mobile-event-card {
        border-radius: 18px;
        margin-bottom: 12px;
    }

    .card-body {
        padding: 18px;
    }

    .card-customer {
        font-size: 17px;
    }

    .card-desc {
        font-size: 15px;
        gap: 6px;
    }

    .product-icon {
        font-size: 24px;
    }

    .product-name {
        font-size: 15px;
    }

    .product-weight, .product-filling {
        font-size: 14px;
        padding: 3px 10px;
    }

    .card-info {
        font-size: 13px;
        margin-top: 10px;
    }

    .card-time {
        font-size: 14px;
        font-weight: 600;
        background: var(--bg);
        padding: 3px 10px;
        border-radius: 10px;
    }

    .card-status-text {
        font-size: 12px;
        padding: 4px 12px;
    }

    .mobile-event-empty {
        padding: 32px 16px;
        border-radius: 18px;
    }

    .empty-icon {
        font-size: 42px;
    }

    .empty-text {
        font-size: 15px;
    }

    .fc .fc-toolbar {
        padding-top: 4px !important;
    }

    .fc .fc-toolbar-title {
        font-size: 16px !important;
        width: 100%;
        text-align: center;
        order: -1;
    }

    .fc .fc-toolbar-chunk {
        margin: 2px 0;
    }

    .fc .fc-button {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 14px;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 60px;
    }

    .fc .fc-daygrid-day-number {
        font-size: 16px;
        padding: 5px 8px;
    }

    .fc .fc-col-header-cell-cushion {
        font-size: 12px;
        padding: 8px 2px;
    }

    .fc-event {
        font-size: 14px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .fc-event-title {
        font-weight: 600;
        white-space: normal;
    }

    /* ===== ФИКС МОДАЛКИ НА МОБИЛКАХ ===== */
    .modal {
        background-color: rgba(0,0,0,0.5);
    }

    .modal-content {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 20px 16px max(16px, env(safe-area-inset-bottom, 0px)) 16px;
        font-size: 16px;
        overflow-y: auto;
    }

    .modal-content h3 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .modal-date-row {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .modal-row {
        margin-bottom: 14px;
    }

    .modal-row span {
        font-size: 13px;
    }

    .modal-row input,
    .modal-row select,
    .modal-row textarea {
        font-size: 17px;
        padding: 14px;
        border-radius: 14px;
    }

    .item-block {
        padding: 16px;
        margin: 10px 0;
        font-size: 16px;
        border-radius: 14px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 14px;
    }

    .btn-group {
        gap: 10px;
    }

    .btn-delete,
    .btn-restore {
        font-size: 13px;
        padding: 6px 12px;
        top: 10px;
        right: 10px;
    }

    /* Футер с кнопками — flex с переносом */
    .modal-footer {
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
        margin: 16px -20px 0 -20px;
        border-radius: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        position: sticky;
        bottom: 0;
    }

    .modal-footer .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 0;
    }

    .modal-footer .btn-group .btn {
        flex: 1 1 auto;
        min-width: 100px;
        width: auto;
        padding: 14px 12px;
        font-size: 15px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* На очень узких экранах — всё в столбик */
    @media (max-width: 360px) {
        .modal-footer .btn-group {
            flex-direction: column;
        }
        .modal-footer .btn-group .btn {
            width: 100%;
        }
    }

    .status-msg {
        font-size: 15px;
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }
}
