:root{
--theme-color:#2563eb;
--bg-1:#f8fafc;
--bg-2:#eef2ff;
--text:#111827;
--muted:#6b7280;
--glass:rgba(255,255,255,.65);
--glass-border:rgba(255,255,255,.35);
}

*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at top left,
            #60a5fa,
            transparent 40%
        ),
        radial-gradient(
            circle at top right,
            #8b5cf6,
            transparent 35%
        ),
        radial-gradient(
            circle at bottom,
            #06b6d4,
            transparent 40%
        ),
        #f1f5f9;

    color:var(--text);

    min-height:100vh;
}

html{
    scroll-behavior:smooth;
}

.wrapper{
display:flex;
min-height:100vh;
}

/* SIDEBAR */

.sidebar{

    width:270px;

    background:
        rgba(255,255,255,.18);

    backdrop-filter:
        blur(30px);

    -webkit-backdrop-filter:
        blur(30px);

    border-right:
        1px solid rgba(255,255,255,.25);

    box-shadow:
        0 20px 40px rgba(0,0,0,.08);

    overflow-y:auto;
    overflow-x:hidden;
}

.logo{
padding:24px;

```
font-size:24px;

font-weight:700;

border-bottom:
    1px solid rgba(0,0,0,.05);

color:var(--theme-color);
```

}

.sidebar ul{
list-style:none;
padding:8px;
}

.sidebar ul li{
margin-bottom:2px;
}

.sidebar ul li a{

display:flex;

align-items:center;

text-decoration:none !important;

color:#111827 !important;

padding:10px 14px;

border-radius:12px;

font-size:14px;

font-weight:500;

transition:.25s;
}

.sidebar ul li a:hover{
background:
rgba(255,255,255,.75);

```
transform:
    translateX(4px);
```

}

.sidebar ul li a:hover,
.sidebar ul li a.active{

background:
rgba(255,255,255,.45);

color:
var(--theme-color) !important;

transform:
translateX(4px);
}

/* MAIN */

.main{
flex:1;
}

.topbar{
margin:20px;

```
background:
    rgba(255,255,255,.55);

backdrop-filter:blur(20px);

border:
    1px solid var(--glass-border);

border-radius:24px;

padding:24px;

box-shadow:
    0 8px 32px rgba(0,0,0,.05);
```

}

.content{
padding:20px;

```
animation:
    fadeIn .35s ease;
```

}

/* CARDS */

.cards{
display:grid;

```
grid-template-columns:
    repeat(
        auto-fit,
        minmax(240px,1fr)
    );

gap:20px;
```

}

.card{

    position:relative;
    z-index:1;
    margin-bottom:20px;

    background:
        rgba(255,255,255,.35);

    backdrop-filter:
        blur(25px);

    -webkit-backdrop-filter:
        blur(25px);

    border:
        1px solid rgba(255,255,255,.4);

    box-shadow:
        0 20px 40px rgba(0,0,0,.08);

    border-radius:28px;

    padding:28px;

    transition:.3s;
}

.card:hover{

    transform:
        translateY(-8px);

    box-shadow:
        0 30px 60px rgba(0,0,0,.12);
}

.card h3{
margin-bottom:12px;

```
color:var(--muted);

font-size:14px;
```

}

.card p{
font-size:30px;
font-weight:700;
}

/* BUTTONS */

button,
.btn{

    background:
        linear-gradient(
            135deg,
            var(--theme-color),
            #60a5fa
        );

    color:white;

    border:none;

    border-radius:18px;

    padding:14px 22px;

    font-weight:600;

    cursor:pointer;

    transition:.25s;

    box-shadow:
        0 10px 25px rgba(37,99,235,.25);
}

button:hover,
.btn:hover{

```
transform:
    translateY(-2px);

box-shadow:
    0 10px 25px rgba(0,0,0,.15);
```

}

/* INPUTS */

input,
select,
textarea{

padding:12px;

border-radius:14px;

border:
    1px solid rgba(0,0,0,.08);

background:
    rgba(255,255,255,.7);

backdrop-filter:blur(10px);

font-size:15px;

width:100%;

}

textarea{
resize:vertical;
}

/* TABLES */

table{
width:100%;

```
border-collapse:separate;

border-spacing:0 10px;
```

}

th{
background:
var(--theme-color);

```
color:white;

border:none;

padding:14px;
```

}

td{
background:
rgba(255,255,255,.75);

```
padding:14px;

border:none;
```

}

tr{
box-shadow:
0 2px 10px rgba(0,0,0,.04);
}

/* LINKS */

a{
    color:var(--theme-color);
    text-decoration:none;
}

.btn{
    text-decoration:none !important;
}

/* BADGES */

.notification-badge{
animation:
pulse 1.5s infinite;
}

/* ANIMATIONS */

@keyframes pulse{

```
0%{
    transform:scale(1);
}

50%{
    transform:scale(1.15);
}

100%{
    transform:scale(1);
}
```

}

@keyframes fadeIn{

```
from{
    opacity:0;
    transform:translateY(8px);
}

to{
    opacity:1;
    transform:translateY(0);
}
```

}

/* MOBILE */

.card,
.topbar,
.sidebar{
    animation:
        fadeIn .4s ease;
}

.dashboard-grid{

    display:grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px,1fr)
        );

    gap:20px;
}

.stat-card{

    min-height:180px;

    display:flex;

    flex-direction:column;

    justify-content:center;
}

.stat-card h3{

    font-size:15px;

    color:#6b7280;

    margin-bottom:12px;
}

.stat-card p{

    font-size:42px;

    font-weight:700;

    color:var(--theme-color);
}

/* MOBILE MENU */

.mobile-menu-btn{

display:none;

position:fixed;

top:14px;
left:14px;

z-index:9999;

width:42px;
height:42px;

border:none;

border-radius:12px;

background:
rgba(255,255,255,.25);

backdrop-filter:blur(20px);
-webkit-backdrop-filter:blur(20px);

color:#111827;

font-size:20px;
font-weight:700;

cursor:pointer;

box-shadow:
0 8px 20px rgba(0,0,0,.12);
}

.sidebar-overlay{

display:none;

position:fixed;

top:0;
left:0;

width:100%;
height:100%;

background:
rgba(0,0,0,.3);

backdrop-filter:blur(5px);

z-index:998;
}

.overlay-show{
display:block;
}

@media(max-width:768px){

.mobile-menu-btn{
display:block;
}

.sidebar{

position:fixed;

left:-260px;

top:0;

width:260px;

height:100vh;

z-index:999;

transition:.25s ease;
}

.sidebar-open{
left:0;
}

.main{
width:100%;
}

.topbar{
margin-top:80px;
}

}

