/* ==========================================================================
   HelpDesk Admin — site.css
   Design tokens (orange / dark-navy theme)
   ========================================================================== */
:root {
    --ink-900: #0b1120;
    --ink-800: #111a2e;
    --orange-600: #f2790c;
    --orange-500: #f97316;
    --orange-100: #ffedd5;
    --blue-600: #2563eb;
    --blue-100: #dbeafe;
    --purple-600: #7c3aed;
    --purple-100: #ede9fe;
    --green-600: #16a34a;
    --green-100: #dcfce7;
    --red-600: #dc2626;
    --red-100: #fee2e2;
    --slate-50: #f7f8fa;
    --slate-100: #f1f3f6;
    --slate-200: #e4e8ee;
    --slate-400: #9aa4b2;
    --slate-500: #6b7684;
    --slate-600: #4b5563;
    --slate-700: #334155;
    --slate-900: #101828;
    --sidebar-width: 264px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.08);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--slate-50);
    color: var(--slate-700);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--ink-900);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--orange-500), #ea580c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(242, 121, 12, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    font-size: 16.5px;
    line-height: 1.25;
    color: #fff;
}

    .brand-text small {
        font-weight: 400;
        font-size: 11.5px;
        color: var(--slate-400);
    }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px;
}

.nav-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #56607a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px 10px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 10px;
    border-left: 3px solid transparent;
    color: #aab2c5;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .nav-item i {
        width: 18px;
        text-align: center;
        font-size: 15px;
    }

    .nav-item span:not(.badge-nav) {
        flex: 1;
    }

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
    }

    .nav-item.active {
        background: rgba(242, 121, 12, 0.14);
        border-left-color: var(--orange-500);
        color: var(--orange-500);
        font-weight: 700;
    }

.badge-nav {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    color: #cbd2e0;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 1.6;
}

.nav-item.active .badge-nav {
    background: var(--orange-500);
    color: #fff;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange-500), #ea580c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .user-info small {
        font-weight: 400;
        color: var(--slate-400);
        font-size: 11.5px;
    }

/* Mobile toggle + overlay */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--ink-900);
    color: #fff;
    font-size: 16px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.55);
    z-index: 999;
}

    .sidebar-overlay.open {
        display: block;
    }

@media (max-width: 991px) {
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-wrapper {
        margin-left: 0 !important;
        padding-top: 76px !important;
    }
}

