body{
    margin:0;
    font-family: Arial, sans-serif;
    background:#f5f7fb;
    padding-top: calc(env(safe-area-inset-top, 0px) + 55px);
}

.header{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg,#0088cc,#00aaff);
    color: white;
    text-align: center;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
    padding-bottom: 8px;
    z-index: 9999;
}

.screen{
    display:none;
    padding:15px;
    padding-bottom:90px;
}

.active{
    display:block;
}

.card{
    background:white;
    padding:18px;
    border-radius:18px;
    margin-bottom:12px;
    box-shadow:0 4px 15px rgba(0,0,0,0.06);
    box-sizing:border-box;
    overflow-wrap:anywhere;
    word-break:break-word;
}

input, select{
    width:100%;
    padding:14px;
    margin:8px 0;
    border-radius:14px;
    border:1px solid #e0e0e0;
    box-sizing:border-box;
    font-size:14px;
    background:#f9fbff;
    transition:0.2s;
}

input:focus, select:focus{
    outline:none;
    border:1px solid #0088cc;
    background:white;
    box-shadow:0 0 0 3px rgba(0,136,204,0.1);
}

.button{
    margin-top:14px;
    padding:14px;
    background: linear-gradient(135deg,#0088cc,#00c3ff);
    color:white;
    border-radius:16px;
    text-align:center;
    cursor:pointer;
    font-weight:bold;
    transition:0.2s;
}

.button:active{
    transform:scale(0.97);
}

.navbar{
    position:fixed;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left:50%;
    transform:translateX(-50%);
    width:92%;
    background:rgba(255,255,255,0.95);
    display:flex;
    justify-content:space-between;
    padding:10px 6px;
    border-radius:22px;
    box-shadow:0 6px 25px rgba(0,0,0,0.12);
    backdrop-filter: blur(10px);
    z-index:1000;
}

.nav-item{
    font-size:13px;
    text-align:center;
    cursor:pointer;
    padding:8px 12px;
    border-radius:16px;
    transition:0.25s;
    color:#666;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    flex:1;
    min-width:0;
    box-sizing:border-box;
}

.nav-item.active{
    background:linear-gradient(135deg,#0088cc,#00c3ff);
    color:white;
    box-shadow:0 4px 12px rgba(0,136,204,0.3);
}

.nav-chat-item{
    position:relative;
}

.nav-chat-circle{
    width:42px;
    height:42px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(180deg,#0088cc 0%, #00c3ff 100%);
    border:1px solid #ffffff;
    box-shadow:0 6px 16px rgba(15,23,42,0.08);
    font-size:18px;
    transition:all .22s ease;
}

.nav-chat-badge{
    top:-2px;
    right:8px;
}

.chat-counter-badge{
    position:absolute;
    top:-4px;
    right:-2px;
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#ff5a5f;
    color:#fff;
    font-size:10px;
    font-weight:700;
    line-height:1;
    box-shadow:0 4px 10px rgba(0,0,0,0.12);
}

.nav-order-badge{
    position:absolute;
    top:-4px;
    right:-6px;
    background:#ff3b3b;
    color:white;
    min-width:18px;
    height:18px;
    border-radius:50%;
    font-size:11px;
    font-weight:bold;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 4px;
    box-shadow:0 3px 10px rgba(255,0,0,0.4);
    animation:orderBadgePulse 1.4s infinite;
}

@keyframes orderBadgePulse{
    0%{transform:scale(1);}
    50%{transform:scale(1.15);}
    100%{transform:scale(1);}
}

.filter-btn{
    padding:5px 10px;
    border:none;
    border-radius:9px;
    font-size:11px;
    font-weight:600;
    cursor:pointer;
    background:#f1f1f1;
    line-height:1.2;
}

.filter-btn.active{
    background:linear-gradient(135deg,#3b82f6,#8b5cf6);
    color:white;
}

.pending-shift-card{
    background:linear-gradient(180deg,#f3f4f6,#e5e7eb);
    border:1px solid #d1d5db;
    position:relative;
    overflow:hidden;
}

.pending-shift-badge{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    background:#d1d5db;
    color:#4b5563;
    font-size:12px;
    font-weight:700;
    margin-bottom:10px;
}

/* ===== PROFILE NEW DESIGN ===== */
.profile-container{
    padding:20px;
    background:#ffffff;
    min-height:100vh;
    color:rgb(0, 0, 0);
}

.profile-top{
    display:flex;
    align-items:center;
    gap:20px;
    margin-bottom:30px;
}

.profile-avatar{
    width:90px;
    height:90px;
    border-radius:50%;
    background:linear-gradient(135deg,#3b82f6,#8b5cf6);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:40px;
    box-shadow:0 10px 30px rgba(59,130,246,0.4);
    cursor:pointer;
    position:relative;
    transition:0.25s;
}

.profile-avatar:hover{
    transform:scale(1.04);
}

.profile-avatar::after{
    content:"✏️";
    position:absolute;
    right:-2px;
    bottom:-2px;
    width:28px;
    height:28px;
    border-radius:50%;
    background:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    box-shadow:0 4px 12px rgba(0,0,0,0.12);
}

.avatar-grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:10px;
    margin-top:8px;
}

.avatar-option{
    height:58px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:28px;
    background:#f6f8ff;
    cursor:pointer;
    border:1px solid #e5e7eb;
    transition:0.2s;
}

.avatar-option:hover{
    background:#eef4ff;
    border-color:#3b82f6;
}

.profile-info{
    flex:1;
}

.profile-name{
    font-size:20px;
    font-weight:bold;
    margin-bottom:6px;
}

.profile-city{
    font-size:14px;
    color:#000000;
    margin-bottom:10px;
}

.profile-rating{
    font-size:18px;
}

.profile-balance-card{
    background:linear-gradient(135deg,#3b82f6,#8b5cf6);
    padding:20px;
    border-radius:22px;
    margin-bottom:25px;
    box-shadow:0 10px 30px rgba(59,130,246,0.3);
}

.balance-title{
    font-size:14px;
    opacity:0.8;
}

.balance-amount{
    font-size:28px;
    font-weight:bold;
    margin:10px 0 15px;
}

.balance-buttons{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:15px;
    gap:10px;
}

.balance-button{
    background:rgb(255, 255, 255);
    color:#000000;
    padding:10px;
    border-radius:14px;
    text-align:center;
    font-weight:600;
    cursor:pointer;
    flex:1;
}

.balance-card-button{
    background:rgba(255,255,255,0.15);
    color:#fff;
    padding:8px 14px;
    border-radius:14px;
    font-weight:600;
    cursor:pointer;
    transition:0.25s;
    flex:1;
    text-align:center;
}

.card-popup{
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    background:rgba(35,35,40,0.9);
    backdrop-filter:blur(10px);
    padding:20px;
    border-radius:18px;
    box-shadow:0 12px 28px rgba(0,0,0,0.5);
    z-index:999;
    width:90%;
    max-width:320px;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.card-popup-close{
    position:absolute;
    top:10px;
    right:12px;
    font-size:18px;
    color:#fff;
    cursor:pointer;
    z-index:10;
    transition:0.2s;
}

.profile-phone-card{
    display:flex;
    align-items:center;
    gap:14px;
    background:linear-gradient(135deg,#f6f8ff,#eef2ff);
    padding:16px;
    border-radius:18px;
    margin-bottom:15px;
    box-shadow:0 6px 18px rgba(0,0,0,0.06);
}

.phone-icon{
    width:44px;
    height:44px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    background:linear-gradient(135deg,#3b82f6,#8b5cf6);
    color:white;
}

.phone-info{
    display:flex;
    flex-direction:column;
}

.phone-title{
    font-size:12px;
    color:#777;
}

.phone-number{
    font-size:17px;
    font-weight:700;
    letter-spacing:0.5px;
}

.profile-actions{
    background:#ffffff;
    padding:18px;
    border-radius:18px;
    margin-top:12px;
    display:flex;
    flex-direction:column;
    gap:14px;
}

.profile-action-btn{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:18px 24px;
    border-radius:16px;
    background:rgba(0,0,0,0.05);
    font-size:16px;
    font-weight:600;
    cursor:pointer;
    transition:0.25s;
}

.profile-action-btn:hover{
    background:rgba(0,0,0,0.08);
    transform:translateY(-2px);
}

/* ===== HOME QUICK ACTIONS ===== */
#home{
    padding:10px 10px 100px;
    background:transparent;
}

.home-top-section{
    margin-bottom:14px;
}

.home-quick-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    align-items:stretch;
}

.home-quick-card{
    position:relative;
    min-height:92px;
    padding:14px;
    border-radius:20px;
    background:linear-gradient(180deg,#ffffff,#f8fbff);
    box-shadow:0 6px 18px rgba(15,23,42,0.07);
    border:1px solid #e7eef8;
    cursor:pointer;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    transition:transform .2s ease, box-shadow .2s ease;
}

.home-quick-card:active{
    transform:scale(0.98);
}

.home-quick-content{
    flex:1;
    min-width:0;
}

.home-quick-title{
    font-size:17px;
    font-weight:800;
    line-height:1.12;
    color:#111827;
}

.home-quick-subtitle{
    font-size:12px;
    line-height:1.35;
    color:#6b7280;
    margin-top:6px;
}

.home-quick-icon{
    width:52px;
    height:52px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    background:linear-gradient(135deg,#eef6ff,#dbeafe);
    color:#2563eb;
}

.home-quick-icon svg{
    width:26px;
    height:26px;
    stroke:currentColor;
}

.home-section-card{
    background:linear-gradient(180deg,#ffffff,#f8fbff);
    border:1px solid #e7eef8;
    border-radius:20px;
    padding:14px;
    box-shadow:0 8px 24px rgba(15,23,42,0.06);
}

.home-section-title{
    margin:0 0 12px;
    font-size:18px;
    font-weight:700;
    color:#111827;
}

/* ===== IMPORTANT INFO SCREEN ===== */
.info-screen-header{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:14px;
}

.info-back-btn{
    width:42px;
    height:42px;
    border-radius:14px;
    border:none;
    background:#ffffff;
    box-shadow:0 6px 16px rgba(15,23,42,0.08);
    font-size:20px;
    cursor:pointer;
    flex-shrink:0;
}

.info-screen-title{
    font-size:22px;
    font-weight:800;
    color:#111827;
    line-height:1.1;
}

.info-screen-subtitle{
    font-size:13px;
    color:#6b7280;
    margin-top:4px;
    line-height:1.4;
}

.info-accordion-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.info-accordion{
    background:linear-gradient(180deg,#ffffff,#f8fbff);
    border:1px solid #e7eef8;
    border-radius:18px;
    box-shadow:0 8px 22px rgba(15,23,42,0.05);
    overflow:hidden;
}

.info-accordion-btn{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:16px;
    border:none;
    background:transparent;
    text-align:left;
    cursor:pointer;
}

.info-accordion-left{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.info-accordion-icon{
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#eef6ff,#dbeafe);
    color:#2563eb;
    flex-shrink:0;
}

.info-accordion-icon svg{
    width:22px;
    height:22px;
    stroke:currentColor;
}

.info-accordion-title{
    font-size:17px;
    font-weight:700;
    color:#111827;
    line-height:1.2;
}

.info-accordion-text{
    font-size:12px;
    color:#6b7280;
    margin-top:3px;
    line-height:1.35;
}

.info-accordion-arrow{
    font-size:22px;
    color:#6b7280;
    transition:transform .2s ease;
    flex-shrink:0;
}

.info-accordion.active .info-accordion-arrow{
    transform:rotate(180deg);
}

.info-accordion-content{
    max-height:0;
    overflow:hidden;
    transition:max-height .28s ease, padding .28s ease;
    padding:0 16px;
}

.info-accordion.active .info-accordion-content{
    max-height:520px;
    padding:0 16px 16px;
}

.info-content-card{
    background:#ffffff;
    border:1px solid #eef2f7;
    border-radius:16px;
    padding:14px;
}

/* ===== ADS ===== */
.ads-container{
    margin:20px 0;
}

.ads-scroll{
    display:flex;
    overflow-x:auto;
    gap:12px;
    padding-bottom:10px;
    scroll-behavior:smooth;
    align-items:stretch;
}

.ads-scroll::-webkit-scrollbar{
    height:6px;
}

.ad-card{
    min-width:240px;
    max-width:240px;
    border:1px solid #e6eef8;
    border-radius:16px;
    padding:10px;
    background:linear-gradient(180deg,#ffffff,#f8fbff);
    flex-shrink:0;
    box-shadow:0 8px 20px rgba(0,0,0,0.08);
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    min-height:360px;
}

.ad-card img{
    width:100%;
    height:120px;
    object-fit:cover;
    border-radius:12px;
    margin-bottom:6px;
    display:block;
    background:#eef2f7;
}

.ad-info{
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
}

.ad-info strong{
    display:block;
    font-size:15px;
    margin-bottom:4px;
    color:#1f2937;
    line-height:1.25;
}

.ad-call-btn{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    background:linear-gradient(135deg,#22c55e,#16a34a);
    color:white;
    border:none;
    border-radius:12px;
    padding:10px 12px;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    text-align:center;
}

/* ===== TOAST ===== */
.app-toast{
    position:fixed;
    bottom:120px;
    left:50%;
    transform:translateX(-50%) scale(0.9);
    background:linear-gradient(135deg,#ff4d4d,#ff6b6b);
    color:white;
    padding:14px 22px;
    border-radius:18px;
    font-size:14px;
    font-weight:600;
    box-shadow:0 10px 30px rgba(0,0,0,0.25);
    opacity:0;
    pointer-events:none;
    transition:all .35s ease;
    z-index:5000;
}

.app-toast.show{
    opacity:1;
    transform:translateX(-50%) scale(1);
}

.app-toast.success{
    background:linear-gradient(135deg,#22c55e,#16a34a);
}

/* ===== LOGO ===== */
#logoBlock{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}

.logo-title{
    font-size:16px;
    font-weight:700;
    letter-spacing:0.4px;
    line-height:1.1;
}

.logo-subtitle{
    font-size:10px;
    opacity:0.9;
    margin-top:2px;
    line-height:1.1;
}

#headerCity{
    margin-top:2px;
    font-size:12px;
    opacity:0.95;
    line-height:1.1;
}

/* ===== TETRIS GAME ===== */
#gameModal{
    display:none;
    position:fixed;
    inset:0;
    width:100%;
    height:100dvh;
    background:rgba(0,0,0,0.62);
    z-index:9999;
    padding:10px;
    box-sizing:border-box;
    justify-content:center;
    align-items:center;
    overflow:hidden;
}

.game-modal-card{
    width:min(100%, 460px);
    height:min(100dvh - 16px, 800px);
    overflow:hidden;
    margin:auto;
    box-sizing:border-box;
    background:linear-gradient(180deg,#ffffff,#f8fbff);
    border-radius:22px;
    padding:14px;
    box-shadow:0 20px 50px rgba(0,0,0,0.25);
    position:relative;
    display:flex;
    flex-direction:column;
}

.game-modal-close{
    position:absolute;
    top:10px;
    right:12px;
    font-size:20px;
    cursor:pointer;
    color:#64748b;
    z-index:5;
}

.tetris-topbar{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:8px;
    margin-bottom:10px;
    padding-right:28px;
}

.game-stat{
    background:#f1f5f9;
    border-radius:12px;
    padding:8px 6px;
    text-align:center;
    font-size:12px;
    font-weight:700;
    color:#334155;
}

.tetris-layout{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 108px;
    gap:12px;
    align-items:start;
    flex:1;
    min-height:0;
}

.tetris-main{
    display:flex;
    flex-direction:column;
    align-items:center;
    min-width:0;
}

.tetris-board{
    width:100%;
    max-width:260px;
    display:grid;
    grid-template-columns:repeat(10, 1fr);
    gap:3px;
    padding:7px;
    border-radius:16px;
    background:linear-gradient(180deg,#0f172a,#1e293b);
    margin:0 auto;
}

.tetris-cell{
    aspect-ratio:1/1;
    border-radius:6px;
    background:rgba(255,255,255,0.06);
}

.tetris-pad{
    margin-top:12px;
    display:grid;
    grid-template-columns:repeat(3, 58px);
    grid-template-rows:repeat(2, 58px);
    gap:10px;
    justify-content:center;
}

.tetris-pad-btn{
    border:none;
    border-radius:14px;
    font-size:18px;
    font-weight:800;
    cursor:pointer;
    background:linear-gradient(180deg,#ffffff,#edf5ff);
    box-shadow:0 6px 14px rgba(15,23,42,0.08);
    color:#0f172a;
}

.tetris-pad-btn:active{
    transform:scale(0.96);
}

.tetris-pad-rotate{
    grid-column:2;
    grid-row:1;
}

.tetris-pad-left{
    grid-column:1;
    grid-row:2;
}

.tetris-pad-down{
    grid-column:2;
    grid-row:2;
}

.tetris-pad-right{
    grid-column:3;
    grid-row:2;
}

.tetris-next{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:3px;
}

.tetris-next-cell{
    aspect-ratio:1/1;
    border-radius:5px;
    background:#e2e8f0;
}

.tetris-message{
    border-radius:12px;
    padding:10px;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:12px;
    font-weight:600;
    line-height:1.35;
    min-height:48px;
}

.tetris-controls.secondary{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
}

.tetris-controls.secondary button{
    border:none;
    border-radius:12px;
    padding:11px 8px;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    background:linear-gradient(180deg,#ffffff,#edf5ff);
}

/* ===== SHIFT ACTION BUTTONS ===== */
#shiftActionButtons{
    position:fixed;
    right:20px;
    bottom:100px;
    display:flex;
    gap:12px;
    z-index:999;
}

/* ===== ЧАТ РАБОЧЕГО — ИСПРАВЛЕННЫЙ ===== */
#chatModal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100dvh;
    background:#e5ddd5;
    z-index:9999;
    flex-direction:column;
    overflow:hidden;
}

/* ПК-версия */
@media (min-width: 769px){
    #chatModal{
        top:50%;
        left:50%;
        width:90%;
        max-width:500px;
        height:85vh;
        transform:translate(-50%, -50%);
        border-radius:24px;
        box-shadow:0 25px 50px rgba(0,0,0,0.3);
    }
    #chatModal .chat-back-btn{
        display:none !important;
    }
}

/* Мобильная версия - кнопка назад */
@media (max-width: 768px){
    #chatModal .chat-back-btn{
        display:flex !important;
    }
}

#chatModal .chat-header-bar{
    background:#075E54;
    color:white;
    padding:12px 16px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-shrink:0;
}

#chatModal .chat-header-left{
    display:flex;
    align-items:center;
    gap:12px;
    flex:1;
    min-width:0;
}

#chatModal .chat-back-btn{
    width:32px;
    height:32px;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:rgba(255,255,255,0.15);
    cursor:pointer;
    font-size:18px;
    flex-shrink:0;
}

#chatModal .chat-header-title{
    font-size:16px;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

#chatModal .worker-chat-list-view{
    flex:1;
    overflow-y:auto;
    padding:12px;
    background:#fff;
}

#chatModal .worker-chat-list-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px;
    border-radius:16px;
    background:#fff;
    margin-bottom:8px;
    box-shadow:0 2px 8px rgba(0,0,0,0.04);
    cursor:pointer;
    border:1px solid #f0f2f5;
}

#chatModal .worker-chat-list-item.worker-chat-lead{
    background:linear-gradient(180deg,#ffffff,#f3f9ff);
    border:1px solid rgba(0,136,204,0.14);
}

#chatModal .worker-chat-avatar{
    width:52px;
    height:52px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    background:linear-gradient(135deg,#0088cc,#00c3ff);
    color:white;
    flex-shrink:0;
}

#chatModal .worker-chat-main{
    flex:1;
    min-width:0;
}

#chatModal .worker-chat-top-row{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap:8px;
    margin-bottom:4px;
}

#chatModal .worker-chat-name{
    font-size:15px;
    font-weight:700;
    color:#111827;
}

#chatModal .worker-chat-meta{
    font-size:11px;
    color:#6b7280;
    white-space:nowrap;
}

#chatModal .worker-chat-preview{
    font-size:13px;
    color:#6b7280;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

#chatModal .worker-chat-unread{
    min-width:22px;
    height:22px;
    padding:0 6px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#25D366;
    color:white;
    font-size:11px;
    font-weight:700;
}

#chatModal .chat-conversation-view{
    display:none;
    flex:1;
    flex-direction:column;
    min-height:0;
    background:#e5ddd5;
}

#chatModal .chat-body{
    flex:1;
    overflow-y:auto;
    padding:16px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

#chatModal .chat-message-row{
    display:flex;
    width:100%;
    animation:messageSlideIn 0.2s ease;
}

#chatModal .chat-message-row.chat-worker-row{
    justify-content:flex-end;
}