.table-container{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.table-container{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

.table-container table{
    width:100%;
    min-width:100%;
}

table{
    width:100%;
}

th{
    white-space:nowrap;
}

td{
    white-space:normal;
    word-break:break-word;
}

td{
    font-size:14px;
}

.notification-badge{
    background:#ef4444;
    color:#fff;
    border-radius:999px;
    padding:3px 8px;
    font-size:12px;
    font-weight:600;
    margin-left:auto;
    min-width:22px;
    text-align:center;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.sidebar ul li a.active-menu{
    background:
        linear-gradient(
            135deg,
            var(--theme-color),
            #60a5fa
        );

    color:#fff !important;

    box-shadow:
        0 10px 25px
        rgba(37,99,235,.25);
}

.logo a{
    text-decoration:none;
    color:inherit;
}

.active-menu{

    background:
        linear-gradient(
            135deg,
            var(--theme-color),
            #60a5fa
        );

    color:white !important;

    box-shadow:
        0 10px 25px
        rgba(37,99,235,.25);
}

.chat-message{
    margin:12px 0;
    padding:14px 18px;
    border-radius:20px;
    max-width:80%;
    box-shadow:
        0 8px 20px rgba(0,0,0,.05);
    backdrop-filter:blur(15px);
    word-wrap:break-word;
}

.chat-incoming{
    background:
        rgba(255,255,255,.65);
    margin-right:auto;
}

.chat-outgoing{
    background:
        rgba(220,252,231,.85);
    margin-left:auto;
}

.chat-status{
    float:right;
    font-size:12px;
    opacity:.7;
}

.chat-time{
    display:block;
    margin-top:8px;
    font-size:12px;
    opacity:.6;
}

#conversation-thread{
    display:flex;
    flex-direction:column;
    gap:10px;
}

@media(max-width:768px){

    .chat-message{
        max-width:95%;
        font-size:14px;
    }

}

.chat-composer{

    position:sticky;
    bottom:10px;

    background:
        rgba(255,255,255,.75);

    backdrop-filter:blur(20px);

    padding:16px;

    margin-top:20px;

    border-radius:24px;

    z-index:100;

    box-shadow:
        0 10px 30px rgba(0,0,0,.08);
}

.chat-composer form{

    display:flex;

    gap:10px;

    align-items:flex-end;
}

.chat-composer textarea{

    width:100%;

    min-height:44px;

    height:44px;

    max-height:200px;

    overflow-y:hidden;

    resize:none;

    transition:.15s ease;

    padding:12px 16px;

    border-radius:20px;

    line-height:1.5;
}

.reply-btn{

    margin:4px;

    font-size:13px;
}

.reply-buttons{

    margin-bottom:10px;
}

.conversation-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    flex-wrap:wrap;

    gap:15px;
}

.conversation-header h2{

    margin-bottom:5px;
}

.conversation-stats{

    display:flex;

    gap:10px;

    flex-wrap:wrap;
}

.stat-pill{

    background:
        rgba(255,255,255,.6);

    padding:10px 16px;

    border-radius:999px;

    font-weight:600;

    backdrop-filter:blur(10px);
}

#conversation-thread{

    max-height:600px;

    overflow-y:auto;

    scrollbar-width:none;

    -ms-overflow-style:none;

    padding:20px;

    background:
        rgba(255,255,255,.15);

    border-radius:25px;

    margin-bottom:20px;
}

#conversation-thread::-webkit-scrollbar{
    display:none;
}

.chat-message{

    max-width:75%;

    padding:15px;

    margin:10px 0;

    border-radius:18px;

    position:relative;
}

.chat-incoming{

    background:#ffffff;

    margin-right:auto;
}

.chat-outgoing{

    background:#dbeafe;

    margin-left:auto;
}

.chat-time{

    display:block;

    font-size:12px;

    opacity:.7;

    margin-top:8px;
}

.conversation-hero{

    display:flex;

    align-items:center;

    gap:18px;

    padding:18px 22px;

    background:
        rgba(255,255,255,.55);

    backdrop-filter:blur(25px);

    border-radius:24px;

    margin-bottom:20px;

    border:
        1px solid rgba(255,255,255,.35);

    position:sticky;

    top:10px;

    z-index:200;
}

.user-avatar{

    width:56px;

    height:56px;

    border-radius:50%;

    background:
        linear-gradient(
            135deg,
            var(--theme-color),
            #60a5fa
        );

    color:white;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:24px;

    font-weight:700;

    box-shadow:
        0 10px 25px rgba(37,99,235,.25);
}

.user-meta{

    flex:1;
}

.user-meta h2{

    font-size:22px;

    margin:0;
}

.user-subtitle{

    color:#64748b;

    font-size:14px;

    margin-top:4px;
}

.conversation-stats{

    display:flex;

    gap:10px;
}

.stat-pill{

    padding:10px 14px;

    border-radius:999px;

    background:
        rgba(255,255,255,.6);

    backdrop-filter:blur(10px);

    font-weight:600;
}

.open-pill{

    background:
        rgba(34,197,94,.15);

    color:#15803d;
}

.ticket-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    flex-wrap:wrap;

    margin-bottom:15px;
}

.ticket-main{

    flex:1;
}

.ticket-id{

    font-size:13px;

    color:#64748b;

    margin-bottom:8px;
}

.ticket-subject{

    font-size:22px;

    margin:0;

    font-weight:700;
}

.ticket-badges{

    display:flex;

    gap:10px;

    flex-wrap:wrap;
}

.status-badge,
.bot-badge{

    padding:8px 14px;

    border-radius:999px;

    font-size:13px;

    font-weight:600;

    backdrop-filter:blur(10px);
}

.status-open{

    background:
        rgba(34,197,94,.15);

    color:#15803d;
}

.bot-badge{

    background:
        rgba(59,130,246,.15);

    color:#2563eb;
}

.ticket-actions{

    display:flex;

    gap:12px;

    margin-top:20px;

    flex-wrap:wrap;
}

.btn-secondary{

    background:
        rgba(255,255,255,.5);

    color:#111827 !important;

    box-shadow:none;
}

/* ===========================
   Conversation Mobile Fixes
   =========================== */

@media (max-width: 768px) {

    .chat-composer form{
        display:block;
    }

    .reply-buttons{
        display:flex;
        flex-wrap:wrap;
        gap:8px;
        margin-bottom:12px;
    }

    .reply-btn{
        margin:0;
        padding:10px 14px;
        font-size:13px;
    }

    .chat-composer textarea{

        width:100%;

        min-height:44px;

        height:auto;

        max-height:200px;

        overflow-y:hidden;

        resize:none;

        line-height:1.5;
    }

    .chat-composer button[type="submit"]{
        width:100%;
    }

    .chat-composer{

        position:sticky;

        bottom:10px;

        z-index:100;

        border-radius:24px;

        padding:14px;

        backdrop-filter:blur(20px);

        box-shadow:
            0 10px 30px rgba(0,0,0,.08);
    }

}