/* ==========================================================================
   Main content
   ========================================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    padding: 30px 34px 48px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.topbar-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--slate-900);
    margin: 0;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--slate-500);
}

/* Buttons */
.btn-orange {
    background: var(--orange-500);
    border: 1px solid var(--orange-500);
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    padding: 9px 18px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-orange:hover {
        background: var(--orange-600);
        border-color: var(--orange-600);
        color: #fff;
    }

.btn-outline-soft {
    background: #fff;
    border: 1px solid var(--slate-200);
    color: var(--slate-700);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-outline-soft:hover {
        background: var(--slate-50);
        color: var(--slate-900);
    }

.btn-outline-danger-soft {
    background: #fff;
    border: 1px solid #fecaca;
    color: var(--red-600);
    font-weight: 700;
    font-size: 12.5px;
    padding: 7px 14px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-outline-danger-soft:hover {
        background: var(--red-100);
    }

/* ==========================================================================
   Panels / cards
   ========================================================================== */
.panel {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--slate-200);
}

    .panel-header h6 {
        margin: 0;
        font-weight: 800;
        font-size: 15px;
        color: var(--slate-900);
        display: flex;
        align-items: center;
        gap: 9px;
    }

        .panel-header h6 i {
            color: var(--orange-500);
        }

.panel-body {
    padding: 20px 22px;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 1400px) {
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
}

    .stat-icon.blue {
        background: var(--blue-100);
        color: var(--blue-600);
    }

    .stat-icon.orange {
        background: var(--orange-100);
        color: var(--orange-600);
    }

    .stat-icon.purple {
        background: var(--purple-100);
        color: var(--purple-600);
    }

    .stat-icon.green {
        background: var(--green-100);
        color: var(--green-600);
    }

    .stat-icon.red {
        background: var(--red-100);
        color: var(--red-600);
    }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1.1;
}

.stat-label {
    font-size: 11px;
    color: var(--slate-500);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* ==========================================================================
   Status badges (Open / Assigned / In Progress / Closed)
   ========================================================================== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

    .badge-status::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        flex-shrink: 0;
    }

    .badge-status.open {
        background: var(--orange-100);
        color: var(--orange-600);
    }

    .badge-status.assigned {
        background: var(--purple-100);
        color: var(--purple-600);
    }

    .badge-status.inprogress {
        background: var(--blue-100);
        color: var(--blue-600);
    }

    .badge-status.closed {
        background: var(--green-100);
        color: var(--green-600);
    }

/* Plain (no-pill) status label used in Recent Tickets list */
.status-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

    .status-label::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .status-label.open {
        color: var(--orange-600);
    }

    .status-label.assigned {
        color: var(--purple-600);
    }

    .status-label.inprogress {
        color: var(--blue-600);
    }

    .status-label.closed {
        color: var(--green-600);
    }

.badge-priority {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

    .badge-priority.low {
        background: var(--slate-100);
        color: var(--slate-600);
    }

    .badge-priority.medium {
        background: var(--blue-100);
        color: var(--blue-600);
    }

    .badge-priority.high {
        background: var(--orange-100);
        color: var(--orange-600);
    }

    .badge-priority.urgent {
        background: var(--red-100);
        color: var(--red-600);
    }

/* ==========================================================================
   Recent tickets list (Dashboard)
   ========================================================================== */
.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--slate-100);
}

    .recent-item:last-child {
        border-bottom: none;
    }

    .recent-item .ticket-id {
        font-weight: 800;
        color: var(--slate-900);
        font-size: 13.5px;
    }

    .recent-item .ticket-company {
        font-size: 12.5px;
        color: var(--slate-500);
        margin-top: 1px;
    }

    .recent-item .ticket-time {
        font-size: 12.5px;
        color: var(--slate-500);
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .recent-item .ticket-time i {
            color: var(--orange-500);
        }

/* ==========================================================================
   Status distribution bar chart
   ========================================================================== */
.dist-chart {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    height: 160px;
    padding: 10px 6px 0;
}

.dist-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.dist-bar {
    width: 100%;
    max-width: 64px;
    border-radius: 8px 8px 3px 3px;
}

    .dist-bar.open {
        background: var(--orange-500);
    }

    .dist-bar.assigned {
        background: var(--purple-600);
    }

    .dist-bar.inprogress {
        background: var(--blue-600);
    }

    .dist-bar.closed {
        background: var(--green-600);
    }

.dist-label {
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--slate-700);
}

/* ==========================================================================
   Filter bar (search + status pills)
   ========================================================================== */
.filter-bar-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.search-input {
    position: relative;
    flex: 1;
    min-width: 220px;
}

    .search-input i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--slate-400);
        font-size: 13px;
    }

    .search-input input {
        width: 100%;
        border: 1px solid var(--slate-200);
        border-radius: 999px;
        padding: 9px 16px 9px 36px;
        font-size: 13.5px;
        background: var(--slate-50);
    }

        .search-input input:focus {
            outline: none;
            border-color: var(--orange-500);
            background: #fff;
        }

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    border: 1px solid var(--slate-200);
    background: #fff;
    color: var(--slate-600);
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 999px;
    white-space: nowrap;
}

    .filter-pill.active {
        background: var(--ink-900);
        border-color: var(--ink-900);
        color: #fff;
    }

/* ==========================================================================
   Ticket cards (All Tickets page)
   ========================================================================== */
.ticket-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-left-width: 5px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 2fr auto auto;
    gap: 18px;
    align-items: center;
}