#chatModal .chat-message-row.chat-admin-row{
    justify-content:flex-start;
}

#chatModal .chat-bubble{
    max-width:75%;
    padding:10px 14px;
    border-radius:18px;
    font-size:14px;
    line-height:1.4;
    word-wrap:break-word;
}

#chatModal .chat-worker{
    background:#dcf8c6;
    border-bottom-right-radius:4px;
}

#chatModal .chat-admin{
    background:white;
    border-bottom-left-radius:4px;
    box-shadow:0 1px 2px rgba(0,0,0,0.05);
}

#chatModal .chat-text{
    white-space:pre-wrap;
    word-break:break-word;
}

#chatModal .chat-image{
    max-width:200px;
    max-height:200px;
    border-radius:12px;
    cursor:pointer;
    margin-top:6px;
}

#chatModal .chat-time{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:6px;
    font-size:10px;
    color:#667781;
    margin-top:6px;
}

#chatModal .chat-status-sent,
#chatModal .chat-status-delivered{
    color:#8696a0;
    font-size:11px;
}

#chatModal .chat-status-read{
    color:#34b7f1;
    font-size:11px;
}

#chatModal .chat-input-bar{
    display:flex;
    align-items:flex-end;
    gap:8px;
    padding:8px 12px calc(8px + env(safe-area-inset-bottom));
    background:#f0f2f5;
    border-top:1px solid #e9ecef;
    flex-shrink:0;
}

