/* ========================================
   HOME PAGE STYLES - BOT 3.0 PREMIUM
   ======================================== */

:root {
    --header-bg: #1e3a5f;
    --danger: #c0392b;
    --warning: #f39c12;
    --success: #1e8449;
    --primary: #2980b9;
    --bg-page: #1e3a5f;
    --bg-content: #ffffff;
    --text-dark: #1a1a2e;
    --text-gray: #666;
    --text-white: #ffffff;
    --border: #e5e5e5;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --primary-rgb: 52, 152, 219;
    --glow-blue: rgba(52, 152, 219, 0.4);
    --glow-purple: rgba(142, 68, 173, 0.3);
    --gradient-header: linear-gradient(-45deg, #1a2a6c, #1e3a5f, #2d4a7f, #16213e);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    padding: 0;
}

/* Футер показывается из base.html */

/* ========================================
   HEADER
   ======================================== */

.home-header {
    background: var(--gradient-header);
    background-size: 300% 300%;
    animation: headerGradient 12s ease infinite;
    padding: 16px;
    position: relative;
}

@keyframes headerGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
    box-shadow: 0 0 15px var(--glow-blue), 0 0 30px rgba(52, 152, 219, 0.15);
    transition: box-shadow 0.3s, transform 0.3s;
}

.profile-avatar:hover {
    box-shadow: 0 0 20px var(--glow-blue), 0 0 40px rgba(52, 152, 219, 0.25);
    transform: scale(1.05);
}

.profile-info {
    color: var(--text-white);
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
}

.profile-position {
    font-size: 13px;
    opacity: 0.8;
}

.notification-btn {
    position: relative;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
}

.notification-btn:active {
    transform: scale(0.92);
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.notification-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* FileDrop Header Button */
.filedrop-header-btn {
    position: relative;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(247, 147, 30, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    animation: filedropBorderGlow 3s ease-in-out infinite;
}

.filedrop-header-btn svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.filedrop-header-btn:active {
    transform: scale(0.92);
}

.filedrop-header-btn:hover {
    background: rgba(247, 147, 30, 0.15);
    border-color: rgba(247, 147, 30, 0.8);
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.35), 0 0 36px rgba(200, 80, 192, 0.15);
}

@keyframes filedropBorderGlow {

    0%,
    100% {
        border-color: rgba(247, 147, 30, 0.5);
        box-shadow: 0 0 8px rgba(247, 147, 30, 0.15);
    }

    50% {
        border-color: rgba(200, 80, 192, 0.6);
        box-shadow: 0 0 14px rgba(200, 80, 192, 0.25);
    }
}

/* Скрываем кнопку FileDrop в ПК-версии */
.desktop-app .filedrop-header-btn {
    display: none !important;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff4757, #ff3f34);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 16px rgba(255, 71, 87, 0.7);
    }
}

.object-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.object-bar:active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.15);
}

.object-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    flex-shrink: 0;
}

.object-name {
    font-weight: 600;
}

.object-divider {
    opacity: 0.5;
}

.object-stage {
    opacity: 0.8;
    margin-left: auto;
}

.object-arrow {
    opacity: 0.6;
}

/* Object Dropdown */
.object-dropdown {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    z-index: 500;
    max-height: 250px;
    overflow-y: auto;
}

.object-dropdown-list {
    padding: 8px 0;
}