@media (max-width: 1200px) {
    .ticket-card {
        grid-template-columns: 1fr;
    }
}

.ticket-card.border-open {
    border-left-color: var(--orange-500);
}

.ticket-card.border-assigned {
    border-left-color: var(--purple-600);
}

.ticket-card.border-inprogress {
    border-left-color: var(--blue-600);
}

.ticket-card.border-closed {
    border-left-color: var(--green-600);
}

.ticket-card .t-id {
    font-weight: 800;
    color: var(--slate-900);
    font-size: 14px;
    margin-bottom: 4px;
}

.ticket-card .t-date {
    font-size: 12px;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticket-card .t-company {
    font-weight: 700;
    color: var(--slate-900);
    font-size: 13.5px;
    margin-bottom: 4px;
}

.ticket-card .t-contact {
    font-size: 12px;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

    .ticket-card .t-contact i {
        width: 12px;
        color: var(--slate-400);
    }

.ticket-card .t-msg-label {
    font-size: 10.5px;
    color: var(--slate-400);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.ticket-card .t-msg {
    font-size: 13px;
    color: var(--slate-600);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-card .t-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* ==========================================================================
   Team member cards (large, centered)
   ========================================================================== */
.member-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 20px;
    text-align: center;
}

.avatar-lg {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: #fff;
    margin: 0 auto 14px;
}

    .avatar-lg.blue {
        background: #3b82f6;
    }

    .avatar-lg.green {
        background: #10b981;
    }

    .avatar-lg.purple {
        background: #8b5cf6;
    }

    .avatar-lg.red {
        background: #ef4444;
    }

    .avatar-lg.orange {
        background: var(--orange-500);
    }

.member-card h6 {
    margin: 0 0 2px;
    font-weight: 800;
    color: var(--slate-900);
    font-size: 15px;
}

.member-card .role {
    font-size: 12.5px;
    color: var(--slate-500);
    margin-bottom: 10px;
}

.member-card .email {
    font-size: 12.5px;
    color: var(--slate-500);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .member-card .email i {
        color: var(--slate-400);
    }

/* Small avatar (assignments table / project stacks) */
.avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 11.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .avatar-circle.blue {
        background: #3b82f6;
    }

    .avatar-circle.green {
        background: #10b981;
    }

    .avatar-circle.purple {
        background: #8b5cf6;
    }

    .avatar-circle.red {
        background: #ef4444;
    }

    .avatar-circle.orange {
        background: var(--orange-500);
    }

.avatar-stack {
    display: flex;
}

    .avatar-stack .avatar-circle {
        width: 26px;
        height: 26px;
        font-size: 10px;
        margin-left: -8px;
        border: 2px solid #fff;
    }

        .avatar-stack .avatar-circle:first-child {
            margin-left: 0;
        }

/* ==========================================================================
   Tables (Assignments)
   ========================================================================== */
.table-clean {
    margin-bottom: 0;
}

    .table-clean thead th {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--slate-500);
        font-weight: 700;
        border-bottom: 1px solid var(--slate-200);
        padding: 12px 14px;
        white-space: nowrap;
    }

    .table-clean tbody td {
        padding: 14px;
        vertical-align: middle;
        font-size: 13.5px;
        color: var(--slate-700);
        border-bottom: 1px solid var(--slate-100);
    }

    .table-clean tbody tr:last-child td {
        border-bottom: none;
    }

    .table-clean tbody tr:hover {
        background: var(--slate-50);
    }

.cell-primary {
    font-weight: 700;
    color: var(--slate-900);
}

.cell-muted {
    color: var(--slate-500);
    font-size: 12.5px;
}

/* Progress (Projects page) */
.progress-thin {
    height: 6px;
    border-radius: 999px;
    background: var(--slate-100);
    overflow: hidden;
}

    .progress-thin .progress-bar {
        border-radius: 999px;
    }

.project-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

    .project-card h6 {
        font-weight: 800;
        color: var(--slate-900);
        margin-bottom: 4px;
    }

    .project-card .desc {
        font-size: 12.5px;
        color: var(--slate-500);
        margin-bottom: 16px;
        min-height: 34px;
    }

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--slate-500);
    margin-top: 8px;
}

/* ==========================================================================
   Add Member modal
   ========================================================================== */
.member-modal {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(11, 17, 32, 0.25);
}

    .member-modal .modal-header {
        background: linear-gradient(135deg, var(--orange-500), #ea580c);
        border: none;
        padding: 22px 24px;
        gap: 14px;
        align-items: center;
    }

.modal-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.member-modal .modal-title {
    font-weight: 800;
    font-size: 16.5px;
    color: #fff;
    margin: 0;
}

.member-modal .modal-header-text .modal-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 1px;
}

.member-modal .btn-close {
    filter: invert(1) brightness(2);
    opacity: 0.9;
    margin-left: auto;
}

.member-modal .modal-body {
    padding: 24px;
}

.member-modal .form-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: 6px;
}