#chatModal .chat-input-shell{
    flex:1;
    display:flex;
    align-items:flex-end;
    gap:8px;
    background:white;
    border-radius:24px;
    padding:8px 12px;
    min-height:44px;
    position:relative;
}

#chatModal .chat-input{
    flex:1;
    border:none;
    outline:none;
    padding:6px 0;
    font-size:15px;
    resize:none;
    font-family:inherit;
    max-height:100px;
    background:transparent;
}

#chatModal .attach-btn{
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size:20px;
    color:#54656f;
}

#chatModal .emoji-btn{
    width:32px;
    height:32px;
    background:transparent;
    border:none;
    cursor:pointer;
    font-size:20px;
}

#chatModal .send-btn{
    width:44px;
    height:44px;
    border-radius:50%;
    border:none;
    cursor:pointer;
    background:#25D366;
    color:white;
    font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
}

#chatModal .file-input{
    display:none;
}

#chatModal .emoji-picker{
    position:absolute;
    bottom:60px;
    right:0;
    background:white;
    border-radius:20px;
    padding:12px;
    display:none;
    grid-template-columns:repeat(6,1fr);
    gap:8px;
    box-shadow:0 4px 20px rgba(0,0,0,0.15);
    z-index:100;
    width:220px;
}

#chatModal .emoji-picker.show{
    display:grid;
}

