/* EDIVIC global CSS/mobile repair layer
   Visual-only overrides. Keeps existing workflows and JS IDs untouched. */
:root{
    --edivic-navy:#232F3E;
    --edivic-gold:#FEBD69;
    --edivic-text:#0f172a;
    --edivic-muted:#64748b;
    --edivic-line:#e2e8f0;
    --edivic-bg:#f8fafc;
    --edivic-radius:18px;
}

html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;}
body{min-width:0;}
img,video,canvas,svg{max-width:100%;}
button,a,input,select,textarea{font-family:inherit;}
input,select,textarea{max-width:100%;}

/* Make CSS loading more stable when old page styles fight each other */
.saas-header,.navbar,.top-nav{z-index:1000;}
body:not(.dark-theme){background-color:var(--edivic-bg);}
.logo-img,.brand-logo img,.nav-logo img,.dashboard-logo img{object-fit:contain;}

/* Shared responsive safety */
@media(max-width:980px){
    body{overflow-x:hidden!important;}
    .container,.main-content,.dashboard-content,.project-page,.projects-page,.editors-page,.notifications-page,.settings-page,.chat-page{
        max-width:100%!important;
    }
}

/* Login/Register: simple mobile layout */
@media(max-width:768px){
    body.auth-login-page,
    body.auth-register-page,
    body:has(.login-wrapper),
    body:has(.register-container){
        display:block!important;
        min-height:100svh!important;
        padding:18px!important;
        background:#f8fafc!important;
        overflow-y:auto!important;
    }

    .login-wrapper,
    .register-container{
        width:100%!important;
        max-width:460px!important;
        min-height:auto!important;
        margin:54px auto 20px!important;
        display:block!important;
        border-radius:22px!important;
        overflow:visible!important;
        box-shadow:0 18px 46px rgba(15,23,42,.12)!important;
        background:#fff!important;
    }

    .login-wrapper .left-panel,
    .register-container .left-panel{
        display:none!important;
    }

    .login-wrapper .right-panel,
    .register-container .right-panel{
        display:block!important;
        width:100%!important;
        padding:22px!important;
        background:#fff!important;
        border-radius:22px!important;
    }

    .login-box,
    .form-box{
        width:100%!important;
        max-width:none!important;
    }

    .login-box h2,
    .form-box h2{
        font-size:1.55rem!important;
        margin-bottom:18px!important;
        text-align:left!important;
        color:var(--edivic-navy)!important;
    }

    .input-box{margin-bottom:16px!important;}
    .input-box input,
    .form-box input{
        height:48px!important;
        width:100%!important;
        border:1px solid var(--edivic-line)!important;
        border-radius:14px!important;
        padding:0 14px!important;
        background:#f8fafc!important;
        color:var(--edivic-text)!important;
        margin:8px 0!important;
    }

    .input-box label{
        position:static!important;
        display:block!important;
        margin-bottom:6px!important;
        font-size:.88rem!important;
        color:#475569!important;
        transform:none!important;
    }

    .input-box input:focus ~ label,
    .input-box input:valid ~ label{
        top:auto!important;
        font-size:.88rem!important;
        color:#475569!important;
    }

    #login-btn,
    #register-btn,
    .login-box button,
    .form-box button{
        min-height:48px!important;
        border-radius:14px!important;
        background:var(--edivic-gold)!important;
        color:var(--edivic-navy)!important;
        box-shadow:none!important;
        transform:none!important;
        font-weight:800!important;
        font-size:1rem!important;
    }

    #login-btn:hover,
    #register-btn:hover,
    .login-box button:hover,
    .form-box button:hover{
        transform:none!important;
        box-shadow:none!important;
    }

    .role-container{
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:10px!important;
    }

    .role-label{
        flex-direction:row!important;
        justify-content:flex-start!important;
        min-height:48px!important;
        padding:12px 14px!important;
        border-radius:14px!important;
        background:#f8fafc!important;
    }

    .professional-back-btn{
        top:12px!important;
        left:12px!important;
        font-size:0!important;
        width:42px!important;
        height:42px!important;
        padding:0!important;
        border-radius:999px!important;
        display:inline-flex!important;
        align-items:center!important;
        justify-content:center!important;
        background:#fff!important;
        color:var(--edivic-navy)!important;
        box-shadow:0 10px 24px rgba(15,23,42,.12)!important;
    }
    .professional-back-btn i{font-size:16px!important;}

    .signup-text,
    .form-box p{
        font-size:.92rem!important;
        text-align:center!important;
    }
}

