*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Segoe UI',sans-serif;
}

:root{
    --primary:#2D0BFF;
    --primary-dark:#14006e;
    --white:#ffffff;
    --text:#222;
    --light:#f5f7ff;
    --border:#e4e7ff;
}

body{
    background:#f6f8ff;
    color:#222;
}

/* LOGIN */
.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#14006e 0%,#2D0BFF 45%,#6d5dff 100%);
}

.login-box{
    width:420px;
    background:rgba(255,255,255,0.10);
    backdrop-filter:blur(22px);
    border:1px solid rgba(255,255,255,0.2);
    border-radius:24px;
    padding:40px;
    color:#fff;
    box-shadow:0 15px 60px rgba(0,0,0,0.35),0 0 40px rgba(45,11,255,0.35);
    position:relative;
    overflow:hidden;
}

.login-box::before{
    content:'';
    position:absolute;
    width:220px;
    height:220px;
    background:rgba(255,255,255,0.08);
    border-radius:50%;
    top:-80px;
    right:-80px;
}

.login-box h1{
    font-size:34px;
    margin-bottom:10px;
    font-weight:700;
}

.login-box p{
    margin-bottom:30px;
    opacity:0.9;
}

.form-group{
    margin-bottom:20px;
}

.form-group label{
    display:block;
    margin-bottom:8px;
    font-size:14px;
}

.form-control{
    width:100%;
    padding:14px;
    border:none;
    border-radius:12px;
    outline:none;
    background:rgba(255,255,255,0.15);
    color:#fff;
    font-size:15px;
}

.form-control::placeholder{
    color:#eee;
}