.send-btn{
    min-width:180px;
}

@media(max-width:768px){

    .send-btn{
        width:100%;
    }

    #conversation-thread{

        max-height:50vh;

    }

}

.saved-replies summary{

    cursor:pointer;

    margin-bottom:10px;

    font-weight:600;

    color:var(--theme-color);
}

.saved-replies{

    margin-bottom:12px;
}

/* ===========================
   Ticket Page
   =========================== */

.ticket-hero{

    position:sticky;
    top:10px;
    z-index:200;

    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:20px;

    padding:24px;

    margin-bottom:20px;

    background:
        rgba(255,255,255,.55);

    backdrop-filter:blur(25px);

    border-radius:28px;

    border:
        1px solid rgba(255,255,255,.35);
}

.ticket-meta{
    flex:1;
}

.ticket-title{
    font-size:28px;
    font-weight:700;
    margin-bottom:8px;
}

.ticket-subtitle{
    color:#64748b;
    font-size:14px;
}

.ticket-pills{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.ticket-grid{

    display:grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(350px,1fr)
        );

    gap:20px;
}

.timeline-item{

    padding:14px;

    margin-bottom:12px;

    border-left:
        4px solid var(--theme-color);

    background:
        rgba(255,255,255,.45);

    border-radius:14px;
}

.ticket-conversation{

    max-height:500px;

    overflow-y:auto;

    padding:20px;

    border-radius:24px;

    background:
        rgba(255,255,255,.15);

    scrollbar-width:none;

    -ms-overflow-style:none;
}

.ticket-conversation::-webkit-scrollbar{
    display:none;
}

.ticket-actions{

    display:flex;

    flex-wrap:wrap;

    gap:10px;

    margin-top:15px;
}

@media(max-width:768px){

    .ticket-hero{
        padding:18px;
    }

    .ticket-title{
        font-size:22px;
    }

    .ticket-grid{
        grid-template-columns:1fr;
    }

}

.ticket-filters{

    display:grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px,1fr)
        );

    gap:15px;

    align-items:end;
}

.ticket-filters label{

    display:flex;

    align-items:center;

    gap:8px;
}

.ticket-filters input[type="checkbox"]{

    width:auto;
}

.ticket-filters button{

    width:100%;
}

.table-container{

    background:
        rgba(255,255,255,.35);

    backdrop-filter:blur(20px);

    border-radius:24px;

    padding:15px;

    overflow:auto;
}

table{

    border-collapse:collapse;
}

th{

    position:sticky;

    top:0;

    z-index:5;
}

td{

    padding:12px 10px;
}

.checkbox-filter{

    display:flex;

    align-items:center;

    gap:10px;

    font-weight:600;
}

.checkbox-filter input{

    width:auto;
}

.mobile-text{
    display:none;
}

@media(max-width:768px){

    .desktop-text{
        display:none;
    }

    .mobile-text{
        display:block;
        font-size:24px;
    }

}

.status-pill{

    display:inline-block;

    padding:6px 12px;

    border-radius:999px;

    font-size:12px;

    font-weight:600;
}

.status-active{

    background:
        rgba(34,197,94,.15);

    color:#15803d;
}

.status-inactive{

    background:
        rgba(239,68,68,.15);

    color:#dc2626;
}

.table-container td{

    vertical-align:middle;
}

.table-container td:nth-child(3),
.table-container td:nth-child(4),
.table-container td:nth-child(5),
.table-container td:nth-child(6),
.table-container td:nth-child(7){
    text-align:center;
}

/* ===========================
   WhatsApp Conversation List
   =========================== */

.conversation-list{

    display:flex;
    flex-direction:column;
    gap:12px;
}

.conversation-item{

    display:flex;

    gap:16px;

    align-items:center;

    padding:18px;

    text-decoration:none !important;

    color:inherit !important;

    background:
        rgba(255,255,255,.45);

    backdrop-filter:blur(20px);

    border:
        1px solid rgba(255,255,255,.35);

    border-radius:24px;

    transition:.2s;

    box-shadow:
        0 10px 25px rgba(0,0,0,.05);
}

.conversation-item:hover{

    transform:
        translateY(-2px);

    box-shadow:
        0 15px 35px rgba(0,0,0,.08);
}

.conversation-avatar{

    width:58px;
    height:58px;

    border-radius:50%;

    display:flex;

    align-items:center;
    justify-content:center;

    background:
        linear-gradient(
            135deg,
            var(--theme-color),
            #60a5fa
        );

    color:white;

    font-size:22px;

    font-weight:700;

    flex-shrink:0;
}

.conversation-body{

    flex:1;

    min-width:0;
}

.conversation-top{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:10px;
}

.conversation-top h3{

    margin:0;

    font-size:17px;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;
}

.conversation-date{

    font-size:12px;

    color:#64748b;

    white-space:nowrap;
}

.conversation-bottom{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:12px;

    margin-top:6px;
}

.conversation-preview{

    color:#64748b;

    overflow:hidden;

    text-overflow:ellipsis;

    white-space:nowrap;

    flex:1;
}

.conversation-phone{

    display:block;

    margin-top:6px;

    color:#94a3b8;
}

.unread-pill{

    min-width:24px;

    height:24px;

    border-radius:999px;

    background:#22c55e;

    color:white;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:12px;

    font-weight:700;

    padding:0 8px;
}

@media(max-width:768px){

    .conversation-item{

        padding:14px;
    }

    .conversation-avatar{

        width:50px;
        height:50px;
    }

    .conversation-date{

        display:none;
    }

}

/* ===========================
   Settings / Admins
   =========================== */

.role-pill{

    display:inline-block;

    padding:6px 12px;

    border-radius:999px;

    font-size:12px;

    font-weight:600;
}

.role-agent{

    background:
        rgba(59,130,246,.15);

    color:#2563eb;
}

.role-supervisor{

    background:
        rgba(249,115,22,.15);

    color:#ea580c;
}

.role-super_admin{

    background:
        rgba(168,85,247,.15);

    color:#7e22ce;
}

.admin-actions{

    white-space:nowrap;
}

.action-btn{

    width:38px;

    height:38px;

    padding:0;

    display:inline-flex;

    align-items:center;

    justify-content:center;

    border-radius:12px;

    margin:0;
}

.delete-btn{

    background:
        linear-gradient(
            135deg,
            #ef4444,
            #dc2626
        );
}

@media(max-width:768px){

    .action-btn{

        width:34px;

        height:34px;

        font-size:16px;
    }

    .table-container{

        font-size:13px;
    }

}

.settings-actions{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

    margin-top:15px;
}

.settings-actions .btn{

    min-width:220px;

    text-align:center;
}