#chatModal .emoji-picker button{
    background:transparent;
    border:none;
    cursor:pointer;
    font-size:24px;
    padding:6px;
    border-radius:10px;
}

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

/* Мобильная адаптация чата */
@media (max-width:480px){
    #chatModal .chat-bubble{
        max-width:88%;
        font-size:13px;
    }
    #chatModal .chat-image{
        max-width:160px;
    }
    #chatModal .worker-chat-avatar{
        width:44px;
        height:44px;
        font-size:20px;
    }
    #chatModal .emoji-picker{
        width:200px;
        right:-40px;
    }
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
#rulesModal,
#phoneVerificationScreen,
#pinCodeScreen,
#newPinCodeScreen,
#resetPasswordModal,
#blockedScreen{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.7);
    z-index:10001;
    justify-content:center;
    align-items:center;
}

/* ===== АДАПТАЦИЯ ДЛЯ ПК ===== */
@media (min-width:768px){
    body{
        background:#eef2f7;
        padding-top:calc(env(safe-area-inset-top,0px) + 70px);
    }
    
    .screen, #home, #profile, #orders, #shifts, #importantInfo{
        max-width:500px;
        margin:0 auto;
    }
    
    .navbar{
        max-width:500px;
        left:50%;
        transform:translateX(-50%);
        width:92%;
        border-radius:28px;
    }
    
    .header{
        left:50%;
        transform:translateX(-50%);
        max-width:500px;
        border-radius:0 0 20px 20px;
    }
    
    #shiftActionButtons{
        right:auto;
        left:50%;
        transform:translateX(-50%);
        bottom:100px;
    }
    
    #shiftActionButtons > *:first-child{
        transform:translateX(0) !important;
    }
}