.object-dropdown-item {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.object-dropdown-item:hover {
    background: #f5f5f5;
}

.object-dropdown-item.selected {
    background: #e8f4fd;
}

.object-dropdown-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.object-dropdown-status {
    font-size: 12px;
    color: var(--text-gray);
}

.object-status-dot.status-none {
    background: #999;
}

.object-status-dot.status-prep {
    background: #9e9e9e;
}

.object-status-dot.status-smr {
    background: #2196f3;
}

.object-status-dot.status-delivery {
    background: #ff9800;
}

.object-status-dot.status-pre-opening {
    background: #ffc107;
}

.object-status-dot.status-opening {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.object-status-dot.status-reporting {
    background: #00c853;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    }

    50% {
        box-shadow: 0 0 14px rgba(76, 175, 80, 0.8);
    }
}

/* ========================================
   PROJECT PROGRESS — STEPPER
   ======================================== */

.project-progress {
    margin-top: 10px;
    padding: 0 8px 6px;
}

/* Заголовок с процентом */
.stepper-header {
    text-align: center;
    margin-bottom: 8px;
}

.stepper-percent {
    display: inline-block;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #4facfe, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

/* Контейнер шагов */
.stepper-track {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    padding: 0 4px;
}

/* Один шаг */
.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

/* === COIN FLIP === */
.stepper-coin {
    width: 38px;
    height: 38px;
    perspective: 400px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.stepper-coin-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stepper-coin.flipped .stepper-coin-inner {
    transform: rotateY(180deg);
}

.stepper-coin-front,
.stepper-coin-back {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Лицевая — эмодзи */
.stepper-coin-front {
    font-size: 16px;
}

/* Обратная — дата */
.stepper-coin-back {
    transform: rotateY(180deg);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Стили по статусам */
.stepper-step.pending .stepper-coin-front,
.stepper-step.pending .stepper-coin-back {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 0.65;
    filter: grayscale(0.5);
    color: rgba(255, 255, 255, 0.5);
}

.stepper-step.completed .stepper-coin-front,
.stepper-step.completed .stepper-coin-back {
    background: rgba(46, 204, 113, 0.15);
    border: 2px solid rgba(46, 204, 113, 0.5);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.2);
    color: rgba(46, 204, 113, 0.9);
}

.stepper-step.completed .stepper-coin {
    animation: stepBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.stepper-step.active .stepper-coin-front,
.stepper-step.active .stepper-coin-back {
    background: rgba(79, 172, 254, 0.2);
    border: 2px solid rgba(79, 172, 254, 0.7);
    box-shadow: 0 0 16px rgba(79, 172, 254, 0.3),
        0 0 32px rgba(79, 172, 254, 0.1);
    color: rgba(79, 172, 254, 0.95);
    animation: stepPulse 2s ease-in-out infinite;
}

/* Подпись шага */
.stepper-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52px;
    letter-spacing: 0.3px;
    transition: all 0.3s;
}

.stepper-step.completed .stepper-label {
    color: rgba(46, 204, 113, 0.7);
}

.stepper-step.active .stepper-label {
    color: rgba(79, 172, 254, 0.9);
    font-weight: 600;
}

/* === КОННЕКТОРЫ С ПОЛЗУЩИМ ЗАПОЛНЕНИЕМ === */
.stepper-connector {
    position: absolute;
    top: 19px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 0;
    border-radius: 1px;
    overflow: hidden;
}

/* Внутренняя заполняющая полоска */
.stepper-connector-fill {
    height: 100%;
    width: 0%;
    border-radius: 1px;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.6), rgba(79, 172, 254, 0.6));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stepper-connector-fill.full {
    width: 100%;
    background: rgba(46, 204, 113, 0.5);
}

/* Shimmer на заполненных */
.stepper-connector-fill.full::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: connectorShimmer 2.5s ease-in-out infinite;
}

/* Пульс на ползущем */
.stepper-connector-fill.crawling::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(79, 172, 254, 0.8);
    box-shadow: 0 0 8px rgba(79, 172, 254, 0.6);
    animation: crawlPulse 1.5s ease-in-out infinite;
}

/* Галочка на пройдённых */
.stepper-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #2ecc71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
    border: 2px solid #1e3a5f;
    z-index: 2;
    animation: checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ===== ANIMATIONS ===== */

@keyframes stepBounceIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes stepPulse {

    0%,
    100% {
        box-shadow: 0 0 16px rgba(79, 172, 254, 0.3),
            0 0 32px rgba(79, 172, 254, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(79, 172, 254, 0.5),
            0 0 40px rgba(79, 172, 254, 0.15);
    }
}

@keyframes connectorShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes crawlPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.6);
    }
}

@keyframes checkPop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* ===== WAVE PULSE ANIMATION ===== */