.member-modal .form-control,
.member-modal .form-select {
    border-radius: 10px;
    border: 1px solid var(--slate-200);
    font-size: 13.5px;
    padding: 9px 13px;
    background: var(--slate-50);
}

    .member-modal .form-control:focus,
    .member-modal .form-select:focus {
        outline: none;
        border-color: var(--orange-500);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(242, 121, 12, 0.12);
    }

.member-modal .modal-footer {
    border-top: 1px solid var(--slate-100);
    padding: 16px 24px;
    gap: 10px;
}

.color-swatch-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

    .color-swatch:hover {
        transform: scale(1.08);
    }

    .color-swatch.selected {
        border-color: var(--ink-900);
        box-shadow: 0 0 0 3px rgba(11, 17, 32, 0.14);
    }

        .color-swatch.selected::after {
            content: "\f00c";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: rgba(0, 0, 0, 0.55);
            text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
        }

.avatar-preview-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--slate-100);
}

    .avatar-preview-row .avatar-lg {
        width: 54px;
        height: 54px;
        font-size: 18px;
        margin: 0;
    }

    .avatar-preview-row .preview-text {
        font-size: 12px;
        color: var(--slate-500);
        font-weight: 600;
    }

/* ==========================================================================
   Modern Dashboard Enhancements
   ========================================================================== */

/* ---- Stat cards with trend ---- */
.stat-card {
    position: relative;
}

.stat-trend {
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    background: #dcfce7;
    color: #22c55e;
}

    .stat-trend.up {
        background: #dcfce7;
        color: #22c55e;
    }

    .stat-trend.down {
        background: #fee2e2;
        color: #ef4444;
    }

    .stat-trend::before {
        content: "▲ ";
    }

    .stat-trend.down::before {
        content: "▼ ";
    }
/* Remove old trend if any */

/* ---- Recent list (borderless) ---- */
.recent-list {
    padding: 4px 0;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--slate-100);
    transition: background 0.15s;
}

    .recent-item:hover {
        background: var(--slate-50);
    }

    .recent-item:last-child {
        border-bottom: none;
    }

.status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 10px;
    border-radius: 30px;
    flex-shrink: 0;
}

    .status-badge.open {
        background: var(--orange-100);
        color: var(--orange-600);
    }

    .status-badge.assigned {
        background: var(--purple-100);
        color: var(--purple-600);
    }

    .status-badge.inprogress {
        background: var(--blue-100);
        color: var(--blue-600);
    }

    .status-badge.closed {
        background: var(--green-100);
        color: var(--green-600);
    }

.recent-info {
    flex: 1;
}

    .recent-info .ticket-id {
        font-weight: 700;
        color: var(--slate-900);
        font-size: 13.5px;
    }

    .recent-info .ticket-company {
        font-size: 12.5px;
        color: var(--slate-500);
    }