.admin-actions{

    display:flex;

    align-items:center;

    gap:8px;

    justify-content:center;
}

.admin-actions form{
    margin:0;
}

.table-container table{

    border-collapse:separate;

    border-spacing:0 12px;
}

.table-container td{

    background:
        rgba(255,255,255,.55);

    backdrop-filter:blur(12px);
}

/* ===========================
   Saved Replies
   =========================== */

.reply-title{

    font-weight:700;

    width:220px;

    white-space:nowrap;
}

.reply-preview{

    max-width:700px;

    color:#475569;

    overflow:hidden;

    text-overflow:ellipsis;

    white-space:nowrap;
}


@media(max-width:768px){

    .reply-preview{

        max-width:180px;
    }

}

.performance{
    display:inline-block;
    padding:8px 14px;
    border-radius:999px;
    font-size:13px;
    font-weight:600;
}

.performance.excellent{
    background:rgba(34,197,94,.15);
    color:#15803d;
}

.performance.good{
    background:rgba(59,130,246,.15);
    color:#2563eb;
}

.performance.average{
    background:rgba(245,158,11,.15);
    color:#d97706;
}

.performance.poor{
    background:rgba(239,68,68,.15);
    color:#dc2626;
}

/* ===========================
   Reports
   =========================== */

.report-hero{
    display:flex;
    align-items:center;
    gap:20px;
}

.leader-avatar{
    width:70px;
    height:70px;
    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:34px;

    background:
        linear-gradient(
            135deg,
            #f59e0b,
            #fbbf24
        );

    box-shadow:
        0 10px 25px
        rgba(245,158,11,.25);
}

.leader-info h2{
    margin:0;
    font-size:28px;
}

.leader-info p{
    font-size:16px;
    color:#64748b;
}

.report-actions{
    display:flex;
    gap:12px;
    margin-bottom:20px;
    flex-wrap:wrap;
}

.performance{
    display:inline-block;
    padding:8px 14px;
    border-radius:999px;
    font-size:13px;
    font-weight:600;
}

.performance.excellent{
    background:rgba(34,197,94,.15);
    color:#15803d;
}

.performance.good{
    background:rgba(59,130,246,.15);
    color:#2563eb;
}

.performance.average{
    background:rgba(245,158,11,.15);
    color:#d97706;
}

.performance.poor{
    background:rgba(239,68,68,.15);
    color:#dc2626;
}

/* ===========================
   AI Learning
   =========================== */

.ai-question{
    max-width:280px;
    font-weight:500;

    white-space:normal;
    word-break:break-word;
}

.ai-response{

    max-width:500px;

    color:#475569;

    line-height:1.5;

    white-space:normal;

    word-break:break-word;
}

.ai-response{

    display:-webkit-box;

    -webkit-line-clamp:3;

    -webkit-box-orient:vertical;

    overflow:hidden;
}

@media(max-width:768px){

    .ai-question{
        max-width:160px;
        font-size:13px;
    }

    .ai-response{
        max-width:220px;
        font-size:13px;
    }

}

.ai-table{
    table-layout:fixed;
}

.ai-table th:nth-child(1){
    width:70px;
}

.ai-table th:nth-child(4){
    width:120px;
}

.ai-table th:nth-child(5){
    width:90px;
}

/* ===========================
   Supervisor Dashboard
   =========================== */

.supervisor-actions{

    display:grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px,1fr)
        );

    gap:12px;

    margin:20px 0 25px 0;
}

.supervisor-actions .btn{

    text-align:center;

    width:100%;
}

.card-subtitle{

    color:#64748b;

    font-size:14px;

    margin-bottom:20px;
}

.supervisor-table td{

    vertical-align:middle;
}

.supervisor-table strong{

    font-size:15px;
}

@media(max-width:768px){

    .supervisor-actions{

        grid-template-columns:1fr;
    }

}

.sla-pill{

    font-weight:600;

    white-space:nowrap;
}

.ticket-id{

    font-size:13px;

    color:#64748b;

    font-weight:600;

    white-space:nowrap;
}

.assigned-name{
    white-space: nowrap;
}

.status-pill{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    min-width:90px;

    padding:8px 14px;

    white-space:nowrap;

    border-radius:999px;

    font-size:13px;

    font-weight:600;
}

.ticket-customer{

    color:#64748b;

    font-size:12px;
}

/* ===================================
   Ticket List
   =================================== */

.ticket-row td{
    vertical-align:middle;
    padding:18px 14px;
}

.ticket-id{
    width:70px;
    white-space:nowrap;
    color:#64748b;
    font-weight:600;
}

.ticket-preview{
    display:flex;
    flex-direction:column;
    gap:4px;
    max-width:420px;
}

.ticket-priority{
    font-size:12px;
    color:#64748b;
}

.ticket-link{
    display:block;

    font-size:16px;
    font-weight:700;

    color:var(--theme-color);
    text-decoration:none;

    line-height:1.4;

    overflow:hidden;

    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
}

.ticket-link:hover{
    text-decoration:underline;
}

.ticket-customer{
    color:#64748b;
    font-size:12px;
}

.user-chip{
    display:flex;
    align-items:center;
    gap:12px;
}

.mini-avatar{
    width:38px;
    height:38px;

    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    background:
        linear-gradient(
            135deg,
            var(--theme-color),
            #60a5fa
        );

    color:white;
    font-weight:700;

    flex-shrink:0;
}

.agent-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:8px 14px;

    border-radius:999px;

    background:
        rgba(59,130,246,.12);

    color:#2563eb;

    font-size:13px;
    font-weight:600;

    white-space:nowrap;
}

.status-cell,
.sla-cell{
    text-align:center;
    white-space:nowrap;
}

.ticket-date{
    text-align:right;
    white-space:nowrap;
}

.ticket-date strong{
    display:block;
    font-size:14px;
}

.ticket-date small{
    color:#64748b;
    font-size:12px;
}

.ticket-row:hover{
    transform:translateY(-2px);

    box-shadow:
        0 10px 25px rgba(0,0,0,.06);
}

@media (min-width: 769px){

    .ticket-row td:nth-child(4){
        min-width:180px;
    }

    .ticket-row td:nth-child(5){
        width:120px;
    }

    .ticket-row td:nth-child(6){
        width:130px;
    }

    .ticket-row td:nth-child(7){
        width:100px;
    }

} 

.ticket-sidebar{

    position:sticky;

    top:20px;

    display:flex;

    flex-direction:column;

    gap:20px;
}

.ticket-layout{

    display:grid;

    grid-template-columns:
        minmax(0, 2fr)
        380px;

    gap:20px;

    align-items:start;
}

@media(max-width:1100px){

    .ticket-layout{

        grid-template-columns:1fr;
    }

}