/* Фикс для кнопок */
#shiftActionButtons > *:first-child{
    transform:translateX(0);
}

.nav-item,
.nav-item:active,
.nav-chat-circle,
.nav-chat-circle:active{
    transform:none !important;
}

.repeat-order-worker-note{
    margin-top:10px;
    padding:12px 14px;
    border-radius:16px;
    background:linear-gradient(135deg,#ede9fe,#f5f3ff);
    border:1px solid #c4b5fd;
    color:#5b21b6;
    font-size:13px;
    line-height:1.45;
    font-weight:700;
}

/* ============================================
   ЧАТ РАБОЧЕГО — WHATSAPP СТИЛЬ (ФИКС ДЛЯ WEBVIEW)
   ============================================ */

/* Базовое модальное окно чата */
#chatModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: #e5ddd5;
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
}

/* ПК-версия (ширина > 768px) */
@media (min-width: 769px) {
    #chatModal {
        top: 50%;
        left: 50%;
        width: 90%;
        max-width: 500px;
        height: 85vh;
        transform: translate(-50%, -50%);
        border-radius: 24px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    }
}

/* Кнопка "Назад" - на мобильных показывается */
#chatModal .chat-back-btn {
    display: none;
}

@media (max-width: 768px) {
    #chatModal .chat-back-btn {
        display: flex !important;
    }
}