.ticket-time {
    font-size: 12.5px;
    color: var(--slate-500);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .ticket-time i {
        color: var(--orange-500);
    }

/* ---- Panel footer ---- */
.panel-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 22px;
    border-top: 1px solid var(--slate-100);
    font-size: 13px;
    color: var(--slate-500);
    background: var(--slate-50);
    border-radius: 0 0 var(--radius) var(--radius);
    flex-wrap: wrap;
    gap: 6px;
}

    .panel-footer i {
        margin-right: 4px;
    }

/* ---- Horizontal status bars ---- */
.status-hbars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hbar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hbar-label {
    width: 80px;
    font-weight: 600;
    color: var(--slate-700);
    font-size: 13px;
    flex-shrink: 0;
}

.hbar-track {
    flex: 1;
    height: 8px;
    background: var(--slate-100);
    border-radius: 999px;
    overflow: hidden;
}

.hbar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

    .hbar-fill.open {
        background: var(--orange-500);
    }

    .hbar-fill.assigned {
        background: var(--purple-600);
    }

    .hbar-fill.inprogress {
        background: var(--blue-600);
    }

    .hbar-fill.closed {
        background: var(--green-600);
    }

.hbar-count {
    font-weight: 700;
    color: var(--slate-900);
    font-size: 14px;
    width: 24px;
    text-align: right;
    flex-shrink: 0;
}

/* ---- Activity feed (compact) ---- */
.activity-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--slate-100);
    flex-wrap: wrap;
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

    .activity-dot.blue {
        background: #3b82f6;
    }

    .activity-dot.green {
        background: #22c55e;
    }

    .activity-dot.orange {
        background: var(--orange-500);
    }

    .activity-dot.purple {
        background: #8b5cf6;
    }

.activity-text {
    flex: 1;
    font-size: 13px;
    color: var(--slate-700);
}

    .activity-text strong {
        color: var(--slate-900);
        font-weight: 600;
    }

.activity-time {
    font-size: 12px;
    color: var(--slate-400);
    white-space: nowrap;
}

/* ---- Team chips ---- */
.team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--slate-50);
    padding: 6px 14px 6px 8px;
    border-radius: 30px;
    border: 1px solid var(--slate-200);
    font-size: 13px;
    color: var(--slate-700);
}

    .team-chip .role {
        font-size: 11px;
        font-weight: 600;
        color: var(--slate-400);
        margin-left: 2px;
    }

.avatar-xs {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

    .avatar-xs.purple {
        background: #8b5cf6;
    }

    .avatar-xs.green {
        background: #22c55e;
    }

    .avatar-xs.blue {
        background: #3b82f6;
    }

    .avatar-xs.orange {
        background: var(--orange-500);
    }

/* ---- Responsive tweaks ---- */
@media (max-width: 991px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .recent-item {
        flex-wrap: wrap;
        gap: 6px;
    }

    .status-badge {
        min-width: 70px;
    }

    .ticket-time {
        margin-left: auto;
    }
}

@media (max-width: 576px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: stretch;
    }

        .topbar-actions .btn {
            flex: 1;
            justify-content: center;
        }

    .panel-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hbar-label {
        width: 60px;
        font-size: 12px;
    }

    .hbar-count {
        width: 20px;
        font-size: 12px;
    }

    .activity-item {
        flex-wrap: wrap;
    }
}