.ticket-message{

    max-width:80%;

    padding:14px 18px;

    border-radius:20px;

    margin-bottom:14px;

    box-shadow:
        0 8px 20px rgba(0,0,0,.05);
}

.ticket-message.incoming{

    background:
        rgba(255,255,255,.85);

    margin-right:auto;
}

.ticket-message.outgoing{

    background:
        rgba(219,234,254,.95);

    margin-left:auto;
}

.ticket-message-time{

    font-size:12px;

    color:#64748b;

    margin-top:8px;
}

/* ===================================
   Tickets Desktop Layout Fix
   =================================== */

@media (min-width: 1200px) {

    .content{
        max-width: 1500px;
        margin: 0 auto;
    }

    .table-container{
        padding: 20px;
    }

    .ticket-row td{
        padding: 22px 16px;
    }

    .ticket-preview{
        max-width: 500px;
    }

    .ticket-row td:nth-child(1){
        width: 80px;
    }

    .ticket-row td:nth-child(2){
        width: 35%;
    }

    .ticket-row td:nth-child(3){
        width: 18%;
    }

    .ticket-row td:nth-child(4){
        width: 18%;
        min-width: 180px;
    }

    .ticket-row td:nth-child(5){
        width: 120px;
    }

    .ticket-row td:nth-child(6){
        width: 130px;
    }

    .ticket-row td:nth-child(7){
        width: 100px;
    }

}

.ticket-preview{
    text-align:left;
}

.ticket-link{
    text-align:left;
}

.ticket-customer{
    text-align:left;
}

/* ===================================
   Tickets Mobile Fix
   =================================== */

@media (max-width: 768px){

    .table-container{
        overflow-x:auto;
    }

    .table-container table{
        min-width:700px;
    }

    .ticket-row td{
        padding:14px 10px;
    }

    .ticket-preview{
        max-width:220px;
    }

    .ticket-link{

        font-size:14px;

        -webkit-line-clamp:2;

        word-break:normal;

        overflow-wrap:break-word;
    }

    .user-chip{
        min-width:120px;
    }

    .agent-pill{
        white-space:nowrap;
        font-size:12px;
    }

    .ticket-date{
        min-width:80px;
    }

}

/* ==========================
   Notifications
   ========================== */

.notifications-table{

    table-layout:fixed;
}

.notification-title{

    display:flex;

    align-items:center;

    gap:8px;

    font-weight:700;

    color:var(--theme-color);
}

.notification-message{

    max-width:420px;

    color:#475569;

    display:-webkit-box;

    -webkit-line-clamp:2;

    -webkit-box-orient:vertical;

    overflow:hidden;
}

.notification-unread{

    width:10px;

    height:10px;

    border-radius:50%;

    background:#ef4444;

    animation:pulse 1.5s infinite;
}

.notification-row{

    transition:.2s ease;
}

.notification-row:hover{

    transform:translateY(-3px);

    box-shadow:
        0 12px 30px
        rgba(0,0,0,.08);
}

.notifications-table td{

    vertical-align:middle;
}

img,
video{
    max-width:100%;
    height:auto;
}

.presence-badge{
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
}

.presence-badge.online{
    background:#dcfce7;
    color:#166534;
}

.presence-badge.away{
    background:#fef3c7;
    color:#92400e;
}

.presence-badge.offline{
    background:#fee2e2;
    color:#991b1b;
}

/* ==========================================================
   Next Gear responsive admin shell — presentation layer only
   ========================================================== */

:root{
    --ng-navy:#071a33;
    --ng-navy-soft:#102c50;
    --ng-surface:rgba(255,255,255,.82);
    --ng-line:rgba(148,163,184,.22);
    --ng-shadow:0 22px 60px rgba(15,23,42,.12);
    --sidebar-width:280px;
}

html{
    background:#edf4fb;
}