.btn{
    width:100%;
    padding:14px;
    border:none;
    border-radius:14px;
    color:var(--primary);
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    background:linear-gradient(90deg,#ffffff,#f3f0ff);
}

.error{
    background:#ff4d4d;
    color:#fff;
    padding:12px;
    border-radius:10px;
    margin-bottom:20px;
    font-size:14px;
}

/* TOPBAR */
.topbar{
    min-height:70px;
    background:#fff;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 25px;
}

.logo{
    font-size:24px;
    font-weight:700;
    color:var(--primary);
}

.top-user{
    display:flex;
    align-items:center;
    gap:15px;
    font-weight:600;
}

.logout-btn{
    background:#2D0BFF;
    color:#fff;
    padding:10px 18px;
    border-radius:12px;
    text-decoration:none;
}

.logout-btn:hover{
    background:#14006e;
}

/* LAYOUT */
.layout{
    display:flex;
    width:100%;
}

.sidebar{
    width:260px;
    min-width:260px;
    background:#fff;
    border-right:1px solid #e9ecff;
    min-height:calc(100vh - 70px);
    padding:22px 14px;
    flex-shrink:0;
}

.side-title,
.sidebar .side-title{
    font-size:13px;
    font-weight:800;
    color:#8a8a9c;
    letter-spacing:.08em;
    padding:0 12px 18px;
}

.sidebar a{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    color:#101225;
    font-weight:700;
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:8px;
}

.sidebar a.active{
    background:linear-gradient(135deg,#2400ff,#5b6bff);
    color:#fff;
}

.sidebar a:hover:not(.active){
    background:#f2f4ff;
    color:#2400ff;
}

.content,
.main{
    flex:1;
    min-width:0;
    width:100%;
    padding:30px;
}

/* COMMON CARDS */
.cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
}

.card{
    background:#fff;
    border-radius:20px;
    padding:25px;
    border:1px solid var(--border);
    box-shadow:0 5px 20px rgba(0,0,0,0.04);
}

.card h3{
    font-size:15px;
    color:#777;
    margin-bottom:12px;
}

.card h2{
    font-size:32px;
    color:var(--primary);
}

.gradient-card{
    background:linear-gradient(135deg,#2D0BFF,#6d5dff);
    color:#fff;
}

.gradient-card h2,
.gradient-card h3{
    color:#fff;
}

.welcome-box{
    background:linear-gradient(135deg,#2D0BFF,#6d5dff);
    border-radius:24px;
    padding:35px;
    color:#fff;
    margin-bottom:25px;
    box-shadow:0 15px 50px rgba(45,11,255,0.25);
}

.welcome-box h1{
    font-size:34px;
    margin-bottom:10px;
}

.welcome-box p{
    opacity:0.9;
}

.dashboard-grid{
    margin-top:25px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.glass-box,
.blue-panel{
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    padding:25px;
    min-height:260px;
    box-shadow:0 8px 25px rgba(0,0,0,0.05);
}

.box-title,
.panel-title{
    font-size:20px;
    font-weight:800;
    margin-bottom:20px;
    color:#120050;
}

.empty-state,
.empty-soft{
    color:#888;
    font-size:15px;
    text-align:center;
    background:#f3f5ff;
    padding:18px;
    border-radius:16px;
}

/* PAGE HEAD */
.page-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:25px;
    gap:16px;
}

.page-head h1{
    font-size:32px;
    color:#1f1f1f;
    margin-bottom:6px;
}

.page-head p{
    color:#777;
}

.primary-action{
    background:linear-gradient(135deg,#2D0BFF,#6d5dff);
    color:#fff;
    text-decoration:none;
    padding:14px 22px;
    border-radius:14px;
    font-weight:700;
    border:none;
    cursor:pointer;
    box-shadow:0 10px 30px rgba(45,11,255,0.25);
}

/* FORMS */
.filter-box,
.form-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    padding:20px;
    margin-bottom:20px;
    box-shadow:0 8px 25px rgba(0,0,0,0.05);
}

.filter-box form{
    display:flex;
    gap:12px;
}

.search-input,
.form-input{
    width:100%;
    padding:15px;
    border:1px solid var(--border);
    border-radius:14px;
    outline:none;
    font-size:15px;
}

.search-input{
    flex:1;
}

.form-input:focus,
.search-input:focus{
    border-color:#2D0BFF;
    box-shadow:0 0 0 4px rgba(45,11,255,0.08);
}

.grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.form-group2{
    margin-bottom:22px;
}

.form-group2 label{
    display:block;
    margin-bottom:8px;
    font-weight:600;
    color:#444;
}

.form-textarea{
    width:100%;
    min-height:120px;
    padding:15px;
    border:1px solid var(--border);
    border-radius:14px;
    outline:none;
    resize:vertical;
    font-size:15px;
}

.submit-btn,
.small-btn{
    border:none;
    background:#2D0BFF;
    color:#fff;
    padding:14px 22px;
    border-radius:14px;
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
}

.light-btn{
    background:#f1f0ff;
    color:#2D0BFF;
}

.error-box{
    background:#fff0f0;
    color:#c91f1f;
    padding:15px;
    border-radius:14px;
    margin-bottom:20px;
    font-weight:600;
}

.success-box{
    background:#e9fff1;
    color:#12803a;
    padding:15px;
    border-radius:14px;
    margin-bottom:20px;
    font-weight:700;
}

.section-title{
    font-size:22px;
    margin:25px 0 20px;
    color:#2D0BFF;
    border-bottom:1px solid var(--border);
    padding-bottom:12px;
}

/* TABLE */
.table-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    padding:18px;
    box-shadow:0 8px 25px rgba(0,0,0,0.05);
    overflow-x:auto;
}

.lux-table{
    width:100%;
    border-collapse:collapse;
}

.lux-table th{
    text-align:left;
    padding:16px;
    color:#555;
    font-size:14px;
    border-bottom:1px solid var(--border);
}

.lux-table td{
    padding:16px;
    border-bottom:1px solid #f0f1ff;
    color:#222;
}

.lux-table tr:hover{
    background:#f8f7ff;
}

.lux-table small{
    color:#777;
    font-size:12px;
}

.badge{
    display:inline-block;
    padding:7px 12px;
    border-radius:20px;
    font-size:12px;
    font-weight:700;
}

.badge.success{
    background:#e9fff1;
    color:#12803a;
}

.badge.danger{
    background:#fff0f0;
    color:#c91f1f;
}

.badge.warning{
    background:#fff7e6;
    color:#a66a00;
}

.mini-btn{
    display:inline-block;
    padding:8px 11px;
    border-radius:9px;
    background:#f1f0ff;
    color:#2D0BFF;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
    margin-right:4px;
}

.mini-btn.edit{
    background:#fff7e6;
    color:#a66a00;
}

.danger-btn{
    background:#fff0f0 !important;
    color:#c91f1f !important;
}

.empty-row{
    text-align:center;
    color:#888 !important;
    padding:35px !important;
}

/* PROFILE / TIMELINE */
.profile-header{
    background:linear-gradient(135deg,#2D0BFF,#6d5dff);
    border-radius:24px;
    padding:30px;
    color:#fff;
    margin-bottom:25px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:0 15px 40px rgba(45,11,255,0.25);
}

.profile-header h1{
    font-size:34px;
    margin-bottom:10px;
}

.detail-item{
    margin-bottom:18px;
    color:#333;
    line-height:1.7;
}

.timeline{
    position:relative;
    padding-left:25px;
}

.timeline::before{
    content:'';
    position:absolute;
    left:8px;
    top:0;
    width:3px;
    height:100%;
    background:#dcd8ff;
}

.timeline-item{
    position:relative;
    margin-bottom:35px;
}

.timeline-dot{
    width:18px;
    height:18px;
    border-radius:50%;
    background:#2D0BFF;
    position:absolute;
    left:-25px;
    top:5px;
}

.timeline-content{
    background:#f8f7ff;
    border-radius:18px;
    padding:20px;
    border:1px solid #ebe8ff;
}

.timeline-content h3{
    margin-bottom:12px;
    color:#2D0BFF;
}

/* TASKS */
.task-box{
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    padding:25px;
    margin-bottom:22px;
    box-shadow:0 8px 25px rgba(0,0,0,0.05);
}

.task-top{
    display:flex;
    justify-content:space-between;
    gap:15px;
    align-items:flex-start;
}

.task-title{
    font-size:22px;
    font-weight:800;
    color:#222;
    margin-bottom:8px;
}

.task-meta{
    color:#777;
    font-size:14px;
}

.task-note{
    background:#f8f7ff;
    border:1px solid #ebe8ff;
    border-radius:18px;
    padding:18px;
    margin-top:18px;
    color:#333;
    line-height:1.7;
}

.advanced-filter{
    display:grid !important;
    grid-template-columns:2fr 1fr 1fr 1fr auto auto;
    gap:12px;
    align-items:center;
}

/* MOBILE CLEAN MODE */
@media(max-width:900px){

    .sidebar{
        display:none !important;
    }

    .layout{
        display:block !important;
    }

    .content,
    .main{
        width:100% !important;
        padding:14px !important;
        margin:0 !important;
    }

    .topbar{
        display:block !important;
        height:auto !important;
        padding:18px 16px !important;
    }

    .logo{
        font-size:28px;
        margin-bottom:18px;
    }

    .top-user{
        width:100%;
        display:grid !important;
        grid-template-columns:1fr 1fr;
        gap:12px;
        margin-top:12px;
    }

    .top-user span,
    .top-user-box{
        grid-column:1/-1;
        background:#f4f1ff;
        border:1px solid #ded8ff;
        border-radius:18px;
        padding:14px 18px;
        color:#111;
    }

    .logout-btn{
        width:100%;
        display:flex;
        align-items:center;
        justify-content:center;
        min-height:54px;
        border-radius:18px;
        font-size:18px;
    }

    .top-user a[href*="dashboard"],
    .dashboard-top-btn{
        display:none !important;
    }

    .page-head{
        flex-direction:column;
        align-items:flex-start;
        gap:14px;
    }

    .primary-action,
    .page-head a{
        width:100%;
        display:flex;
        align-items:center;
        justify-content:center;
        min-height:54px;
    }

    .cards,
    .dashboard-grid,
    .grid-2,
    .panel-grid,
    .quick-grid,
    .stat-grid,
    .advanced-filter{
        grid-template-columns:1fr !important;
    }

    .filter-box form{
        flex-direction:column;
    }

    .table-card{
        overflow-x:auto;
    }

    .lux-table{
        min-width:850px;
    }

    .quick-card{
        width:100% !important;
        display:block !important;
        text-align:left !important;
    }

    .task-top{
        flex-direction:column;
    }

    .login-box{
        width:92%;
        padding:28px;
    }
}
/* FORCE MOBILE APP VIEW */
@media(max-width:1200px), (pointer:coarse){

    .sidebar{
        display:none !important;
        visibility:hidden !important;
        width:0 !important;
        min-width:0 !important;
        height:0 !important;
        overflow:hidden !important;
        padding:0 !important;
        margin:0 !important;
        border:0 !important;
    }

    .layout{
        display:block !important;
        width:100% !important;
    }

    .content{
        width:100% !important;
        padding:14px !important;
        margin:0 !important;
    }

    .top-user a[href*="dashboard"]{
        display:none !important;
    }

    .quick-grid,
    .stat-grid,
    .panel-grid,
    .dashboard-grid,
    .cards{
        grid-template-columns:1fr !important;
    }
}
/* MOBILE FULL PAGE FIX */

@media(max-width:768px){

    .sidebar{
        display:none !important;
    }

    .layout{
        display:block !important;
    }

    .content,
    .main{
        width:100% !important;
        margin-left:0 !important;
        padding:15px !important;
    }

    .dashboard-grid,
    .cards{
        grid-template-columns:1fr !important;
    }

    .glass-box,
    .card,
    .table-card{
        width:100% !important;
        overflow-x:auto;
    }

    .topbar{
        flex-direction:column;
        align-items:flex-start;
        gap:15px;
    }

    .top-user{
        width:100%;
        display:flex;
        gap:10px;
        flex-wrap:wrap;
    }

    .top-user a{
        flex:1;
        text-align:center;
    }

}
/* USERS PAGE FIX */
.top-btn{
    background:linear-gradient(135deg,#2D0BFF,#6d5dff);
    color:#fff;
    padding:14px 22px;
    border-radius:14px;
    text-decoration:none;
    font-weight:800;
    box-shadow:0 10px 30px rgba(45,11,255,0.22);
}

.search-wrap{
    display:flex;
    gap:12px;
    margin-bottom:25px;
}

.search-wrap input{
    flex:1;
    padding:15px;
    border-radius:14px;
    border:1px solid var(--border);
    font-size:15px;
}

.search-wrap button{
    background:#2D0BFF;
    color:#fff;
    border:none;
    padding:14px 22px;
    border-radius:14px;
    font-weight:800;
}

.role{
    padding:7px 12px;
    border-radius:20px;
    font-size:12px;
    font-weight:800;
    display:inline-block;
    white-space:nowrap;
}

.lawyer{
    background:#e8f0ff;
    color:#1b57d0;
}

.staff{
    background:#f3f3f3;
    color:#444;
}

.junior{
    background:#fff2dc;
    color:#b56a00;
}

.action{
    padding:8px 12px;
    border-radius:10px;
    text-decoration:none;
    font-size:13px;
    font-weight:800;
    display:inline-block;
}

.action.edit,
.edit{
    background:#eee6ff;
    color:#5c27ff;
}

.main table{
    width:100%;
    border-collapse:collapse;
}

.main th,
.main td{
    padding:16px 10px;
    border-bottom:1px solid #eee;
    text-align:left;
}

/* mobile users page */
@media(max-width:900px){
    .search-wrap{
        flex-direction:column;
    }

    .main .card{
        overflow-x:auto;
    }

    .main table{
        min-width:760px;
    }

    .top-btn{
        width:100%;
        display:flex;
        justify-content:center;
        margin-top:14px;
    }
}
/* MOBILE FORM CLEAN MODE - ADD TASK / ADD HEARING */
@media(max-width:900px){

    .form-card,
    .add-wrap,
    .add-client-wrap{
        padding:16px !important;
        border-radius:20px !important;
        width:100% !important;
        overflow:visible !important;
    }

    .grid-2{
        display:block !important;
    }

    .form-group2{
        width:100% !important;
        margin-bottom:16px !important;
    }

    .form-input,
    .form-textarea,
    select,
    input,
    textarea{
        width:100% !important;
        min-height:52px;
        font-size:15px !important;
        border-radius:14px !important;
    }

    .form-textarea{
        min-height:120px !important;
    }

    .page-head{
        display:block !important;
    }

    .page-head h1{
        font-size:28px !important;
        margin-bottom:6px;
    }

    .page-head p{
        font-size:14px;
        line-height:1.5;
    }

    .page-head .primary-action{
        width:100% !important;
        margin-top:14px;
    }

    .submit-btn{
        width:100% !important;
        min-height:54px;
        font-size:16px !important;
    }

    .info-box{
        font-size:14px !important;
        line-height:1.5;
    }
}
/* =========================
MOBILE FULL FORM FIX
ADD TASK / HEARING / CASE
========================= */

@media screen and (max-width: 900px){

    .layout{
        display:block !important;
    }

    .main,
    .content{
        width:100% !important;
        margin-left:0 !important;
        padding:12px !important;
    }

    .card,
    .form-card,
    .table-card{
        width:100% !important;
        padding:16px !important;
        border-radius:18px !important;
        overflow:hidden !important;
        box-sizing:border-box !important;
    }

    form{
        width:100% !important;
    }

    .grid-2,
    .form-grid,
    .row{
        display:flex !important;
        flex-direction:column !important;
        gap:14px !important;
    }

    .grid-2 > div,
    .form-grid > div,
    .row > div{
        width:100% !important;
    }

    input,
    select,
    textarea{
        width:100% !important;
        max-width:100% !important;
        box-sizing:border-box !important;
        font-size:16px !important;
        min-height:52px !important;
        border-radius:12px !important;
    }

    textarea{
        min-height:120px !important;
    }

    button,
    .submit-btn,
    .save-btn{
        width:100% !important;
        min-height:52px !important;
        border-radius:14px !important;
        font-size:16px !important;
    }

    h1{
        font-size:28px !important;
        line-height:1.3 !important;
    }

    .page-head{
        display:block !important;
    }

    .top-actions,
    .page-actions{
        display:block !important;
        margin-top:14px !important;
    }

    .top-actions a,
    .page-actions a{
        display:block !important;
        width:100% !important;
        margin-bottom:10px !important;
        text-align:center !important;
    }
}
/* FINAL ADD TASK + ADD HEARING MOBILE BALANCE FIX */
.mobile-balanced-form{
    width:100%;
    max-width:100%;
    box-sizing:border-box;
}

.mobile-balanced-form form{
    width:100%;
}

.mobile-single-grid{
    align-items:start;
}

.form-input,
.form-textarea,
.mobile-balanced-form select,
.mobile-balanced-form input,
.mobile-balanced-form textarea{
    max-width:100%;
    box-sizing:border-box;
}

@media(max-width:900px){

    .layout{
        display:block !important;
        width:100% !important;
    }

    .sidebar{
        display:none !important;
    }

    .content{
        width:100% !important;
        max-width:100% !important;
        margin:0 !important;
        padding:14px !important;
        box-sizing:border-box !important;
    }

    .page-head{
        display:flex !important;
        flex-direction:column !important;
        gap:12px !important;
        align-items:stretch !important;
        margin-bottom:14px !important;
    }

    .page-head h1{
        font-size:22px !important;
        line-height:1.2 !important;
        margin:0 0 5px 0 !important;
    }

    .page-head p{
        font-size:14px !important;
        line-height:1.45 !important;
        margin:0 !important;
    }

    .page-head .primary-action{
        width:100% !important;
        text-align:center !important;
        justify-content:center !important;
        box-sizing:border-box !important;
    }

    .form-card,
    .mobile-balanced-form{
        width:100% !important;
        max-width:100% !important;
        padding:16px !important;
        margin:0 !important;
        border-radius:16px !important;
        box-sizing:border-box !important;
        overflow:hidden !important;
    }

    .grid-2,
    .mobile-single-grid{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:14px !important;
        width:100% !important;
    }

    .form-group2{
        width:100% !important;
        margin-bottom:14px !important;
        box-sizing:border-box !important;
    }

    .form-group2 label{
        display:block !important;
        font-size:14px !important;
        margin-bottom:7px !important;
        line-height:1.3 !important;
    }

    .form-input,
    .form-textarea,
    .form-group2 input,
    .form-group2 select,
    .form-group2 textarea{
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        height:auto !important;
        min-height:46px !important;
        font-size:15px !important;
        padding:11px 12px !important;
        border-radius:12px !important;
        box-sizing:border-box !important;
        display:block !important;
    }

    .form-textarea,
    .form-group2 textarea{
        min-height:110px !important;
        resize:vertical !important;
    }

    .info-box,
    .error-box{
        width:100% !important;
        box-sizing:border-box !important;
        margin:12px 0 !important;
        font-size:14px !important;
        line-height:1.45 !important;
    }

    .submit-btn{
        width:100% !important;
        min-height:48px !important;
        font-size:15px !important;
        border-radius:14px !important;
        margin-top:8px !important;
        box-sizing:border-box !important;
    }
}
.smart-member-wrap{
    position:relative;
}

.smart-member-btn{
    border:none;
    background:#fff;
    border:1px solid #d7dbff;
    padding:14px 18px;
    border-radius:14px;
    font-weight:700;
    cursor:pointer;
}

.smart-member-box{
    display:none;
    position:absolute;
    top:60px;
    left:0;
    width:340px;
    max-height:260px;
    overflow:auto;
    background:#fff;
    border:1px solid #dfe3ff;
    border-radius:18px;
    padding:14px;
    box-shadow:0 10px 30px rgba(0,0,0,0.08);
    z-index:999;
}

.smart-member-option{
    display:flex;
    gap:10px;
    align-items:flex-start;
    padding:10px;
    border-radius:12px;
    cursor:pointer;
    font-size:14px;
    font-weight:600;
}

.smart-member-option:hover{
    background:#f6f7ff;
}