/* ---- Modal overlay ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .modal-overlay.show {
        display: flex;
    }

.modal-card {
    background: #fff;
    border-radius: 28px;
    max-width: 540px;
    width: 100%;
    padding: 32px 36px 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

    .modal-card .close-btn {
        position: absolute;
        top: 16px;
        right: 20px;
        background: transparent;
        border: none;
        font-size: 24px;
        color: var(--slate-400);
        cursor: pointer;
        transition: color 0.15s;
    }

        .modal-card .close-btn:hover {
            color: var(--slate-900);
        }

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--purple-100);
    color: var(--purple-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.modal-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 6px;
}

.modal-card p {
    color: var(--slate-500);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 20px;
}

.modal-card .form-group {
    margin-bottom: 16px;
}

    .modal-card .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: var(--slate-900);
        margin-bottom: 4px;
    }

    .modal-card .form-group select {
        width: 100%;
        padding: 10px 14px;
        border-radius: 12px;
        border: 1px solid var(--slate-200);
        font-size: 14px;
        font-family: inherit;
        background: #fff;
        transition: border 0.2s;
        color: var(--slate-900);
    }

        .modal-card .form-group select:focus {
            outline: none;
            border-color: var(--orange-500);
            box-shadow: 0 0 0 3px rgba(242,121,12,0.12);
        }

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

    .modal-actions .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 20px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 14px;
        border: 1px solid var(--slate-200);
        cursor: pointer;
        transition: all 0.2s;
        background: #fff;
        color: var(--slate-700);
    }

    .modal-actions .btn-soft {
        background: var(--slate-50);
        border-color: var(--slate-200);
    }

        .modal-actions .btn-soft:hover {
            background: var(--slate-100);
        }

    .modal-actions .btn-primary {
        background: var(--orange-500);
        border-color: var(--orange-500);
        color: #fff;
    }

        .modal-actions .btn-primary:hover {
            background: var(--orange-600);
            border-color: var(--orange-600);
        }

/* ---- Kebab dropdown ---- */
.kebab-wrapper {
    position: relative;
    display: inline-block;
}

.kebab-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--slate-400);
    font-size: 16px;
    transition: all 0.15s;
    line-height: 1;
}

    .kebab-btn:hover {
        background: var(--slate-100);
        color: var(--slate-900);
    }

.kebab-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border: 1px solid var(--slate-200);
    min-width: 180px;
    padding: 6px 0;
    z-index: 100;
    display: none;
}

    .kebab-dropdown.show {
        display: block;
    }

    .kebab-dropdown button {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 18px;
        width: 100%;
        border: none;
        background: transparent;
        font-size: 14px;
        font-family: inherit;
        color: var(--slate-700);
        cursor: pointer;
        transition: background 0.1s;
        text-align: left;
    }

        .kebab-dropdown button:hover {
            background: var(--slate-50);
        }

        .kebab-dropdown button i {
            width: 18px;
            color: var(--slate-500);
            font-size: 14px;
        }

    .kebab-dropdown .divider {
        height: 1px;
        background: var(--slate-100);
        margin: 4px 12px;
    }

    .kebab-dropdown .danger {
        color: #ef4444;
    }

        .kebab-dropdown .danger i {
            color: #ef4444;
        }

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px;
}

.sidebar-footer-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    color: inherit;
    cursor: pointer;
    transition: background .15s ease;
}

    .sidebar-footer-trigger:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .sidebar-footer-trigger .user-info {
        text-align: left;
        line-height: 1.25;
    }

    .sidebar-footer-trigger .chevron-icon {
        margin-left: auto;
        font-size: 12px;
        opacity: 0.6;
        transition: transform .15s ease;
    }

    .sidebar-footer-trigger[aria-expanded="true"] .chevron-icon {
        transform: rotate(180deg);
    }

.user-menu {
    min-width: 260px;
    padding: 8px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 10px;
}

.user-menu-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.user-menu-role {
    font-size: 12.5px;
    color: #94a3b8;
}

.user-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

    .user-menu .dropdown-item:hover {
        background: #f4f7fb;
    }

    .user-menu .dropdown-item.text-danger:hover {
        background: #fdeeee;
    }

.dropdown-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #475569;
}