/* ШАПКА ЧАТА */
#chatModal .chat-header-bar {
    background: #075E54;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

#chatModal .chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

#chatModal .chat-back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
}

#chatModal .chat-header-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* СПИСОК ЧАТОВ */
#chatModal .worker-chat-list-view {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

#chatModal .worker-chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

#chatModal .worker-chat-list-item:hover {
    background: #f8f9fa;
}

#chatModal .worker-chat-avatar {
    width: 49px;
    height: 49px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #0088cc, #00c3ff);
    color: white;
    flex-shrink: 0;
}

#chatModal .worker-chat-main {
    flex: 1;
    min-width: 0;
}

#chatModal .worker-chat-top-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

#chatModal .worker-chat-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

#chatModal .worker-chat-meta {
    font-size: 11px;
    color: #8696a0;
    white-space: nowrap;
}

#chatModal .worker-chat-preview {
    font-size: 13px;
    color: #8696a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chatModal .worker-chat-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

/* ОБЛАСТЬ ПЕРЕПИСКИ */
#chatModal .chat-conversation-view {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    background: #efeae2;
}

#chatModal .chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* СООБЩЕНИЯ */
#chatModal .chat-message-row {
    display: flex;
    width: 100%;
}

#chatModal .chat-message-row.chat-worker-row {
    justify-content: flex-end;
}

#chatModal .chat-message-row.chat-admin-row {
    justify-content: flex-start;
}

#chatModal .chat-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

#chatModal .chat-worker {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

#chatModal .chat-admin {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

#chatModal .chat-text {
    white-space: pre-wrap;
    word-break: break-word;
}

