/* ==========================================================================
   OmniDesk - CSS Style Sheet (Premium Glassmorphism Theme)
   ========================================================================== */

/* Design Tokens & Theme Setup */
:root {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --panel-bg: rgba(255, 255, 255, 0.97);
    --panel-border: rgba(15, 23, 42, 0.07);
    --panel-border-hover: rgba(15, 23, 42, 0.14);

    /* Sidebar specific */
    --sidebar-bg: #1e2d4a;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-text-active: #ffffff;
    --sidebar-active-bg: rgba(255,255,255,0.12);
    --sidebar-hover-bg: rgba(255,255,255,0.07);
    --sidebar-border: rgba(255,255,255,0.08);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Accent Palette */
    --color-primary: #2563eb;
    --color-primary-rgb: 37, 99, 235;
    --color-blue: #0284c7;
    --color-blue-rgb: 2, 132, 199;
    --color-purple: #7c3aed;
    --color-purple-rgb: 124, 58, 237;
    --color-green: #059669;
    --color-green-rgb: 5, 150, 105;
    --color-orange: #ea580c;
    --color-orange-rgb: 234, 88, 12;
    --color-red: #dc2626;
    --color-red-rgb: 220, 38, 38;
    --color-gray: #64748b;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.07), 0 1px 2px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 12px rgb(0 0 0 / 0.08), 0 2px 6px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 20px 40px rgb(0 0 0 / 0.10), 0 8px 16px rgb(0 0 0 / 0.05);
    --shadow-glow-primary: 0 0 16px rgba(37, 99, 235, 0.2);
    
    --font-heading: 'Outfit', 'Segoe UI', sans-serif;
    --font-body: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Ambient Glow */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    transition: all 4s ease-in-out;
}

.bg-glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, rgba(59, 130, 246, 0.05) 80%);
}

.bg-glow-2 {
    bottom: -150px;
    right: -150px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(56, 189, 248, 0.05) 80%);
}

/* Glassmorphism Panel Helper class */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-panel:hover {
    border-color: var(--panel-border-hover);
}

/* Layout Framework */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    width: 100%;
    max-width: 1540px;
    height: 94vh;
    margin: 3vh auto;
    gap: 24px;
    padding: 0 24px;
    z-index: 10;
}

/* Sidebar Styling - Dark Navy */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    height: 100%;
    background: var(--sidebar-bg) !important;
    border: none !important;
    border-radius: 16px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}

.sidebar-header {
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 34px;
    height: 34px;
    color: #60a5fa;
    filter: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.logo-text span {
    color: #60a5fa;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--sidebar-text);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    width: 100%;
}

.nav-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
    padding-left: 20px;
}

.nav-btn.active {
    background: var(--sidebar-active-bg);
    border-color: rgba(255,255,255,0.15);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.nav-btn:hover .nav-icon {
    transform: translateX(2px);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--sidebar-border);
}

.copyright {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

/* Content Area */
.content-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    overflow: hidden;
}

/* Header styling */
.header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
}

.welcome-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* User switcher select */
.user-role-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switcher-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.role-select, .filter-select, .action-select, select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    padding: 10px 36px 10px 16px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.role-select:focus, .filter-select:focus, .action-select:focus, select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
    background: rgba(15, 23, 42, 0.08);
}