.user-menu .dropdown-item.text-danger .dropdown-item-icon {
    background: #fdeeee;
    color: #dc3545;
}
/*
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    position: sticky;
    top: 0;
    z-index: 20;
}

.notif-bell {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #f5f6fa;
    color: #444;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.notif-bell:hover { background: #ececf3; transform: scale(1.05); }

.notif-bell.shake { animation: bellShake 0.6s ease; }
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(18deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 1.6s infinite;
}
@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(255,71,87,0.55); }
    70% { box-shadow: 0 0 0 8px rgba(255,71,87,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,71,87,0); }
}

.notif-panel {
    width: 340px;
    padding: 0;
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(20,20,40,0.16);
    overflow: hidden;
    animation: notifDrop 0.22s ease;
}
@keyframes notifDrop {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    font-weight: 600;
    border-bottom: 1px solid #f0f1f5;
}
.notif-mark-all {
    background: none; border: none;
    color: #5b6cff; font-size: 12.5px; cursor: pointer;
}

.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 32px 16px; text-align: center; color: #9aa0ab; font-size: 13.5px; }

.notif-item {
    display: flex; gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f6fa;
    transition: background 0.15s ease;
    max-height: 200px;
}
.notif-item:hover { background: #f8f9fc; }
.notif-item.unread { background: #f2f5ff; }

.notif-item-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 50%;
    background: #eef1ff; color: #5b6cff;
    display: flex; align-items: center; justify-content: center;
}
.notif-item-title { font-size: 13.5px; font-weight: 600; color: #222; }
.notif-item-msg { font-size: 12.5px; color: #666; margin-top: 2px; }
.notif-item-time { font-size: 11px; color: #a2a7b3; margin-top: 4px; }

.notif-item.notif-enter { animation: notifSlideIn 0.3s ease; }
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateX(20px); max-height: 0; padding-top: 0; padding-bottom: 0; }
    to { opacity: 1; transform: translateX(0); max-height: 200px; }
}

.notif-panel-footer {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #5b6cff;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid #f0f1f5;
}*/


.notif-fab-wrapper {
    position: fixed;
    bottom: 50px; /* sits above the existing chat FAB — adjust to taste */
    right: 24px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.notif-fab {
    position: relative;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b6cff, #3f4fd6);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(59, 70, 200, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .notif-fab:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 22px rgba(59, 70, 200, 0.5);
    }

    .notif-fab.shake {
        animation: bellShake 0.6s ease;
    }

@keyframes bellShake {
    0%, 100% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(18deg);
    }

    30% {
        transform: rotate(-14deg);
    }

    45% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(4deg);
    }
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: badgePulse 1.6s infinite;
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255,71,87,0.55);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255,71,87,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255,71,87,0);
    }
}

.notif-panel {
    width: 340px;
    max-width: calc(100vw - 48px);
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    margin-bottom: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(20,20,40,0.22);
    overflow: hidden;
    transform-origin: bottom right;
    /* hidden by default */
    opacity: 0;
    transform: translateY(12px) scale(0.94);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

    .notif-panel.open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    font-weight: 600;
    border-bottom: 1px solid #f0f1f5;
}

.notif-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-mark-all {
    background: none;
    border: none;
    color: #5b6cff;
    font-size: 12.5px;
    cursor: pointer;
}

.notif-close {
    background: none;
    border: none;
    color: #9aa0ab;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
}

    .notif-close:hover {
        color: #555;
    }

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: #9aa0ab;
    font-size: 13.5px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f6fa;
    transition: background 0.15s ease;
}

    .notif-item:hover {
        background: #f8f9fc;
    }

    .notif-item.unread {
        background: #f2f5ff;
    }

.notif-item-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #eef1ff;
    color: #5b6cff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #222;
}

.notif-item-msg {
    font-size: 12.5px;
    color: #666;
    margin-top: 2px;
}

.notif-item-time {
    font-size: 11px;
    color: #a2a7b3;
    margin-top: 4px;
}

.notif-item.notif-enter {
    animation: notifSlideIn 0.3s ease;
}

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notif-panel-footer {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #5b6cff;
    font-weight: 600;
    text-decoration: none;
    border-top: 1px solid #f0f1f5;
}

.notif-fab-wrapper {
    pointer-events: none; 
}

.notif-fab {
    pointer-events: auto; 
}

.notif-panel.open {
    pointer-events: auto
}