/* Плавное свечение на монетке — мягкое нарастание и затухание */
@keyframes waveCoinGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
        filter: brightness(1);
    }

    40% {
        box-shadow: 0 0 18px 6px rgba(79, 172, 254, 0.7),
            0 0 36px 12px rgba(46, 204, 113, 0.3);
        filter: brightness(1.4);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
        filter: brightness(1);
    }
}

/* Плавное свечение для активной — чуть ярче и дольше */
@keyframes waveCoinGlowActive {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 172, 254, 0);
        filter: brightness(1);
    }

    40% {
        box-shadow: 0 0 22px 8px rgba(79, 172, 254, 0.85),
            0 0 44px 16px rgba(52, 152, 219, 0.4);
        filter: brightness(1.5);
    }

    100% {
        box-shadow: 0 0 14px 4px rgba(79, 172, 254, 0.3),
            0 0 28px 8px rgba(79, 172, 254, 0.1);
        filter: brightness(1);
    }
}

/* Шиммер-проход по коннектору */
@keyframes waveConnectorSweep {
    0% {
        left: -30%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Бегущий свет внутри коннектора */
.stepper-connector .wave-light {
    position: absolute;
    top: -3px;
    width: 30%;
    height: 8px;
    border-radius: 4px;
    background: radial-gradient(ellipse, rgba(79, 172, 254, 0.9) 0%, rgba(46, 204, 113, 0.6) 40%, transparent 70%);
    box-shadow: 0 0 12px 4px rgba(79, 172, 254, 0.6),
        0 0 24px 8px rgba(46, 204, 113, 0.3);
    animation: waveConnectorSweep 0.35s ease-in-out both;
    pointer-events: none;
    z-index: 10;
}

/* Постоянная яркая пульсация на активной монетке после волны */
@keyframes activeGlowPulse {

    0%,
    100% {
        box-shadow: 0 0 12px 4px rgba(79, 172, 254, 0.5),
            0 0 24px 8px rgba(79, 172, 254, 0.2);
    }

    50% {
        box-shadow: 0 0 22px 10px rgba(79, 172, 254, 0.8),
            0 0 44px 16px rgba(79, 172, 254, 0.35);
    }
}

.stepper-coin.wave-pulse-persist {
    border-radius: 50%;
    animation: activeGlowPulse 2s ease-in-out infinite;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.home-content {
    background: var(--bg-content);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    min-height: calc(100vh - 140px);
    padding: 20px 16px 40px;
    animation: contentSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contentSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    margin-bottom: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.see-all {
    font-size: 18px;
    color: var(--text-gray);
    cursor: pointer;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 16px 0;
}

/* ========================================
   URGENT CARDS - Горизонтальная карусель
   ======================================== */

.urgent-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

/* Скрываем скроллбар но оставляем прокрутку */
.urgent-carousel::-webkit-scrollbar {
    display: none;
}

.urgent-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.urgent-card {
    flex-shrink: 0;
    width: 100px;
    height: 120px;
    padding: 12px 10px;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    scroll-snap-align: start;
    position: relative;
    animation: cardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.urgent-card:nth-child(1) {
    animation-delay: 0.05s;
}

.urgent-card:nth-child(2) {
    animation-delay: 0.1s;
}

.urgent-card:nth-child(3) {
    animation-delay: 0.15s;
}

.urgent-card:nth-child(4) {
    animation-delay: 0.2s;
}

.urgent-card:nth-child(5) {
    animation-delay: 0.25s;
}

.urgent-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(-2px) scale(1);
    }
}

.urgent-card:active {
    transform: translateY(0);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Бейдж с датой */
.urgent-card .date-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.urgent-card.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.urgent-card.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.urgent-card.success {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

.urgent-card.overdue {
    background: linear-gradient(135deg, #8e44ad, #6c3483);
    animation: overdue-pulse 2s infinite;
}

@keyframes overdue-pulse {

    0%,
    100% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 6px 20px rgba(142, 68, 173, 0.4);
    }
}

.urgent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.plus-btn {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #4facfe, #2980b9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    position: relative;
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.plus-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(var(--primary-rgb), 0.5);
    animation: plusRipple 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.plus-btn:active {
    transform: scale(0.9);
    box-shadow: 0 1px 4px rgba(41, 128, 185, 0.3);
}

@keyframes plusRipple {
    0% {
        inset: -4px;
        opacity: 0.6;
    }

    70% {
        inset: -12px;
        opacity: 0;
    }

    100% {
        inset: -12px;
        opacity: 0;
    }
}

.urgent-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
}

.urgent-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.urgent-text {
    font-size: 11px;
    font-weight: 600;
    color: white;
    line-height: 1.2;
    max-height: 40px;
    overflow: hidden;
    word-break: break-word;
}

.urgent-empty {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-gray);
    font-size: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    width: 100%;
}

.future-empty {
    display: none;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-gray);
    font-size: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    grid-column: 1 / -1;
    /* Занимает всю ширину грида */
}

/* ========================================
   TASKS & DELIVERIES
   ======================================== */

.tasks-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.task-card {
    padding: 10px 6px;
    background: white;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    animation: cardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.task-card:nth-child(1) {
    animation-delay: 0.08s;
}

.task-card:nth-child(2) {
    animation-delay: 0.14s;
}

.task-card:nth-child(3) {
    animation-delay: 0.2s;
}

.task-card:nth-child(4) {
    animation-delay: 0.26s;
}

.task-card:active {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.task-date {
    display: inline-block;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.task-name {
    font-size: 11px;
    color: var(--text-gray);
}

.deliveries-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.delivery-item {
    display: grid;
    grid-template-columns: 30px 1fr 60px auto 20px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.delivery-item:active {
    background: #f8f9fa;
}

.delivery-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-date {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.delivery-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
}

.delivery-status.confirmed {
    background: #e8f5e9;
    color: #2e7d32;
}

.delivery-status.pending {
    background: #fff8e1;
    color: #f57f17;
}

.delivery-status.delayed {
    background: #ffebee;
    color: #c62828;
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.action-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 4px;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12), 0 6px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.action-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.action-btn:nth-child(2) {
    animation-delay: 0.15s;
}

.action-btn:nth-child(3) {
    animation-delay: 0.2s;
}

.action-btn:nth-child(4) {
    animation-delay: 0.25s;
}

.action-btn:nth-child(5) {
    animation-delay: 0.3s;
}

.action-btn:nth-child(6) {
    animation-delay: 0.35s;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.action-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.action-btn.yellow {
    background: linear-gradient(135deg, #f9d423, #f4c542, #e6a700);
}

.action-btn.blue {
    background: linear-gradient(135deg, #4facfe, #3b82c4, #2d6da3);
}

.action-btn.green {
    background: linear-gradient(135deg, #43e97b, #2ecc71, #1fa855);
}

.action-btn.red {
    background: linear-gradient(135deg, #f5515f, #e74c3c, #c0392b);
}

.action-btn.orange {
    background: linear-gradient(135deg, #FF9800, #F57C00, #E65100);
}

.action-icon {
    width: 28px;
    height: 28px;
    fill: white;
    margin-bottom: 6px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.action-text {
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   EVENT FEED
   ======================================== */

.events-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.event-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    cursor: pointer;
}

.event-item:active {
    background: #f8f9fa;
}

.event-item:last-child {
    border-bottom: none;
}

.event-text {
    font-size: 14px;
    line-height: 1.4;
}

/* ========================================
   MODAL CORE
   ======================================== */

.modal,
.tasks-modal-overlay,
.task-detail-overlay,
.notif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    padding: 24px;
}

.modal.show,
.tasks-modal-overlay.show,
.task-detail-overlay.show,
.notif-overlay.show {
    display: flex !important;
}

.modal-content,
.tasks-modal,
.task-detail-modal {
    background: #ffffff !important;
    width: 100% !important;
    max-width: 440px !important;
    border-radius: 28px !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header,
.tasks-modal-header,
.task-detail-header,
.notif-header {
    background: var(--header-bg);
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-body,
.tasks-modal-content,
.task-detail-body,
.notif-list {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.close,
.tasks-modal-close,
.task-detail-close,
.notif-close {
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    padding: 4px 8px;
    background: none;
    border: none;
    transition: opacity 0.2s, transform 0.2s;
}

.close:hover,
.tasks-modal-close:hover,
.task-detail-close:hover,
.notif-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ========================================
   TASKS LIST IN MODAL - Список задач
   ======================================== */

.task-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.task-list-item:hover {
    background: #edf2f7;
}

.task-list-item:active {
    transform: scale(0.98);
}

.task-list-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.task-list-info {
    flex: 1;
    min-width: 0;
}

.task-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-list-date {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 10px;
    color: white;
    flex-shrink: 0;
}

.task-list-date.priority-high {
    background: var(--danger);
}

.task-list-date.priority-medium {
    background: var(--warning);
}

.task-list-date.priority-low {
    background: var(--success);
}

.tasks-modal-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 15px;
}

/* ========================================
   CONSTRUCTOR MODAL - Personal Trigger
   ======================================== */

/* Информация об объекте в конструкторе */
.pt-object-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e8f4fd, #f0f7ff);
    border-radius: 14px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.pt-object-label {
    font-size: 13px;
    color: var(--text-gray);
}

.pt-object-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Группы форм */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
}

/* Поля ввода */
.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 15px;
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

/* Стиль ошибки поля */
.field-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2) !important;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Стили для радио-кнопок */
.form-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Радио-группа для режима однократно */
.radio-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e8f4fd, #f0f7ff);
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-option span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Секции форм */
.form-section {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 12px 0;
    color: #475569;
}

/* Компактный grid для иконки + приоритет + дедлайн */
.compact-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.compact-row .form-group {
    margin-bottom: 0;
}

/* Двойной grid */
.dual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.dual-row .form-group {
    margin-bottom: 0;
}

/* Динамическая сетка для смещений */
.offset-row {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 10px;
    margin-bottom: 12px;
    align-items: end;
}

.offset-row:last-child {
    margin-bottom: 0;
}

.offset-row .form-group {
    margin-bottom: 0;
}

.offset-row label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.offset-row input,
.offset-row select {
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 14px;
    width: 100%;
}

.offset-row input[type="number"] {
    text-align: center;
}

/* Стили для select с иконкой */
.form-section select,
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23718096'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Подсказки в форме */
.hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
    line-height: 1.4;
}

/* Сетка дней недели */
.weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.weekday-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.weekday-checkbox:hover {
    border-color: var(--primary);
}

.weekday-checkbox:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.weekday-checkbox input {
    display: none;
}

/* Секции настроек триггера */
.trigger-settings {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Футер модального окна */
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 28px 28px;
}

.modal-footer .btn-cancel {
    flex: 1;
    padding: 14px 16px;
    border-radius: 12px;
    background: #e2e8f0;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-footer .btn-cancel:hover {
    background: #cbd5e1;
}

.modal-footer .btn-save {
    flex: 2;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.modal-footer .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.modal-footer .btn-save:active {
    transform: translateY(0);
}

/* ========================================
   TASK DETAIL MODAL - Полная заливка кнопок
   ======================================== */

.task-detail-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}

.task-detail-icon {
    font-size: 28px;
    margin-right: 14px;
}

.task-detail-description {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 18px;
    line-height: 1.6;
}

.task-detail-object,
.task-detail-date {
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Sticky footer для кнопок действий */
.task-detail-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    background: #ffffff;
    border-radius: 0 0 28px 28px;
}

.task-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.task-detail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 8px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 8px 15px rgba(0, 0, 0, 0.1);
}

.task-detail-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.1);
}

.task-detail-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.task-detail-btn span {
    font-size: 12px;
    font-weight: 700;
    color: white;
}

/* Полная заливка */
.task-detail-btn.btn-reschedule {
    background: var(--primary);
}

.task-detail-btn.btn-complete {
    background: var(--success);
}

.task-detail-btn.btn-delete {
    background: var(--danger);
}

.task-detail-date-input {
    margin-top: 14px;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 1.5px solid #ddd;
}

/* ========================================
   BOLD TOOLBAR
   ======================================== */

.bold-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.bold-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    cursor: pointer;
    font-size: 16px;
    color: #333;
    transition: all 0.15s ease;
}

.bold-btn:hover {
    background: rgba(52, 152, 219, 0.12);
    border-color: rgba(52, 152, 219, 0.4);
    color: #2980b9;
}

.bold-btn:active {
    transform: scale(0.92);
}

.bold-hint {
    font-size: 12px;
    color: #999;
}

/* ========================================
   NOTIFICATIONS PANEL
   ======================================== */

.notifications-panel {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 340px;
    max-width: 90vw;
    max-height: 80vh;
    background: white;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: notifSlideIn 0.2s ease;
}

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-panel.show {
    display: flex !important;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s, opacity 0.3s, transform 0.3s;
    position: relative;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #f8fbff;
}

.notif-item.notif-read {
    opacity: 0.55;
}

.notif-item-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
    line-height: 1;
    padding-top: 2px;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    color: var(--text-dark);
    line-height: 1.3;
}

.notif-item-message {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 2px;
    line-height: 1.3;
}

.notif-item-time {
    font-size: 11px;
    color: #aab;
    margin-top: 2px;
}

.notif-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    padding-top: 2px;
}

.notif-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #eef2f6;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.notif-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.notif-delete-btn:hover {
    background: var(--danger);
    color: white;
}

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 14px;
}

/* Стили для контейнера триггера в деталях задачи */
.task-detail-trigger-container {
    display: none;
    margin: 12px 0;
    padding: 12px;
    background: #f1f4f8;
    border-radius: 12px;
    font-size: 13px;
    color: #4a5568;
    border-left: 4px solid var(--primary);
    word-break: break-word;
    line-height: 1.4;
}

.task-detail-trigger-container.show {
    display: block !important;
}

.notif-footer {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 0 0 15px 15px;
}

.notif-read-all {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--success), #27ae60);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.notif-read-all:hover {
    opacity: 0.9;
}

/* ========================================
   CONFIRM DIALOG - Диалог подтверждения
   ======================================== */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20000;
    backdrop-filter: blur(5px);
}

.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    z-index: 20001;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.confirm-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

.confirm-btn:active {
    transform: scale(0.96);
}

.confirm-btn-cancel {
    background: #f1f1f1;
    color: var(--text-dark);
}

.confirm-btn-delete {
    background: var(--danger);
    color: white;
}

/* ========================================
   ALL TASKS MODAL - Модальное окно всех задач
   ======================================== */

.tasks-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.tasks-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tasks-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    z-index: 1001;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tasks-modal-overlay.show .tasks-modal {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.tasks-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--header-bg);
    flex-shrink: 0;
}

.tasks-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.tasks-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Обёртка для body модалки — позиционирование fade */
.tasks-modal-body {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tasks-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 32px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tasks-modal-content::-webkit-scrollbar {
    display: none;
}

/* Градиент затухания снизу модалки */
.tasks-modal-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Бейдж «+N ещё» под модалкой */
.tasks-modal-more {
    text-align: center;
    padding: 8px 0 12px;
    flex-shrink: 0;
}

.tasks-modal-more-text {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.tasks-modal-more-text:hover {
    opacity: 1;
}

.task-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.task-list-item:active {
    background: #e9ecef;
    transform: scale(0.98);
}

.task-list-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.task-list-info {
    flex: 1;
    min-width: 0;
}

.task-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-list-date {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    color: white;
    flex-shrink: 0;
}

.task-list-date.priority-high {
    background: var(--danger);
}

.task-list-date.priority-medium {
    background: var(--warning);
}

.task-list-date.priority-low {
    background: var(--success);
}

.tasks-modal-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 16px;
}

/* ========================================
   NO ASSIGNMENTS CARD
   ======================================== */

.no-assignments-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    margin: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.no-assignments-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.no-assignments-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.no-assignments-text {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.no-assignments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.no-assignments-list li {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.no-assignments-list li:last-child {
    border-bottom: none;
}

.no-assignments-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.no-assignments-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   БЛИЖАЙШИЕ ПОСТАВКИ - 3D КАРТОЧКИ
   ======================================== */

.deliveries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-empty {
    text-align: center;
    color: var(--text-gray);
    font-size: 14px;
    padding: 20px;
    font-style: italic;
}

.delivery-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.delivery-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.delivery-card:active {
    transform: translateY(0) scale(0.99);
}

/* Цветовые индикаторы слева */
.delivery-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--text-gray);
    border-radius: 4px 0 0 4px;
}

.delivery-card.urgent::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.delivery-card.soon::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.delivery-card.normal::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* Иконка даты */
.delivery-date-badge {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.delivery-date-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.delivery-date-month {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-top: 2px;
}

/* Контент */
.delivery-content {
    flex: 1;
    min-width: 0;
}

.delivery-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.delivery-block {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 4px;
}

.delivery-block-icon {
    font-size: 11px;
}

/* Индикатор дней */
.delivery-days {
    flex-shrink: 0;
    text-align: right;
}

.delivery-days-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-gray);
}

.delivery-days-label {
    font-size: 10px;
    color: var(--text-gray);
    text-transform: uppercase;
}

.delivery-card.urgent .delivery-days-value {
    color: #ef4444;
}

.delivery-card.soon .delivery-days-value {
    color: #f59e0b;
}

.delivery-card.normal .delivery-days-value {
    color: #22c55e;
}

/* Стрелка */
.delivery-arrow {
    flex-shrink: 0;
    color: var(--text-gray);
    opacity: 0.5;
    font-size: 18px;
}

/* Модалка деталей поставки */
.delivery-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
}