#chatModal .chat-time {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10px;
    color: #8696a0;
    margin-top: 4px;
}

/* === СТРОКА ВВОДА — ФИКС ДЛЯ WEBVIEW === */
#chatModal .chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: #f0f2f5;
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#chatModal .chat-input-shell {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 24px;
    padding: 6px 12px;
    min-height: 44px;
    position: relative;
}

#chatModal .chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 16px;
    resize: none;
    font-family: inherit;
    background: transparent;
    max-height: 100px;
    line-height: 1.4;
}

#chatModal .chat-input::placeholder {
    color: #8696a0;
    font-size: 15px;
}

#chatModal .attach-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    color: #8696a0;
    flex-shrink: 0;
}

#chatModal .emoji-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #8696a0;
}

#chatModal .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #25D366;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.1s ease;
}

#chatModal .send-btn:active {
    transform: scale(0.95);
}

#chatModal .file-input {
    display: none;
}

/* ЭМОДЗИ ПАНЕЛЬ */
#chatModal .emoji-picker {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: white;
    border-radius: 20px;
    padding: 10px;
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    width: 240px;
}

#chatModal .emoji-picker.show {
    display: grid;
}

#chatModal .emoji-picker button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 6px;
    border-radius: 10px;
    transition: background 0.2s;
}

/* Мобильная адаптация для WebView */
@media (max-width: 768px) {
    #chatModal .chat-input-bar {
        padding: 8px 12px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    #chatModal .chat-input-shell {
        min-height: 40px;
        padding: 4px 12px;
    }
    
    #chatModal .chat-input {
        font-size: 16px;
        padding: 6px 0;
    }
    
    #chatModal .attach-btn,
    #chatModal .emoji-btn {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
    
    #chatModal .send-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 480px) {
    #chatModal .chat-bubble {
        max-width: 85%;
        font-size: 13px;
    }
    
    #chatModal .worker-chat-avatar {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    #chatModal .chat-input-shell {
        min-height: 38px;
        padding: 3px 10px;
    }
    
    #chatModal .attach-btn,
    #chatModal .emoji-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    #chatModal .send-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* Строка ввода - фикс для placeholder */
#chatModal .chat-input-shell {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 24px;
    padding: 8px 14px;
    min-height: 44px;
    position: relative;
}

#chatModal .chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 16px;
    resize: none;
    font-family: inherit;
    background: transparent;
    max-height: 100px;
    line-height: 1.4;
    width: 100%;
}

#chatModal .chat-input::placeholder {
    color: #a0aec0;
    font-size: 15px;
    font-weight: 400;
    opacity: 1;
    white-space: nowrap;
    overflow: visible;
}

/* Убираем возможные конфликты */
#chatModal .chat-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    #chatModal .chat-input-shell {
        padding: 6px 12px;
        min-height: 40px;
    }
    
    #chatModal .chat-input {
        font-size: 16px;
        padding: 6px 0;
    }
    
    #chatModal .chat-input::placeholder {
        font-size: 14px;
        white-space: normal;
        word-break: keep-all;
    }
}

/* Стили для поля даты рождения */
#regBirthday:focus {
    outline: none;
    border-color: #0088cc;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,136,204,0.1);
}