body{
    overflow-x:hidden;
    background:
        radial-gradient(circle at 88% 4%, color-mix(in srgb, var(--theme-color) 22%, transparent), transparent 28rem),
        radial-gradient(circle at 12% 92%, rgba(6,182,212,.16), transparent 26rem),
        linear-gradient(145deg,#f8fbff 0%,#eef5fc 48%,#f5f3ff 100%);
    background-attachment:fixed;
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    pointer-events:none;
    opacity:.34;
    background-image:
        linear-gradient(rgba(37,99,235,.055) 1px,transparent 1px),
        linear-gradient(90deg,rgba(37,99,235,.055) 1px,transparent 1px);
    background-size:44px 44px;
    mask-image:linear-gradient(to bottom,black,transparent 80%);
}

.wrapper{
    display:block;
    min-height:100vh;
}

.sidebar{
    position:fixed;
    inset:0 auto 0 0;
    z-index:1200;
    width:var(--sidebar-width);
    height:100dvh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    color:#fff;
    background:
        radial-gradient(circle at 18% 0%,color-mix(in srgb,var(--theme-color) 62%,transparent),transparent 18rem),
        linear-gradient(165deg,var(--ng-navy-soft),var(--ng-navy) 58%,#061426);
    border-right:1px solid rgba(255,255,255,.1);
    box-shadow:18px 0 55px rgba(2,12,27,.2);
    animation:ngSlideIn .55s cubic-bezier(.2,.75,.25,1) both;
}

.sidebar::after{
    content:"";
    position:absolute;
    inset:auto -80px -100px auto;
    width:230px;
    aspect-ratio:1;
    border-radius:50%;
    border:42px solid rgba(255,255,255,.035);
    pointer-events:none;
}

.logo{
    position:relative;
    flex:0 0 auto;
    padding:25px 22px 22px;
    border-bottom:1px solid rgba(255,255,255,.1);
}

.logo::before{
    content:"NG";
    display:grid;
    place-items:center;
    width:44px;
    height:44px;
    float:left;
    margin-right:12px;
    border-radius:14px 14px 14px 5px;
    color:#fff;
    font-size:14px;
    font-weight:900;
    letter-spacing:.08em;
    background:linear-gradient(135deg,var(--theme-color),#22d3ee);
    box-shadow:0 10px 25px color-mix(in srgb,var(--theme-color) 38%,transparent);
}

.logo a{
    display:flex;
    min-height:44px;
    align-items:center;
    color:#fff !important;
    font-size:19px;
    font-weight:800;
    letter-spacing:-.025em;
}

.sidebar ul{
    position:relative;
    flex:1;
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.2) transparent;
    padding:18px 14px 110px;
}

.sidebar ul::-webkit-scrollbar{width:5px}
.sidebar ul::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:9px}

.sidebar ul li{
    margin:3px 0;
}

.sidebar ul li a{
    position:relative;
    min-height:43px;
    padding:11px 14px 11px 17px;
    border:1px solid transparent;
    border-radius:13px;
    color:rgba(226,232,240,.82) !important;
    font-size:13.5px;
    font-weight:600;
    letter-spacing:.005em;
    transition:transform .22s ease,background .22s ease,color .22s ease,border-color .22s ease;
}

.sidebar ul li a::before{
    content:"";
    width:6px;
    height:6px;
    margin-right:12px;
    flex:0 0 auto;
    border-radius:2px;
    background:rgba(148,163,184,.65);
    transform:rotate(45deg);
    transition:.22s ease;
}

.sidebar ul li a:hover{
    color:#fff !important;
    background:rgba(255,255,255,.08);
    border-color:rgba(255,255,255,.08);
    transform:translateX(3px);
}

.sidebar ul li a.active-menu,
.sidebar ul li a.active{
    color:#fff !important;
    background:linear-gradient(100deg,color-mix(in srgb,var(--theme-color) 78%,#fff 8%),color-mix(in srgb,var(--theme-color) 42%,transparent));
    border-color:rgba(255,255,255,.18);
    box-shadow:0 10px 24px color-mix(in srgb,var(--theme-color) 25%,transparent),inset 0 1px rgba(255,255,255,.16);
    transform:translateX(3px);
}

.sidebar ul li a.active-menu::before,
.sidebar ul li a.active::before{
    width:7px;
    height:7px;
    background:#fff;
    box-shadow:0 0 0 5px rgba(255,255,255,.12);
}

.notification-badge{
    margin-left:auto;
    min-width:22px;
    height:22px;
    display:inline-grid;
    place-items:center;
    padding:0 6px;
    border-radius:999px;
    color:#7f1d1d;
    background:#fecaca;
    font-size:11px;
    font-weight:900;
    box-shadow:0 0 0 3px rgba(254,202,202,.12);
}

.main{
    width:auto;
    min-width:0;
    margin-left:var(--sidebar-width);
    padding:20px clamp(18px,2.3vw,38px) 42px;
}

.topbar{
    position:sticky;
    top:16px;
    z-index:900;
    display:flex;
    align-items:center;
    min-height:82px;
    margin:0 auto 24px;
    padding:18px clamp(20px,2.4vw,32px);
    border:1px solid rgba(255,255,255,.72);
    border-radius:22px;
    background:rgba(255,255,255,.76);
    -webkit-backdrop-filter:blur(22px) saturate(150%);
    backdrop-filter:blur(22px) saturate(150%);
    box-shadow:0 13px 40px rgba(15,23,42,.09),inset 0 1px rgba(255,255,255,.9);
    animation:ngDropIn .5s .08s cubic-bezier(.2,.75,.25,1) both;
}

.topbar::before{
    content:"";
    width:5px;
    align-self:stretch;
    margin-right:17px;
    border-radius:999px;
    background:linear-gradient(to bottom,var(--theme-color),#22d3ee);
    box-shadow:0 0 18px color-mix(in srgb,var(--theme-color) 40%,transparent);
}

.topbar h2{
    color:var(--ng-navy);
    font-size:clamp(20px,2.3vw,30px);
    font-weight:800;
    letter-spacing:-.035em;
    line-height:1.1;
}

.content{
    max-width:1560px;
    margin:0 auto;
    padding:0;
    animation:ngContentIn .55s .13s ease both;
}

.card,
.ticket-hero,
.ticket-sidebar,
.ticket-conversation{
    border:1px solid rgba(255,255,255,.82);
    background:var(--ng-surface);
    -webkit-backdrop-filter:blur(18px) saturate(130%);
    backdrop-filter:blur(18px) saturate(130%);
    box-shadow:var(--ng-shadow),inset 0 1px rgba(255,255,255,.92);
}

.card{
    overflow:hidden;
    border-radius:22px;
    padding:clamp(20px,2.5vw,30px);
    transition:transform .28s cubic-bezier(.2,.75,.25,1),box-shadow .28s ease,border-color .28s ease;
}

.card::before{
    content:"";
    position:absolute;
    inset:0 auto auto 0;
    width:100%;
    height:3px;
    opacity:.65;
    background:linear-gradient(90deg,var(--theme-color),#22d3ee,transparent 76%);
}

.card:hover{
    transform:translateY(-5px);
    border-color:color-mix(in srgb,var(--theme-color) 24%,#fff);
    box-shadow:0 28px 68px rgba(15,23,42,.15),inset 0 1px #fff;
}

.cards,
.dashboard-grid{
    gap:clamp(15px,2vw,24px);
}

.stat-card{
    min-height:160px;
}

.stat-card p{
    color:var(--theme-color);
    font-size:clamp(34px,4vw,48px);
    letter-spacing:-.045em;
}

button,
.btn{
    border:1px solid rgba(255,255,255,.25);
    border-radius:12px;
    box-shadow:0 9px 22px color-mix(in srgb,var(--theme-color) 24%,transparent);
    transition:transform .2s ease,box-shadow .2s ease,filter .2s ease;
}

button:hover,
.btn:hover{
    transform:translateY(-2px);
    filter:saturate(1.08);
    box-shadow:0 14px 30px color-mix(in srgb,var(--theme-color) 30%,transparent);
}

input,
select,
textarea{
    border:1px solid #d9e3ef;
    border-radius:12px;
    background:rgba(255,255,255,.86);
    box-shadow:inset 0 1px 2px rgba(15,23,42,.035);
    transition:border-color .2s ease,box-shadow .2s ease,background .2s ease;
}

input:focus,
select:focus,
textarea:focus{
    outline:none;
    border-color:var(--theme-color);
    background:#fff;
    box-shadow:0 0 0 4px color-mix(in srgb,var(--theme-color) 14%,transparent);
}

.table-container{
    overflow:auto;
    border-radius:16px;
    scrollbar-width:thin;
    scrollbar-color:#b7c7da transparent;
}

table{
    border-spacing:0 7px;
}

th{
    position:sticky;
    top:0;
    z-index:2;
    background:linear-gradient(135deg,var(--ng-navy-soft),var(--ng-navy));
    font-size:11px;
    letter-spacing:.07em;
    text-transform:uppercase;
}

th:first-child{border-radius:11px 0 0 11px}
th:last-child{border-radius:0 11px 11px 0}

td{
    background:rgba(255,255,255,.9);
    border-top:1px solid rgba(226,232,240,.75);
    border-bottom:1px solid rgba(226,232,240,.75);
}

tr{
    box-shadow:0 5px 14px rgba(15,23,42,.035);
}

.floating-back-btn{
    right:clamp(16px,2vw,28px);
    bottom:clamp(16px,2vw,28px);
    min-width:112px;
    height:48px;
    border:1px solid rgba(255,255,255,.3);
    background:linear-gradient(135deg,var(--ng-navy-soft),var(--theme-color));
    box-shadow:0 15px 32px rgba(7,26,51,.24);
}

.sidebar-overlay{
    position:fixed;
    inset:0;
    z-index:1100;
    background:rgba(3,12,25,.54);
    -webkit-backdrop-filter:blur(5px);
    backdrop-filter:blur(5px);
    opacity:0;
    visibility:hidden;
    transition:opacity .25s ease,visibility .25s ease;
}

@keyframes ngSlideIn{
    from{opacity:0;transform:translateX(-22px)}
    to{opacity:1;transform:translateX(0)}
}

@keyframes ngDropIn{
    from{opacity:0;transform:translateY(-14px)}
    to{opacity:1;transform:translateY(0)}
}

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

@media (max-width:1100px) and (min-width:769px){
    :root{--sidebar-width:228px}
    .sidebar ul{padding-inline:10px}
    .sidebar ul li a{padding-inline:12px;font-size:12.5px}
    .logo{padding-inline:16px}
    .logo::before{width:39px;height:39px;margin-right:9px}
    .logo a{font-size:16px}
    .main{padding-inline:20px}
}

@media (max-width:768px){
    body.menu-open{overflow:hidden}

    .sidebar{
        width:min(86vw,310px);
        transform:translateX(-105%);
        box-shadow:25px 0 70px rgba(2,12,27,.34);
        animation:none;
        transition:transform .32s cubic-bezier(.2,.75,.25,1);
    }

    .sidebar.sidebar-open{transform:translateX(0)}
    .sidebar-overlay.overlay-show{opacity:1;visibility:visible}

    .mobile-menu-btn{
        display:flex;
        flex-direction:column;
        justify-content:center;
        gap:5px;
        top:18px;
        left:16px;
        z-index:1300;
        width:46px;
        height:46px;
        padding:0 12px;
        border-radius:14px;
        font-size:0;
        background:linear-gradient(145deg,var(--ng-navy-soft),var(--ng-navy));
        box-shadow:0 12px 28px rgba(7,26,51,.28);
    }

    .mobile-menu-btn::before,
    .mobile-menu-btn::after{
        content:"";
        display:block;
        width:21px;
        height:2px;
        border-radius:4px;
        background:#fff;
        transition:transform .25s ease;
    }

    body.menu-open .mobile-menu-btn::before{transform:translateY(3.5px) rotate(45deg)}
    body.menu-open .mobile-menu-btn::after{transform:translateY(-3.5px) rotate(-45deg)}

    .main{
        margin-left:0;
        padding:12px 12px 88px;
    }

    .topbar{
        top:10px;
        min-height:62px;
        margin-bottom:18px;
        padding:14px 16px 14px 64px;
        border-radius:18px;
    }

    .topbar::before{width:4px;margin-right:11px}
    .topbar h2{font-size:clamp(18px,5.8vw,24px)}

    .content{padding:0}
    .card{padding:18px;border-radius:18px;margin-bottom:14px}
    .cards,.dashboard-grid{grid-template-columns:1fr;gap:14px}
    .stat-card{min-height:125px}

    .table-container{
        margin-inline:-2px;
        padding-bottom:4px;
    }

    table{min-width:680px}
    th,td{padding:11px 12px;font-size:12px}

    .floating-back-btn{
        right:14px;
        bottom:14px;
        min-width:0;
        width:48px;
        height:48px;
        padding:0;
        font-size:0;
    }

    .floating-back-btn::before{font-size:21px}
}

/* Accessible titles for every data table */
.table-container table thead th,
.table-container table tr:first-child th,
table thead th,
.ai-table th,
.notifications-table th{
    color:#ffffff !important;
    background:linear-gradient(135deg,#12355e,#071a33) !important;
    border:0 !important;
    padding:14px 13px !important;
    font-size:11px !important;
    font-weight:800 !important;
    line-height:1.25 !important;
    letter-spacing:.065em !important;
    text-align:left;
    text-transform:uppercase;
    text-shadow:0 1px 1px rgba(0,0,0,.18);
    vertical-align:middle;
}

.table-container table thead th:first-child,
.table-container table tr:first-child th:first-child{
    border-radius:11px 0 0 11px !important;
}

.table-container table thead th:last-child,
.table-container table tr:first-child th:last-child{
    border-radius:0 11px 11px 0 !important;
}

.ai-table th:nth-child(4),
.ai-table th:nth-child(5){
    text-align:center;
}

.integration-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:20px;
}

.integration-card form{
    display:grid;
    gap:10px;
}

.integration-card form label{
    margin-top:8px;
    color:#334155;
    font-size:12px;
    font-weight:800;
    letter-spacing:.035em;
    text-transform:uppercase;
}

.integration-heading{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:20px;
}

.integration-heading h3{margin:0 0 4px;color:#0f2744;font-size:19px}
.integration-heading p{margin:0;color:#64748b;font-size:13px}

.integration-mark{
    display:grid;
    place-items:center;
    width:52px;
    height:52px;
    flex:0 0 auto;
    border-radius:16px 16px 16px 6px;
    color:#fff;
    background:linear-gradient(135deg,#e11d48,#f97316);
    box-shadow:0 12px 26px rgba(225,29,72,.2);
    font-size:12px;
    font-weight:900;
}

.integration-test-mark{background:linear-gradient(135deg,var(--theme-color),#22d3ee)}

.integration-status{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:18px;
    padding:12px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#f8fafc;
}

.integration-status small{color:#64748b}

.integration-notice{
    margin-bottom:16px;
    padding:13px 16px;
    border:1px solid #86efac;
    border-radius:12px;
    color:#166534;
    background:#f0fdf4;
    font-weight:700;
}

.integration-notice.integration-error{
    border-color:#fca5a5;
    color:#991b1b;
    background:#fff1f2;
}

@media(max-width:900px){
    .integration-grid{grid-template-columns:1fr}
}

@media (max-width:420px){
    .main{padding-inline:9px}
    .topbar{border-radius:16px;padding-right:11px}
    .card{padding:16px}
    button,.btn{padding:11px 15px}
}

@media (prefers-reduced-motion:reduce){
    html{scroll-behavior:auto}
    *,*::before,*::after{
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.01ms !important;
        scroll-behavior:auto !important;
    }
}

/* CSP-safe connection state */
#offline-banner{
    position:fixed;
    top:18px;
    right:18px;
    z-index:1400;
    max-width:min(330px,calc(100vw - 36px));
    padding:11px 16px 11px 38px;
    border:1px solid rgba(254,202,202,.9);
    border-radius:14px;
    color:#991b1b;
    background:rgba(255,241,242,.94);
    box-shadow:0 14px 36px rgba(127,29,29,.15);
    -webkit-backdrop-filter:blur(15px);
    backdrop-filter:blur(15px);
    font-size:13px;
    font-weight:750;
    animation:ngDropIn .25s ease both;
}

#offline-banner::before{
    content:"";
    position:absolute;
    left:16px;
    top:50%;
    width:9px;
    height:9px;
    border-radius:50%;
    background:#ef4444;
    box-shadow:0 0 0 5px rgba(239,68,68,.12);
    transform:translateY(-50%);
}

/* Ticket list becomes readable cards instead of a cropped desktop table. */
@media (max-width:768px){
    #offline-banner{
        top:auto;
        right:12px;
        bottom:74px;
        left:12px;
        max-width:none;
        text-align:center;
    }

    .table-container:has(.ticket-row){
        overflow:visible;
        padding:0;
        background:transparent;
        box-shadow:none;
    }

    .table-container:has(.ticket-row) table{
        min-width:0;
        width:100%;
        display:block;
    }

    .table-container:has(.ticket-row) thead{
        position:absolute;
        width:1px;
        height:1px;
        overflow:hidden;
        clip:rect(0 0 0 0);
    }

    .table-container:has(.ticket-row) tbody{
        display:grid;
        gap:13px;
    }

    .ticket-row{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:12px 14px;
        padding:17px;
        border:1px solid rgba(255,255,255,.85);
        border-radius:18px;
        background:rgba(255,255,255,.88);
        box-shadow:0 15px 36px rgba(15,23,42,.09);
    }

    .ticket-row:hover{transform:none}

    .ticket-row td{
        display:block;
        min-width:0 !important;
        padding:0;
        border:0;
        background:transparent;
        text-align:left !important;
    }

    .ticket-row td:nth-child(1){grid-column:1;grid-row:1;color:#64748b}
    .ticket-row td:nth-child(2){grid-column:1 / -1;grid-row:2}
    .ticket-row td:nth-child(3){grid-column:1;grid-row:3}
    .ticket-row td:nth-child(4){grid-column:2;grid-row:3}
    .ticket-row td:nth-child(5){grid-column:1;grid-row:4}
    .ticket-row td:nth-child(6){grid-column:2;grid-row:4}
    .ticket-row td:nth-child(7){grid-column:2;grid-row:1;text-align:right !important}

    .ticket-row td:nth-child(n+3):nth-child(-n+6)::before{
        display:block;
        margin-bottom:5px;
        color:#94a3b8;
        font-size:9px;
        font-weight:800;
        letter-spacing:.08em;
        text-transform:uppercase;
    }

    .ticket-row td:nth-child(3)::before{content:"Customer"}
    .ticket-row td:nth-child(4)::before{content:"Assigned agent"}
    .ticket-row td:nth-child(5)::before{content:"Status"}
    .ticket-row td:nth-child(6)::before{content:"SLA"}

    .ticket-preview{max-width:none}
    .ticket-link{font-size:16px}
    .user-chip{min-width:0;gap:8px}
    .mini-avatar{width:32px;height:32px;font-size:11px}
    .agent-pill{max-width:100%;padding:7px 10px;overflow:hidden;text-overflow:ellipsis}
    .ticket-date{min-width:0;text-align:right}
}

/* Button and control system */
button,
.btn,
input[type="submit"]{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:43px;
    padding:11px 18px;
    border:1px solid color-mix(in srgb,var(--theme-color) 72%,#fff);
    border-radius:12px;
    color:#fff;
    background:linear-gradient(135deg,color-mix(in srgb,var(--theme-color) 90%,#152a4a),color-mix(in srgb,var(--theme-color) 75%,#60a5fa));
    box-shadow:0 9px 22px color-mix(in srgb,var(--theme-color) 24%,transparent),inset 0 1px rgba(255,255,255,.2);
    font:inherit;
    font-size:13px;
    font-weight:750;
    line-height:1;
    letter-spacing:.005em;
    white-space:nowrap;
    cursor:pointer;
    isolation:isolate;
    overflow:hidden;
}

button::after,
.btn::after,
input[type="submit"]::after{
    content:"";
    position:absolute;
    inset:0;
    z-index:-1;
    opacity:0;
    background:linear-gradient(110deg,transparent 20%,rgba(255,255,255,.2) 48%,transparent 75%);
    transform:translateX(-100%);
    transition:transform .45s ease,opacity .2s ease;
}

button:hover::after,
.btn:hover::after,
input[type="submit"]:hover::after{
    opacity:1;
    transform:translateX(100%);
}

button:active,
.btn:active,
input[type="submit"]:active{
    transform:translateY(0) scale(.98);
    box-shadow:0 5px 14px color-mix(in srgb,var(--theme-color) 22%,transparent);
}

button:focus-visible,
.btn:focus-visible,
input[type="submit"]:focus-visible,
a:focus-visible{
    outline:3px solid color-mix(in srgb,var(--theme-color) 28%,transparent);
    outline-offset:3px;
}

button:disabled,
.btn[aria-disabled="true"],
input[type="submit"]:disabled{
    opacity:.55;
    cursor:not-allowed;
    transform:none;
    filter:grayscale(.2);
}

.danger-btn,
.delete-btn{
    border-color:#ef4444;
    background:linear-gradient(135deg,#dc2626,#f04461);
    box-shadow:0 9px 22px rgba(220,38,38,.2),inset 0 1px rgba(255,255,255,.2);
}

.danger-btn:hover,
.delete-btn:hover{
    box-shadow:0 14px 28px rgba(220,38,38,.27);
}

.clear-resolved-btn{
    margin-bottom:16px;
}

.action-btn,
.btn-sm{
    min-width:40px;
    min-height:38px;
    padding:9px 12px;
    border-radius:11px;
    font-size:12px;
}

.admin-actions{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:7px;
}

.admin-actions form{
    display:inline-flex;
    margin:0;
}

.ticket-filters{
    gap:14px;
}

.ticket-filters input,
.ticket-filters select{
    min-height:46px;
    padding-inline:15px;
    border-color:#d8e3f0;
    background:rgba(255,255,255,.92);
}

.ticket-filters button{
    min-height:46px;
}

.checkbox-filter,
.ticket-filters label{
    min-height:42px;
    padding:8px 11px;
    border:1px solid rgba(203,213,225,.7);
    border-radius:11px;
    background:rgba(248,250,252,.72);
}

.checkbox-filter input,
.ticket-filters input[type="checkbox"]{
    width:17px;
    height:17px;
    min-height:0;
    padding:0;
    accent-color:var(--theme-color);
}

@media (max-width:768px){
    button,.btn,input[type="submit"]{
        min-height:44px;
        padding:11px 16px;
    }

    .clear-resolved-btn{
        width:100%;
    }

    .ticket-filters{
        grid-template-columns:1fr;
        gap:11px;
    }

    .ticket-filters input,
    .ticket-filters select,
    .ticket-filters button{
        width:100%;
    }
}
