/* ============================================================================
   NEXUSDESK IT - CLEAR & MODERN DESIGN SYSTEM (DARK & LIGHT MODE + ANIMATIONS)
   ============================================================================ */

:root,
[data-theme="light"] {
    --bg-body: #f4f7fb;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f8fafc;
    --bg-elevated: rgba(255, 255, 255, 0.86);
    --bg-sidebar: #ffffff;
    --bg-input: #f8fafc;
    --text-main: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.10);
    --accent: #0ea5e9;
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.13);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --purple: #8b5cf6;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 28px -6px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 42px -10px rgba(79, 70, 229, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --sidebar-width: 268px;
}

[data-theme="dark"] {
    --bg-body: #090e1a;
    --bg-surface: #111827;
    --bg-surface-alt: #182235;
    --bg-elevated: rgba(17, 24, 39, 0.85);
    --bg-sidebar: #0d1424;
    --bg-input: #0f172a;
    --text-main: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --border-strong: #334155;

    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.16);
    --accent: #38bdf8;
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.16);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 12px 32px -6px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 22px 48px -10px rgba(0, 0, 0, 0.60);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14.5px;
    transition: background-color 0.32s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

code {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.86em;
    background: var(--primary-soft);
    color: var(--primary);
    padding: 0.15rem 0.42rem;
    border-radius: 6px;
}

/* ============================================================================
   KEYFRAME ANIMATIONS & MICRO-INTERACTIONS
   ============================================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(24px, -22px) scale(1.07); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    50%      { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.35); opacity: 0.65; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.animate-fade-up {
    animation: fadeUp 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-scale-in {
    animation: scaleIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.11s; }
.stagger-3 { animation-delay: 0.17s; }
.stagger-4 { animation-delay: 0.23s; }
.stagger-5 { animation-delay: 0.29s; }
.stagger-6 { animation-delay: 0.35s; }

.pulse-alert {
    animation: pulseGlow 1.9s infinite;
}

/* Ambient Decorative Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(85px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.42;
    animation: floatOrb 11s ease-in-out infinite;
}
.orb-1 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -90px;
    left: -80px;
}
.orb-2 {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, #0ea5e9, transparent 70%);
    bottom: -80px;
    right: -60px;
    animation-delay: -5.5s;
}

/* ============================================================================
   LAYOUT: SIDEBAR + TOPBAR + MAIN WORKSPACE
   ============================================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-brand {
    padding: 1.35rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 8px 18px -4px rgba(79, 70, 229, 0.45);
    flex-shrink: 0;
}

.brand-text h2 {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.1rem 0.9rem;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.65rem 0.75rem 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.78rem;
    padding: 0.68rem 0.85rem;
    border-radius: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.22rem;
    position: relative;
    transition: all 0.22s ease;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.98rem;
    transition: transform 0.22s ease;
}

.nav-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateX(3px);
}

.nav-link:hover i {
    transform: scale(1.12);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    box-shadow: 0 8px 18px -5px rgba(79, 70, 229, 0.45);
}

.nav-badge {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 99px;
    background: var(--danger-soft);
    color: var(--danger);
}

.nav-link.active .nav-badge {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 12px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.sidebar-user-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.sidebar-user-meta {
    flex: 1;
    min-width: 0;
}
.sidebar-user-meta strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-meta small {
    font-size: 0.73rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Main Content Area */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 68px;
    background: var(--bg-elevated);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-toggle {
    display: none;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.page-heading h1 {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.page-heading p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Toggle Button with Animated Icon */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-xs);
}

.theme-toggle-btn:hover {
    transform: rotate(18deg) scale(1.07);
    border-color: var(--primary);
    color: var(--primary);
}

.content-container {
    padding: 1.75rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* ============================================================================
   CARDS, STAT WIDGETS, & SURFACES
   ============================================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.26s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.glass-card {
    background: var(--bg-elevated);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.card-title i {
    color: var(--primary);
}

/* Grid Utilities */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
    margin-bottom: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.grid-main-aside {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.35rem;
    align-items: start;
}

/* Stat Card */
.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--stat-color, var(--primary)), transparent);
    opacity: 0.85;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(-5deg);
}

.stat-label {
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-main);
}

.stat-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============================================================================
   AVATARS & AVAILABILITY STATUS DOTS
   ============================================================================ */
.avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.avatar-img, .avatar-fallback {
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.88rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.35rem; }
.avatar-xl { width: 92px; height: 92px; font-size: 1.85rem; border: 3px solid var(--bg-surface); box-shadow: var(--shadow-md); }