.select-arrow {
    position: absolute;
    right: 12px;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Alert banners */
.alert-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.alert-banner.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.alert-banner.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.close-alert {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

/* Views & Navigation logic */
.content-view {
    display: none;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.content-view.active-view {
    display: flex;
    animation: fadeIn var(--transition-normal);
}

/* View: Dashboard Elements */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Glowing Border effects */
.border-glow-blue::before, .border-glow-purple::before, .border-glow-orange::before, .border-glow-red::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.border-glow-blue::before { background: var(--color-blue); }
.border-glow-purple::before { background: var(--color-purple); }
.border-glow-orange::before { background: var(--color-orange); }
.border-glow-red::before { background: var(--color-red); }

.stat-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.bg-blue { background: rgba(59, 130, 246, 0.15); color: var(--color-blue); }
.bg-purple { background: rgba(168, 85, 247, 0.15); color: var(--color-purple); }
.bg-orange { background: rgba(245, 158, 11, 0.15); color: var(--color-orange); }
.bg-red { background: rgba(239, 68, 68, 0.15); color: var(--color-red); }
.bg-green { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }

.stat-icon {
    width: 24px;
    height: 24px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-details-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

.dashboard-chart-card, .dashboard-feed-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Priority Distribution Chart */
.priority-chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 10px;
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.chart-bar-outer {
    height: 8px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-count {
    font-size: 11px;
    align-self: flex-end;
    font-weight: 600;
    margin-top: -2px;
}

/* Feed layout */
.recent-tickets-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
}

.feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.feed-item:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
    transform: translateX(4px);
}

.feed-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-item-title {
    font-weight: 600;
    font-size: 14px;
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bullet-separator {
    color: var(--text-muted);
}

.feed-status-badge {
    align-self: center;
}

/* View: Tickets Filter Bar */
.tickets-filter-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    align-items: center;
    flex-wrap: wrap;
}

.search-field-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

#ticket-search {
    width: 100%;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    padding: 11px 16px 11px 44px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

#ticket-search:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.08);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Tickets Grid List */
.tickets-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.ticket-card {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 180px 120px 140px;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
    background: rgba(15, 23, 42, 0.08);
}

.ticket-info-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* allows text truncation */
}

.ticket-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticket-list-title {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-list-desc {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-meta-col {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-item-bold {
    font-weight: 600;
    color: var(--text-primary);
}

/* Badges & Color indicators */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

/* Status Colors - solid for light theme */
.badge.status-new {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}
.badge.status-in_progress {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #ffffff;
}
.badge.status-on_hold {
    background: #d97706;
    border-color: #b45309;
    color: #ffffff;
}
.badge.status-resolved {
    background: #059669;
    border-color: #047857;
    color: #ffffff;
}
.badge.status-closed {
    background: #64748b;
    border-color: #475569;
    color: #ffffff;
}

/* Priority Colors - solid for light theme */
.badge.priority-low {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}
.badge.priority-medium {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.badge.priority-high {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #78350f;
}
.badge.priority-critical {
    background: #dc2626;
    border-color: #b91c1c;
    color: #ffffff;
    animation: flashCritical 2s infinite alternate;
}

/* Category Tags */
.ticket-category-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* View: Create Ticket Form */
.form-container {
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 28px;
}

.form-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.ticket-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-row {
    display: flex;
    gap: 20px;
}

.flex-1 {
    flex: 1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.required {
    color: var(--color-red);
}

input[type="text"], textarea {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
}

input[type="text"]:focus, textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.08);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.15);
}

.btn-icon-only {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
}

.btn-icon-only span {
    display: none; /* Icon representation only */
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
}

.text-link-btn {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: color var(--transition-fast);
}

.text-link-btn:hover {
    color: #a78bfa;
}

/* View: Ticket Details Layout */
.detail-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    padding-bottom: 40px;
}

.detail-main-column, .detail-control-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Ticket Details Main Card */
.ticket-detail-card {
    padding: 28px;
}

.ticket-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ticket-id-tag {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

.ticket-detail-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.ticket-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-stub {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-blue) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.author-meta {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    font-size: 14px;
}

.created-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.divider {
    border: none;
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
    margin: 20px 0;
}

.ticket-detail-description {
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Comments Section & Timeline */
.comments-section-container {
    padding: 24px;
}

.section-title, .control-card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
}

.comments-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    padding-left: 20px;
}

.comments-timeline::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 4px;
    width: 2px;
    background: rgba(15, 23, 42, 0.05);
}

.timeline-entry {
    position: relative;
}

/* Timeline bubble dots */
.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-primary);
}

/* Type variations for logs vs. comments */
.timeline-entry.comment .timeline-dot {
    background: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary);
}

.timeline-entry.log .timeline-dot {
    background: var(--color-blue);
}

.timeline-entry-content {
    background: rgba(15, 23, 42, 0.015);
    border: 1px solid rgba(15, 23, 42, 0.03);
    border-radius: 12px;
    padding: 14px 18px;
}