/* Mobile messenger repair: keep contacts and conversation visible/usable */
@media(max-width:768px){
    body.chat-mobile-page,
    body:has(.chat-page){
        overflow-y:auto!important;
        overflow-x:hidden!important;
        background:#f8fafc!important;
    }

    .chat-page{
        width:calc(100% - 20px)!important;
        padding:14px 0 24px!important;
        margin:0 auto!important;
        display:block!important;
        height:auto!important;
        overflow:visible!important;
    }

    .chat-workspace-hero{
        padding:18px!important;
        border-radius:20px!important;
        margin-bottom:14px!important;
    }
    .chat-workspace-hero h1{font-size:1.55rem!important;}
    .chat-workspace-hero p{font-size:.9rem!important;line-height:1.55!important;}

    .chat-container{
        display:flex!important;
        flex-direction:column!important;
        height:auto!important;
        min-height:auto!important;
        border-radius:20px!important;
        overflow:hidden!important;
    }

    .contacts-panel{
        width:100%!important;
        max-height:270px!important;
        min-height:220px!important;
        border-right:0!important;
        border-bottom:1px solid var(--edivic-line)!important;
    }

    .panel-header{padding:16px 16px 8px!important;}
    .panel-header h2{font-size:1.05rem!important;}
    .contacts-list{padding:0 10px 12px!important;}
    .contact-card{padding:11px!important;border-radius:16px!important;}

    .chat-area{
        display:flex!important;
        width:100%!important;
        min-height:420px!important;
        height:auto!important;
    }

    #active-chat-chat-box{
        min-height:420px!important;
    }

    .no-chat-state{
        min-height:350px!important;
        padding:28px 18px!important;
    }

    .chat-header{
        height:auto!important;
        min-height:64px!important;
        padding:12px 14px!important;
    }

    .messages-feed{
        min-height:270px!important;
        max-height:56svh!important;
        padding:14px!important;
        gap:10px!important;
    }

    .message-content{
        max-width:86%!important;
        padding:10px 13px!important;
        border-radius:15px!important;
    }

    .chat-footer{
        padding:12px!important;
        position:sticky!important;
        bottom:0!important;
    }

    #chat-message-send-dock{
        gap:8px!important;
    }

    #chat-text-input{
        height:44px!important;
        padding:0 12px!important;
        font-size:.9rem!important;
    }

    .chat-footer .send-btn,
    .send-btn{
        width:44px!important;
        height:44px!important;
        min-width:44px!important;
        border-radius:13px!important;
    }
}

@media(max-width:420px){
    .login-wrapper,.register-container{margin-top:50px!important;}
    .chat-workspace-hero h1{font-size:1.35rem!important;}
    .message-content{max-width:92%!important;}
}


/* =====================================================
   EDIVIC Message V2 + Navbar Repair + Mobile Auth Buttons
   ===================================================== */
.saas-header,
.saas-header *{
    box-sizing:border-box!important;
}
.saas-header{
    position:sticky!important;
    top:0!important;
    z-index:9999!important;
    width:100%!important;
    min-height:74px!important;
    overflow:visible!important;
}
.saas-header button{
    width:auto!important;
    max-width:none!important;
    padding:0!important;
    margin:0!important;
    box-shadow:none!important;
    transform:none!important;
}
.saas-header .nav-action-btn,
.saas-header .mobile-toggle-btn{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
}
.saas-header .nav-action-btn{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    border-radius:50%!important;
    background:rgba(15,23,42,.05)!important;
}
.saas-header .mobile-toggle-btn{
    width:44px!important;
    height:44px!important;
    border-radius:14px!important;
    background:rgba(15,23,42,.06)!important;
}
.saas-header .nav-links-list,
.saas-header ul{
    margin:0!important;
    padding:0!important;
}
.saas-header .nav-link-item{
    text-decoration:none!important;
    white-space:nowrap!important;
}
.saas-header .profile-dropdown-card{
    overflow:visible!important;
}
@media(max-width:768px){
    .saas-header .saas-nav-container{
        min-height:68px!important;
        padding:10px 14px!important;
    }
    .saas-header .saas-nav-menu{
        display:none!important;
    }
    .saas-header .saas-nav-menu.mobile-open,
    .saas-header .saas-nav-menu.active{
        display:block!important;
        position:absolute!important;
        left:12px!important;
        right:12px!important;
        top:72px!important;
        width:auto!important;
        border-radius:22px!important;
        padding:14px!important;
        background:rgba(255,255,255,.98)!important;
        border:1px solid rgba(15,23,42,.08)!important;
        box-shadow:0 22px 55px rgba(15,23,42,.18)!important;
    }
    .saas-header .nav-links-list{
        display:flex!important;
        flex-direction:column!important;
        gap:8px!important;
        align-items:stretch!important;
    }
    .saas-header .nav-link-item{
        width:100%!important;
        justify-content:flex-start!important;
        border-radius:16px!important;
    }
}