#regBirthday:focus + #birthdayLabel,
#regBirthday:valid + #birthdayLabel {
    opacity: 0;
    visibility: hidden;
}
/* ===== NEW ORDER TAG ===== */
.order-new-tag{
    display:inline-flex;
    align-items:center;
    gap:4px;
    background:linear-gradient(135deg,#4caf50,#66bb6a);
    color:#fff;
    border-radius:20px;
    padding:3px 12px;
    font-size:11px;
    font-weight:700;
    margin-left:10px;
    vertical-align:middle;
    box-shadow:0 2px 8px rgba(76,175,80,0.35);
    animation:newTagPulse 2s ease-in-out infinite;
    white-space:nowrap;
}

@keyframes newTagPulse{
    0%,100%{transform:scale(1);box-shadow:0 2px 8px rgba(76,175,80,0.35);}
    50%{transform:scale(1.05);box-shadow:0 4px 14px rgba(76,175,80,0.5);}
}

/* ===== SHIFT STATUS INFO (pending/under review) ===== */
.shift-status-info{
    display:flex;
    align-items:center;
    gap:14px;
    margin-top:14px;
    padding:14px 16px;
    border-radius:16px;
    background:linear-gradient(135deg,#fef9c3,#fef3c7);
    border:1px solid #fde047;
}

.shift-status-icon{
    font-size:32px;
    flex-shrink:0;
}

.shift-status-text{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.shift-status-text strong{
    font-size:15px;
    font-weight:800;
    color:#854d0e;
}

.shift-status-text span{
    font-size:13px;
    color:#a16207;
}

/* ===== SHIFT ADMIN CONTACT ===== */
.shift-admin-contact{
    margin-top:10px;
    padding:10px 14px;
    border-radius:12px;
    background:linear-gradient(135deg,#eff6ff,#dbeafe);
    border:1px solid #bfdbfe;
    color:#1d4ed8;
    font-size:13px;
    font-weight:600;
    text-align:center;
}

/* ===== SHIFT CANCEL BUTTON ===== */
.shift-cancel-btn{
    flex:1;
    padding:12px;
    background:linear-gradient(135deg,#ef4444,#dc2626);
    color:white;
    border:none;
    border-radius:12px;
    font-weight:700;
    cursor:pointer;
    transition:all 0.2s ease;
    box-shadow:0 4px 12px rgba(239,68,68,0.3);
}

.shift-cancel-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 6px 16px rgba(239,68,68,0.4);
}

.shift-cancel-btn:active{
    transform:scale(0.97);
}

/* ===== SHIFT ACTIVE BANNER (when assigned) ===== */
.shift-active-banner{
    display:flex;
    align-items:center;
    gap:14px;
    margin-top:14px;
    padding:14px 16px;
    border-radius:16px;
    background:linear-gradient(135deg,#dcfce7,#bbf7d0);
    border:1px solid #86efac;
}

.shift-active-icon{
    font-size:28px;
    flex-shrink:0;
}

.shift-active-text{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.shift-active-text strong{
    font-size:15px;
    font-weight:800;
    color:#166534;
}

.shift-active-text span{
    font-size:13px;
    color:#15803d;
}

/* ===== PENDING SHIFT CARD ENHANCEMENTS ===== */
.pending-shift-card{
    background:linear-gradient(180deg,#ffffff,#fffbeb) !important;
    border:1px solid #fde68a !important;
}

.pending-shift-badge{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 12px;
    border-radius:999px;
    background:linear-gradient(135deg,#f59e0b,#fbbf24);
    color:#fff;
    font-size:12px;
    font-weight:700;
    margin-bottom:10px;
    box-shadow:0 2px 8px rgba(245,158,11,0.3);
}

/* ===== SHIFT PROGRESS STAGES ===== */
.shift-progress-title{
    font-size:13px;
    font-weight:700;
    color:#64748b;
    margin-bottom:10px;
    text-transform:uppercase;
    letter-spacing:0.05em;
}

.shift-progress{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.shift-stage{
    display:flex;
    align-items:center;
    gap:6px;
    padding:8px 12px;
    border-radius:12px;
    background:#f1f5f9;
    border:1px solid #e2e8f0;
    font-size:12px;
    font-weight:600;
    color:#64748b;
    cursor:pointer;
    transition:all 0.2s ease;
    flex:1;
    min-width:100px;
    justify-content:center;
}

.shift-stage:hover{
    background:#e2e8f0;
    transform:translateY(-1px);
}

.shift-stage.active{
    background:linear-gradient(135deg,#22c55e,#16a34a);
    color:white;
    border-color:#22c55e;
    box-shadow:0 4px 12px rgba(34,197,94,0.3);
}

.shift-stage.active:hover{
    background:linear-gradient(135deg,#16a34a,#15803d);
}

.shift-icon{
    font-size:16px;
}

/* ===== RESERVE EXIT BUTTON ===== */
.reserve-exit-card-btn{
    transition:all 0.2s ease;
    box-shadow:0 4px 12px rgba(239,68,68,0.25);
}

.reserve-exit-card-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 6px 16px rgba(239,68,68,0.35);
}

.reserve-exit-card-btn:active{
    transform:scale(0.97);
}

/* === Прогресс смены === */
.shift-progress {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.shift-stage {
    flex: 1 1 auto;
    min-width: 60px;
    padding: 10px 6px;
    border-radius: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    user-select: none;
}
.shift-icon { font-size: 18px; }

/* Выполненные (до текущего) — тёмно-зелёные */
.shift-stage-done {
    background: #15803d;
    color: #ffffff;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.9;
}

/* Текущий — ярко-зелёный, светится */
.shift-stage-current {
    background: #22c55e;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 12px #22c55e, 0 0 24px rgba(34, 197, 94, 0.5);
    animation: pulseGreen 2s ease-in-out infinite;
}
@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 12px #22c55e, 0 0 24px rgba(34, 197, 94, 0.5); }
    50%      { box-shadow: 0 0 18px #22c55e, 0 0 32px rgba(34, 197, 94, 0.8); }
}
.shift-stage-current:active { transform: scale(0.96); }

/* Следующий — белый */
.shift-stage-next {
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    border: 2px solid #22c55e;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
.shift-stage-next:active { transform: scale(0.96); background: #f0fdf4; }

/* Будущие — серые */
.shift-stage-future {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}