.presence-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
    position: absolute;
    bottom: 1px;
    right: 1px;
}
.presence-online { background: #10b981; animation: pulseDot 2.2s infinite; }
.presence-busy   { background: #f59e0b; }
.presence-offline{ background: #94a3b8; }

/* ============================================================================
   BADGES: STATUS, PRIORITY, SLA, & KPI GRADES
   ============================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    padding: 0.24rem 0.65rem;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-critical { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239,68,68,0.28); }
.badge-high     { background: rgba(249,115,22,0.14); color: #f97316; border: 1px solid rgba(249,115,22,0.26); }
.badge-medium   { background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(99,102,241,0.22); }
.badge-low      { background: rgba(100,116,139,0.13); color: var(--text-muted); }

.status-open     { background: rgba(14,165,233,0.14); color: var(--accent); }
.status-progress { background: var(--warning-soft); color: var(--warning); }
.status-waiting  { background: rgba(139,92,246,0.15); color: var(--purple); }
.status-resolved { background: var(--success-soft); color: var(--success); }
.status-closed   { background: rgba(100,116,139,0.16); color: var(--text-muted); }

.sla-met      { background: var(--success-soft); color: var(--success); }
.sla-ontrack  { background: rgba(14,165,233,0.12); color: var(--accent); }
.sla-warning  { background: var(--warning-soft); color: var(--warning); }
.sla-breached { background: var(--danger-soft); color: var(--danger); }

.grade-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding: 0 0.6rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.82rem;
    color: #fff;
}
.grade-aplus { background: linear-gradient(135deg, #10b981, #059669); }
.grade-a     { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.grade-b     { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.grade-c     { background: linear-gradient(135deg, #f59e0b, #d97706); }
.grade-d     { background: linear-gradient(135deg, #ef4444, #dc2626); }

.pill-badge {
    display: inline-block;
    padding: 0.22rem 0.7rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary-soft);
    color: var(--primary);
    margin-bottom: 0.4rem;
}

/* ============================================================================
   BUTTONS & FORMS
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.58rem 1.08rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    box-shadow: 0 6px 16px -4px rgba(79, 70, 229, 0.45);
}
.btn-primary:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -4px rgba(79, 70, 229, 0.58);
}

.btn-secondary, .btn-outline {
    background: var(--bg-surface);
    border-color: var(--border-strong);
    color: var(--text-main);
}
.btn-secondary:hover, .btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}
.btn-success:hover { color: #fff; transform: translateY(-2px); }

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(239,68,68,0.25);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.78rem; border-radius: 8px; }
.btn-lg { padding: 0.78rem 1.45rem; font-size: 0.95rem; border-radius: 12px; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.81rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.89rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px var(--primary-soft);
    background: var(--bg-surface);
}

textarea.form-control {
    resize: vertical;
    min-height: 105px;
}

.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.form-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface-alt);
    cursor: pointer;
}
.checkbox-card input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
}

/* ============================================================================
   TABLES & PROGRESS BARS
   ============================================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 0.82rem 1rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border);
}

.modern-table td {
    padding: 0.92rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.88rem;
}

.modern-table tbody tr {
    transition: background-color 0.18s ease;
}

.modern-table tbody tr:hover {
    background-color: var(--bg-surface-alt);
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Animated Progress Bar */
.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-surface-alt);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================================
   KPI CIRCULAR GAUGE & TIMELINE CONVERSATION
   ============================================================================ */
.kpi-ring-box {
    position: relative;
    width: 146px;
    height: 146px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-ring-svg {
    transform: rotate(-90deg);
    width: 146px;
    height: 146px;
}
.kpi-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 11;
}
.kpi-ring-value {
    fill: none;
    stroke-width: 11;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.kpi-ring-center {
    position: absolute;
    text-align: center;
}
.kpi-ring-center strong {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}
.kpi-ring-center span {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Ticket Replies Thread */
.reply-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply-item {
    display: flex;
    gap: 0.9rem;
    padding: 1.1rem;
    border-radius: 14px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    animation: fadeUp 0.35s ease both;
}

.reply-item.reply-staff {
    border-left: 3.5px solid var(--primary);
}

.reply-item.reply-internal {
    background: var(--warning-soft);
    border-color: rgba(245, 158, 11, 0.35);
    border-left: 3.5px solid var(--warning);
}

.reply-body { flex: 1; min-width: 0; }
.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

/* Activity Audit Timeline */
.audit-timeline {
    list-style: none;
    position: relative;
    padding-left: 1.35rem;
}
.audit-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-strong);
}
.audit-timeline li {
    position: relative;
    padding-bottom: 0.95rem;
    font-size: 0.82rem;
}
.audit-timeline li::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: 5px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-surface);
}

/* Star Rating Interactive */
.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.35rem;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 1.75rem;
    color: var(--border-strong);
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #fbbf24;
    transform: scale(1.12);
}

/* ============================================================================
   AUTH & INSTALLER PAGES
   ============================================================================ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.auth-split {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    max-width: 1020px;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.auth-showcase {
    background: linear-gradient(145deg, #1e1b4b 0%, #312e81 48%, #0f172a 100%);
    color: #fff;
    padding: 2.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-showcase h2 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 1rem 0 0.75rem;
}

.auth-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}
.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.88);
}
.auth-feature-list li i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
}

.auth-form-pane {
    padding: 2.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.demo-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.65rem;
}
.demo-btn {
    padding: 0.48rem 0.5rem;
    border-radius: 9px;
    border: 1px dashed var(--border-strong);
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.demo-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
}

.installer-wrapper {
    position: relative;
    z-index: 2;
    max-width: 780px;
    width: 100%;
}
.installer-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}
.brand-logo-lg {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}
.cred-summary {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    margin-top: 1rem;
}

/* Alerts & Toast */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    font-size: 0.87rem;
    animation: slideInRight 0.35s ease both;
}
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.alert-info    { background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(99,102,241,0.3); }

/* Profile Hero Cover */
.profile-banner {
    height: 138px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(125deg, #4f46e5 0%, #0ea5e9 55%, #10b981 100%);
    position: relative;
    margin: -1.4rem -1.4rem 0 -1.4rem;
}
.profile-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: -42px;
    padding: 0 0.5rem;
    position: relative;
}
.skill-tag {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-strong);
    font-size: 0.76rem;
    font-weight: 600;
    margin: 0.2rem 0.2rem 0 0;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 14, 26, 0.62);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open {
    display: flex;
}
.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 580px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
    max-height: 90vh;
    overflow-y: auto;
}

/* Helpers */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.81rem; }
.text-xs { font-size: 0.73rem; }
.fw-bold { font-weight: 700; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: 0.6rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Print Friendly for KPI Report */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-area { margin-left: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-main-aside { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-area { margin-left: 0; }
    .mobile-toggle { display: inline-flex; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .grid-2, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .stats-grid, .grid-3 { grid-template-columns: 1fr; }
    .content-container { padding: 1.1rem; }
}