.delivery-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.delivery-modal-sheet {
    background: var(--bg-content);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    padding: 0 16px 24px;
    animation: slideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.delivery-modal-handle {
    width: 40px;
    height: 5px;
    background: var(--text-gray);
    border-radius: 3px;
    margin: 12px auto 8px;
    opacity: 0.5;
    cursor: grab;
}

.delivery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 16px;
}

.delivery-modal-status {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.delivery-modal-status.urgent {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.delivery-modal-status.soon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.delivery-modal-status.normal {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.delivery-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    font-size: 14px;
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delivery-modal-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.delivery-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.4;
}

.delivery-modal-section {
    margin-bottom: 16px;
}

.delivery-modal-section-title {
    font-size: 11px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.delivery-modal-dates {
    display: flex;
    gap: 10px;
}

.delivery-modal-date-box {
    flex: 1;
    background: var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.delivery-modal-date-label {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.delivery-modal-date-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.delivery-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.delivery-modal-item {
    background: var(--border);
    border-radius: 12px;
    padding: 12px;
}

.delivery-modal-item.full-width {
    grid-column: 1 / -1;
}

.delivery-modal-item-label {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.delivery-modal-item-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.delivery-modal-comment {
    background: var(--border);
    border-radius: 12px;
    padding: 14px;
}

.delivery-modal-comment-title {
    font-size: 11px;
    color: var(--text-gray);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-modal-comment-text {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ========================================
   ЛЕНТА СОБЫТИЙ
   ======================================== */

.events-feed-wrapper {
    position: relative;
}

.events-feed {
    max-height: 232px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.events-feed::-webkit-scrollbar {
    display: none;
}

/* Градиент затухания снизу */
.events-feed-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--bg-main));
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: 0 0 8px 8px;
    z-index: 1;
}

/* Badge «+N ещё» */
.events-feed-more {
    text-align: center;
    padding: 6px 0 2px;
}

.events-more-text {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.events-more-text:hover {
    opacity: 1;
}

.events-empty {
    text-align: center;
    color: var(--text-gray);
    font-size: 14px;
    padding: 20px;
    font-style: italic;
}

.event-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 4px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.event-card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 6px 16px rgba(0, 0, 0, 0.08);
}

.event-card:active {
    transform: scale(0.99);
}

.event-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.event-card-icon.date-change {
    background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.event-card-icon.new-item {
    background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.event-card-icon.removed {
    background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.event-card-content {
    flex: 1;
    min-width: 0;
}

.event-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card-desc {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card-time {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--text-gray);
    text-align: right;
}

.event-card-arrow {
    flex-shrink: 0;
    color: var(--text-gray);
    opacity: 0.5;
    font-size: 16px;
}

/* Модалка события */
.event-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
}

.event-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.event-modal-sheet {
    background: var(--bg-content);
    width: 100%;
    max-width: 640px;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
    padding: 0 16px 24px;
    animation: slideUp 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.event-modal-handle {
    width: 36px;
    height: 4px;
    background: var(--text-gray);
    border-radius: 2px;
    margin: 12px auto;
    opacity: 0.3;
}

.event-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 16px;
}

.event-modal-type {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.event-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    font-size: 14px;
    color: var(--text-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-modal-content {
    flex: 1;
    overflow-y: auto;
}

.event-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.event-modal-time {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

.event-modal-changes {
    background: var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.event-change-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-change-label {
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-change-values {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
}

.event-old-value {
    color: #ef4444;
    text-decoration: line-through;
}

.event-arrow {
    color: var(--text-gray);
}

.event-new-value {
    color: #22c55e;
}

.event-modal-equipment {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--border);
    border-radius: 12px;
    padding: 12px 14px;
}

.event-equipment-icon {
    font-size: 20px;
}

.event-equipment-name {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.event-modal-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.event-archive-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.event-archive-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.event-archive-btn:active {
    transform: scale(0.98);
}

/* ========================================
   EMPTY STATE PLACEHOLDERS
   Красивые заглушки для пустых состояний
   ======================================== */

.delivery-empty,
.events-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
    min-height: 120px;
}

.delivery-empty::before {
    content: '📦';
    font-size: 36px;
    margin-bottom: 12px;
    filter: grayscale(0.3);
}

.events-empty::before {
    content: '📭';
    font-size: 36px;
    margin-bottom: 12px;
    filter: grayscale(0.3);
}

.delivery-empty,
.events-empty {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    line-height: 1.5;
}

/* Подсказка для выбора объекта */
.delivery-empty[data-hint]::after,
.events-empty[data-hint]::after {
    content: attr(data-hint);
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #adb5bd;
    font-weight: 400;
}

/* Анимация появления */
@keyframes emptyStateFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delivery-empty,
.events-empty {
    animation: emptyStateFadeIn 0.3s ease;
}

/* Стили для urgent-empty и future-empty */
.urgent-empty,
.future-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    background: linear-gradient(145deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
    font-size: 14px;
    color: #155724;
    font-weight: 500;
    min-height: 80px;
    border: 1px solid #c3e6cb;
}

.urgent-empty::before {
    content: '✨';
    margin-right: 8px;
    font-size: 20px;
}

.future-empty::before {
    content: '📅';
    margin-right: 8px;
    font-size: 20px;
}

/* ========================================
   SCHEDULE MENU — Bottom Sheet выбора
   ======================================== */

.schedule-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    transition: background 0.3s;
}

.schedule-menu-overlay.show {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.schedule-menu-sheet {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 16px 20px 28px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.schedule-menu-overlay.show .schedule-menu-sheet {
    transform: translateY(0);
}

.schedule-menu-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.schedule-menu-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    text-align: center;
}

.schedule-menu-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-menu-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-align: left;
    width: 100%;
}

.schedule-menu-option:active {
    transform: scale(0.98);
    background: #eef2f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.schedule-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.schedule-menu-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.schedule-menu-icon.blue-bg {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.schedule-menu-icon.green-bg {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.schedule-menu-text {
    flex: 1;
}

.schedule-menu-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.schedule-menu-desc {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 2px;
}

.schedule-menu-arrow {
    font-size: 24px;
    color: #ccc;
    font-weight: 300;
}