/* Separate message dashboards */
body.client-message-page,
body.editor-message-page{
    overflow:auto!important;
    background:#eef2f7!important;
}
body.client-message-page .chat-page,
body.editor-message-page .chat-page{
    display:block!important;
    width:min(1380px, calc(100% - 40px))!important;
    height:auto!important;
    min-height:calc(100vh - 96px)!important;
    margin:22px auto!important;
    overflow:visible!important;
}
body.client-message-page .sidebar,
body.editor-message-page .sidebar{
    display:none!important;
}
body.client-message-page .chat-workspace-hero,
body.editor-message-page .chat-workspace-hero{
    display:flex!important;
    justify-content:space-between!important;
    align-items:flex-end!important;
    gap:20px!important;
    padding:26px 30px!important;
    border-radius:30px!important;
    margin:0 0 18px!important;
    color:#fff!important;
    box-shadow:0 24px 60px rgba(15,23,42,.16)!important;
    position:relative!important;
    overflow:hidden!important;
}
body.client-message-page .chat-workspace-hero{
    background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 55%,#f59e0b 150%)!important;
}
body.editor-message-page .chat-workspace-hero{
    background:linear-gradient(135deg,#111827 0%,#7c2d12 52%,#f59e0b 135%)!important;
}
body.client-message-page .chat-workspace-hero::after,
body.editor-message-page .chat-workspace-hero::after{
    content:"";
    position:absolute;
    right:-80px;
    top:-100px;
    width:260px;
    height:260px;
    border-radius:50%;
    background:rgba(255,255,255,.16);
}
body.client-message-page .chat-workspace-hero h1,
body.editor-message-page .chat-workspace-hero h1{
    font-size:2.05rem!important;
    line-height:1.15!important;
    margin:0 0 8px!important;
    color:#fff!important;
}
body.client-message-page .chat-workspace-hero p,
body.editor-message-page .chat-workspace-hero p{
    max-width:760px!important;
    color:rgba(255,255,255,.82)!important;
    line-height:1.7!important;
    margin:0!important;
}
body.client-message-page .chat-container,
body.editor-message-page .chat-container{
    display:grid!important;
    grid-template-columns:360px minmax(0, 1fr)!important;
    height:calc(100vh - 220px)!important;
    min-height:620px!important;
    background:#fff!important;
    border:1px solid rgba(15,23,42,.08)!important;
    border-radius:30px!important;
    overflow:hidden!important;
    box-shadow:0 24px 70px rgba(15,23,42,.12)!important;
}
body.client-message-page .contacts-panel,
body.editor-message-page .contacts-panel{
    width:auto!important;
    height:100%!important;
    background:linear-gradient(180deg,#ffffff,#f8fafc)!important;
    border-right:1px solid rgba(15,23,42,.08)!important;
}
body.editor-message-page .contacts-panel{
    background:linear-gradient(180deg,#fff7ed,#ffffff 42%,#f8fafc)!important;
}
body.client-message-page .panel-header,
body.editor-message-page .panel-header{
    padding:22px 20px 12px!important;
}
body.client-message-page .panel-header h2,
body.editor-message-page .panel-header h2{
    font-size:1.18rem!important;
    letter-spacing:-.02em!important;
}
body.client-message-page .search-bar,
body.editor-message-page .search-bar{
    margin:0 16px 16px!important;
    border:1px solid rgba(15,23,42,.08)!important;
    background:#fff!important;
    box-shadow:0 10px 26px rgba(15,23,42,.05)!important;
}
body.client-message-page .contact-card,
body.editor-message-page .contact-card{
    margin:0 8px 10px!important;
    padding:14px!important;
    border:1px solid rgba(15,23,42,.08)!important;
    background:#fff!important;
    border-radius:18px!important;
    box-shadow:0 8px 22px rgba(15,23,42,.04)!important;
}
body.client-message-page .contact-card.active,
body.client-message-page .contact-card:hover{
    background:#eff6ff!important;
    border-color:#bfdbfe!important;
    transform:translateY(-1px)!important;
}
body.editor-message-page .contact-card.active,
body.editor-message-page .contact-card:hover{
    background:#fff7ed!important;
    border-color:#fed7aa!important;
    transform:translateY(-1px)!important;
}
body.client-message-page .contact-card.active h3,
body.editor-message-page .contact-card.active h3{
    color:#0f172a!important;
}
body.client-message-page .chat-area,
body.editor-message-page .chat-area{
    background:#f8fafc!important;
    height:100%!important;
}
body.client-message-page .chat-header,
body.editor-message-page .chat-header{
    height:82px!important;
    padding:0 24px!important;
    border-bottom:1px solid rgba(15,23,42,.08)!important;
    background:rgba(255,255,255,.92)!important;
    backdrop-filter:blur(14px)!important;
}
body.client-message-page .chat-header .badge{
    color:#2563eb!important;
}
body.editor-message-page .chat-header .badge{
    color:#ea580c!important;
}
body.client-message-page .messages-feed,
body.editor-message-page .messages-feed{
    background:
      radial-gradient(circle at 18% 12%, rgba(59,130,246,.10), transparent 28%),
      radial-gradient(circle at 82% 88%, rgba(245,158,11,.12), transparent 30%),
      #f8fafc!important;
    padding:24px!important;
}
body.editor-message-page .messages-feed{
    background:
      radial-gradient(circle at 12% 15%, rgba(249,115,22,.11), transparent 28%),
      radial-gradient(circle at 88% 85%, rgba(15,23,42,.08), transparent 28%),
      #fffaf5!important;
}
body.client-message-page .message-content,
body.editor-message-page .message-content{
    border-radius:20px!important;
    box-shadow:0 10px 24px rgba(15,23,42,.08)!important;
}
body.client-message-page .message.outgoing .message-content{
    background:linear-gradient(135deg,#1d4ed8,#2563eb)!important;
    color:#fff!important;
}
body.editor-message-page .message.outgoing .message-content{
    background:linear-gradient(135deg,#7c2d12,#ea580c)!important;
    color:#fff!important;
}
body.client-message-page .message.incoming .message-content,
body.editor-message-page .message.incoming .message-content{
    background:#fff!important;
    color:#0f172a!important;
    border:1px solid rgba(15,23,42,.08)!important;
}
body.client-message-page .chat-footer,
body.editor-message-page .chat-footer{
    background:#fff!important;
    border-top:1px solid rgba(15,23,42,.08)!important;
    padding:16px 20px!important;
}
body.client-message-page #chat-text-input,
body.editor-message-page #chat-text-input{
    height:50px!important;
    border:1px solid rgba(15,23,42,.10)!important;
    border-radius:18px!important;
    background:#f8fafc!important;
    padding:0 16px!important;
}
body.client-message-page .send-btn,
body.editor-message-page .send-btn{
    width:50px!important;
    min-width:50px!important;
    height:50px!important;
    border-radius:18px!important;
    color:#fff!important;
    box-shadow:0 12px 24px rgba(15,23,42,.14)!important;
}
body.client-message-page .send-btn{background:linear-gradient(135deg,#1d4ed8,#f59e0b)!important;}
body.editor-message-page .send-btn{background:linear-gradient(135deg,#7c2d12,#f59e0b)!important;}
.chat-header-avatar.avatar-initial{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
}
@media(max-width:900px){
    body.client-message-page .chat-page,
    body.editor-message-page .chat-page{
        width:calc(100% - 22px)!important;
        margin:14px auto 22px!important;
    }
    body.client-message-page .chat-container,
    body.editor-message-page .chat-container{
        grid-template-columns:1fr!important;
        height:auto!important;
        min-height:0!important;
    }
    body.client-message-page .contacts-panel,
    body.editor-message-page .contacts-panel{
        max-height:290px!important;
        min-height:240px!important;
        border-right:0!important;
        border-bottom:1px solid rgba(15,23,42,.08)!important;
    }
    body.client-message-page .chat-area,
    body.editor-message-page .chat-area{
        min-height:520px!important;
    }
    body.client-message-page .messages-feed,
    body.editor-message-page .messages-feed{
        min-height:330px!important;
        max-height:60svh!important;
    }
}
@media(max-width:540px){
    body.client-message-page .chat-workspace-hero,
    body.editor-message-page .chat-workspace-hero{
        padding:20px!important;
        border-radius:24px!important;
    }
    body.client-message-page .chat-workspace-hero h1,
    body.editor-message-page .chat-workspace-hero h1{
        font-size:1.45rem!important;
    }
    body.client-message-page .chat-workspace-hero p,
    body.editor-message-page .chat-workspace-hero p{
        font-size:.88rem!important;
    }
}

/* Mobile login/register: fully different, simple, touch-first buttons */
@media(max-width:768px){
    body.auth-login-page #login-btn,
    body.auth-register-page #register-btn{
        height:54px!important;
        border-radius:18px!important;
        font-size:1rem!important;
        font-weight:900!important;
        letter-spacing:.02em!important;
        box-shadow:none!important;
        transform:none!important;
        position:relative!important;
        overflow:hidden!important;
    }
    body.auth-login-page #login-btn{
        background:#111827!important;
        color:#ffffff!important;
        border:2px solid #111827!important;
    }
    body.auth-login-page #login-btn::after{
        content:"→";
        position:absolute;
        right:20px;
        top:50%;
        transform:translateY(-50%);
        font-size:1.25rem;
    }
    body.auth-register-page #register-btn{
        background:#ffffff!important;
        color:#111827!important;
        border:2px solid #111827!important;
    }
    body.auth-register-page #register-btn::after{
        content:"Create";
        position:absolute;
        right:12px;
        top:50%;
        transform:translateY(-50%);
        background:#111827;
        color:#fff;
        padding:6px 10px;
        border-radius:12px;
        font-size:.72rem;
        letter-spacing:0;
    }
    body.auth-login-page .signup-text a,
    body.auth-register-page .form-box p a{
        display:inline-flex!important;
        min-height:36px!important;
        align-items:center!important;
        justify-content:center!important;
        padding:7px 14px!important;
        margin-left:5px!important;
        border-radius:999px!important;
        background:#fff7ed!important;
        color:#9a3412!important;
        border:1px solid #fed7aa!important;
        text-decoration:none!important;
    }
}


/* =========================================================
   EDIVIC FINISHING PASS - Dashboard/navbar polish
   Purpose: stop dashboard horizontal sliding, stabilize navbar,
   and make client/editor dashboards look production-finished.
   Workflow/JS IDs untouched.
   ========================================================= */
html,
body{
    width:100% !important;
    max-width:100% !important;
    overflow-x:hidden !important;
}
*,*::before,*::after{box-sizing:border-box!important;}
body[data-saas-platform="true"]{
    background:#f6f8fb!important;
    color:#0f172a!important;
}
body[data-saas-platform="true"].dark-theme{
    background:#0b1220!important;
    color:#f8fafc!important;
}

/* Stable SaaS navbar - no side slide / no horizontal scroll */
.saas-header{
    position:sticky!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    max-width:100%!important;
    z-index:5000!important;
    background:rgba(255,255,255,.94)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
    border-bottom:1px solid rgba(15,23,42,.08)!important;
    box-shadow:0 10px 30px rgba(15,23,42,.06)!important;
}
body.dark-theme .saas-header{
    background:rgba(15,23,42,.92)!important;
    border-bottom-color:rgba(255,255,255,.08)!important;
}
.saas-nav-container{
    width:min(100%,1440px)!important;
    max-width:1440px!important;
    margin:0 auto!important;
    padding:12px 26px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:14px!important;
    min-height:74px!important;
    overflow:visible!important;
}
.logo-link{min-width:max-content!important;}
.logo-img.dashboard-logo-img,
.saas-header .logo-img{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    border-radius:12px!important;
    object-fit:contain!important;
    background:#fff!important;
    padding:3px!important;
    box-shadow:0 10px 22px rgba(15,23,42,.10)!important;
}
.logo-brand{font-size:1.25rem!important;line-height:1!important;}
.logo-subtitle{font-size:.62rem!important;white-space:nowrap!important;}
.saas-nav-menu{min-width:0!important;flex:1 1 auto!important;display:flex!important;justify-content:center!important;}
.nav-links-list{
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    flex-wrap:nowrap!important;
    padding:0!important;
    margin:0!important;
}
.nav-link-item{
    min-height:40px!important;
    padding:9px 12px!important;
    border-radius:13px!important;
    white-space:nowrap!important;
    line-height:1!important;
    font-size:.84rem!important;
}
.nav-right-actions{
    flex:0 0 auto!important;
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
}
.nav-search-bar input{width:190px!important;}
.nav-search-bar input:focus{width:220px!important;}
.nav-action-btn,
.header-profile-trigger{
    flex:0 0 auto!important;
}
.header-profile-trigger{
    min-height:44px!important;
    border-radius:16px!important;
    padding:4px 8px!important;
    border:1px solid rgba(15,23,42,.08)!important;
    background:#fff!important;
}
body.dark-theme .header-profile-trigger{background:rgba(255,255,255,.06)!important;border-color:rgba(255,255,255,.10)!important;}
.profile-dropdown-card{
    z-index:6000!important;
    right:0!important;
    top:calc(100% + 12px)!important;
    min-width:238px!important;
    border-radius:20px!important;
    box-shadow:0 24px 60px rgba(15,23,42,.18)!important;
}

/* Tablet navbar should use hamburger instead of horizontal sliding */
@media(max-width:1180px){
    .nav-search-bar{display:none!important;}
    .saas-nav-menu{
        display:none!important;
        position:absolute!important;
        top:74px!important;
        left:14px!important;
        right:14px!important;
        width:auto!important;
        max-width:none!important;
        padding:14px!important;
        background:#fff!important;
        border:1px solid rgba(15,23,42,.08)!important;
        border-radius:22px!important;
        box-shadow:0 28px 70px rgba(15,23,42,.16)!important;
    }
    body.dark-theme .saas-nav-menu{background:#111827!important;border-color:rgba(255,255,255,.10)!important;}
    .saas-nav-menu.active,
    .saas-nav-menu.mobile-open{display:block!important;}
    .nav-links-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
    .nav-link-item{justify-content:flex-start!important;width:100%!important;min-height:46px!important;padding:12px 14px!important;}
    .mobile-toggle-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:44px!important;height:44px!important;border-radius:14px!important;background:#f1f5f9!important;color:#0f172a!important;}
    body.dark-theme .mobile-toggle-btn{background:rgba(255,255,255,.08)!important;color:#fff!important;}
}
@media(max-width:640px){
    .saas-nav-container{padding:10px 14px!important;min-height:66px!important;gap:8px!important;}
    .logo-img.dashboard-logo-img,.saas-header .logo-img{width:38px!important;height:38px!important;min-width:38px!important;}
    .logo-brand{font-size:1.05rem!important;}
    .logo-subtitle{display:none!important;}
    .nav-right-actions{gap:6px!important;}
    .nav-action-btn{width:38px!important;height:38px!important;min-width:38px!important;border-radius:13px!important;}
    .header-profile-trigger{min-height:38px!important;padding:3px 6px!important;}
    .header-profile-trigger .chevron-icon{display:none!important;}
    .header-avatar.avatar-initial,.header-profile-trigger img,.header-profile-trigger .avatar-initial{width:34px!important;height:34px!important;min-width:34px!important;font-size:.85rem!important;}
    .saas-nav-menu{top:66px!important;left:10px!important;right:10px!important;border-radius:18px!important;}
    .nav-links-list{grid-template-columns:1fr!important;}
}

/* Dashboard layout polish */
.main-content,
.client-main-content{
    width:min(100%,1440px)!important;
    max-width:1440px!important;
    margin:0 auto!important;
    padding:34px 28px 42px!important;
    overflow-x:clip!important;
}
.topbar,
.client-hero{
    width:100%!important;
    border-radius:28px!important;
    box-shadow:0 24px 70px rgba(15,23,42,.12)!important;
    border:1px solid rgba(255,255,255,.16)!important;
}
.topbar{
    padding:32px!important;
    gap:22px!important;
}
.topbar>div:first-child,
.client-hero>div:first-child{min-width:0!important;}
.topbar h1,
.client-hero h1{
    font-size:clamp(1.65rem,2.6vw,2.55rem)!important;
    line-height:1.08!important;
    letter-spacing:-.04em!important;
}
.topbar p,
.client-hero p{max-width:760px!important;line-height:1.65!important;}
.profile-box,
.client-profile-box{
    flex:0 0 auto!important;
    max-width:100%!important;
    border-radius:22px!important;
}
.profile-box img,
.client-profile-box img,
.profile-box .avatar-initial,
.client-profile-box .avatar-initial{
    width:58px!important;
    height:58px!important;
    min-width:58px!important;
    border:2px solid rgba(255,255,255,.28)!important;
}
.stats-grid,
.client-stats-grid{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:18px!important;
    align-items:stretch!important;
}
.stat-card,
.client-stat-card,
.dashboard-card{
    border-radius:24px!important;
    border:1px solid rgba(15,23,42,.08)!important;
    box-shadow:0 16px 42px rgba(15,23,42,.08)!important;
    overflow:hidden!important;
}
.stat-card,.client-stat-card{min-height:150px!important;padding:24px!important;}
.stat-card h2,.client-stat-card h2{font-size:clamp(1.7rem,2.3vw,2.45rem)!important;line-height:1.05!important;}
.analytics-grid,
.client-dashboard-grid{
    display:grid!important;
    grid-template-columns:minmax(0,1.6fr) minmax(300px,.8fr)!important;
    gap:22px!important;
    align-items:start!important;
}
.dashboard-card{padding:24px!important;background:#fff!important;}
body.dark-theme .dashboard-card,
body.dark-theme .stat-card,
body.dark-theme .client-stat-card{background:#111827!important;border-color:rgba(255,255,255,.08)!important;}
.section-title{gap:14px!important;align-items:center!important;}
.section-title h2{font-size:1.25rem!important;line-height:1.25!important;}
.view-all-btn,
.action-btn,
.client-action-btn,
button{
    touch-action:manipulation!important;
}
.alert-box{border-radius:24px!important;box-shadow:0 14px 36px rgba(245,158,11,.12)!important;}
.footer{margin-top:28px!important;}

@media(max-width:1180px){
    .stats-grid,.client-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    .analytics-grid,.client-dashboard-grid{grid-template-columns:1fr!important;}
}
@media(max-width:820px){
    .main-content,.client-main-content{padding:22px 14px 34px!important;}
    .topbar,.client-hero{padding:24px!important;flex-direction:column!important;align-items:flex-start!important;border-radius:24px!important;}
    .profile-box,.client-profile-box{width:100%!important;justify-content:flex-start!important;}
    .stats-grid,.client-stats-grid{grid-template-columns:1fr!important;gap:14px!important;}
    .stat-card,.client-stat-card,.dashboard-card{border-radius:20px!important;padding:20px!important;}
    .alert-box{padding:18px!important;align-items:flex-start!important;}
}
@media(max-width:520px){
    .main-content,.client-main-content{padding:18px 10px 30px!important;}
    .topbar,.client-hero{padding:20px!important;}
    .profile-box,.client-profile-box{padding:12px!important;gap:12px!important;}
    .profile-box img,.client-profile-box img,.profile-box .avatar-initial,.client-profile-box .avatar-initial{width:50px!important;height:50px!important;min-width:50px!important;}
    .section-title{flex-direction:column!important;align-items:flex-start!important;}
}


/* EDIVIC action loading spinners */
#login-btn, .pricing-container button, .plans button, .card button, .plan button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#login-btn.is-loading, .pricing-container button.is-loading, .plans button.is-loading, .card button.is-loading, .plan button.is-loading {
    opacity: 0.92;
    cursor: wait;
    transform: none !important;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.55);
    border-top-color: #ffffff;
    border-radius: 999px;
    display: inline-block;
    animation: edivicSpin 0.75s linear infinite;
    flex: 0 0 auto;
}

#login-btn .btn-spinner {
    border-color: rgba(35,47,62,0.28);
    border-top-color: #232F3E;
}

@keyframes edivicSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    #login-btn, .pricing-container button, .plans button, .card button, .plan button {
        min-height: 52px;
        border-radius: 16px;
        font-size: 0.98rem;
        touch-action: manipulation;
    }
}