/* Log specific card layout (narrower, distinct background) */
.timeline-entry.log .timeline-entry-content {
    background: rgba(59, 130, 246, 0.03);
    border-color: rgba(59, 130, 246, 0.08);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.entry-author {
    font-size: 12px;
    font-weight: 700;
}

.entry-date {
    font-size: 10px;
    color: var(--text-muted);
}

.entry-body {
    font-size: 13.5px;
}

.timeline-entry.log .entry-body {
    color: var(--text-secondary);
    font-style: italic;
}

/* Add Comment textarea */
.comment-input-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.comment-input-area textarea {
    resize: vertical;
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-tip {
    font-size: 11px;
    color: var(--text-muted);
}

/* Ticket Control Card */
.control-card {
    padding: 24px;
}

.metadata-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.meta-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-val {
    font-weight: 600;
}

/* Agent/Admin Actions */
.agent-actions-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-section-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
}

.action-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.action-select, .action-field .select-wrapper select {
    width: 100%;
}

/* Activity Mini Log */
.activity-mini-log {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 240px;
    overflow-y: auto;
}

.activity-mini-log-item {
    font-size: 11.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}

.activity-mini-log-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-log-desc {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.activity-log-time {
    color: var(--text-muted);
    font-size: 10px;
}

/* Empty States & Placeholders */
.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 14px;
}

/* Keyframes & Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flashCritical {
    0% { border-color: rgba(239, 68, 68, 0.35); box-shadow: 0 0 10px rgba(239, 68, 68, 0.15); }
    100% { border-color: rgba(239, 68, 68, 0.8); box-shadow: 0 0 18px rgba(239, 68, 68, 0.4); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.15);
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 240px 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-card {
        grid-template-columns: 1fr 150px 100px;
    }
    
    .ticket-card .ticket-meta-col:last-child {
        display: none; /* hide assignee to fit screen */
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        height: auto;
        margin: 0;
        padding: 16px;
    }
    
    .sidebar-panel {
        height: auto;
        margin-bottom: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
    
    .header-panel {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .user-role-switcher {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tickets-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group-row {
        flex-direction: column;
    }
}

/* ==========================================================================
   New Notification Center & Excel Export Styles
   ========================================================================== */

/* Header Actions wrapper */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Notification Container and Button */
.notification-dropdown-container {
    position: relative;
}

.btn-notification {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.btn-notification:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.15);
    transform: translateY(-1px);
}

.bell-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.btn-notification:hover .bell-icon {
    color: var(--text-primary);
}

/* Red indicator dot */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-red);
    color: white;
    font-size: 9px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: pulseGlow 2s infinite;
}

/* Notification Dropdown Panel */
.notification-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    max-height: 400px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-dropdown.hidden {
    display: none;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(18, 19, 36, 0.8);
}

.notif-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
}

.notif-read-all-btn {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
}

.notif-read-all-btn:hover {
    color: #a78bfa;
}

.notif-list {
    overflow-y: auto;
    background: rgba(10, 11, 22, 0.9);
}

.notif-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    font-size: 12.5px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notif-item:hover {
    background: rgba(15, 23, 42, 0.03);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.unread {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--color-primary);
    padding-left: 15px; /* offset border */
}

.notif-item-msg {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notif-item-time {
    color: var(--text-muted);
    font-size: 10px;
}

/* Excel Export Button Adjustments */
.btn-export {
    margin-left: auto;
}

@keyframes pulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.08); box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
}

@media (max-width: 900px) {
    .btn-export {
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }
}

/* User Management Layout (Admin Only) - Table on top, form below */
.admin-users-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-user-form-card {
    max-width: 100% !important;
    margin: 0 !important;
}

.admin-create-user-form .admin-user-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

/* Keep old class for compatibility */
.user-management-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.users-list-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 400px;
}

.users-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

.users-table th {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    font-family: var(--font-heading);
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
}

.users-table tr:hover {
    background: rgba(15, 23, 42, 0.02);
}

.w-100 {
    width: 100%;
}

@media (max-width: 1000px) {
    .user-management-grid {
        grid-template-columns: 1fr;
    }
}

/* Administration Console Tab System */
.admin-tab-bar {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 24px;
    border-radius: 12px;
}

.admin-tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-heading);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.03);
}

.admin-tab-btn.active {
    color: var(--color-primary);
    background: rgba(139, 92, 246, 0.12);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.admin-panel-content {
    display: block;
}

.admin-panel-content.hidden {
    display: none;
}

/* SLA Configuration Forms */
.sla-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sla-priority-row {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sla-row-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sla-row-desc {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.sla-row-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* SLA timing badges in ticket detail and list */
.sla-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.sla-badge-row .badge {
    font-size: 11px;
}

.sla-timer-text {
    font-size: 12px;
    font-family: var(--font-body);
    font-weight: 500;
}

.sla-timer-text.urgent {
    color: var(--color-danger);
    font-weight: 700;
    animation: textPulse 1.5s infinite;
}

@keyframes textPulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

}

@media (max-width: 800px) {
    .sla-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Login Screen
   ========================================================================== */

.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: var(--bg-primary);
    animation: fadeIn 0.4s ease;
}

.login-screen.hidden {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--panel-border);
    animation: slideDown 0.4s cubic-bezier(0.4,0,0.2,1);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.login-logo-icon {
    width: 36px;
    height: 36px;
    color: var(--color-primary);
}

.login-logo-text {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo-text span {
    color: var(--color-primary);
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 14px;
    font-size: 15px;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.login-demo-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--panel-border);
}

/* App container hidden state */
.app-container.hidden {
    display: none !important;
}

/* ==========================================================================
   Sidebar User Info & Logout Button
   ========================================================================== */

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    margin-bottom: 8px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 10px;
}

.btn-logout:hover {
    background: rgba(220,38,38,0.15);
    border-color: rgba(220,38,38,0.3);
    color: #fca5a5;
}

/* ==========================================================================
   Header User Display
   ========================================================================== */

.logged-in-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
