/* =====================================================
   IT HelpDesk - Modern UI Styles (Bootstrap 5 Base)
   Inspired by Tailwind/shadcn design system
   ===================================================== */

/* CSS Custom Properties (Design Tokens) */
:root {
    /* Primary Blue Theme */
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-foreground: #ffffff;
    --primary-10: rgba(29, 78, 216, 0.1);
    --primary-20: rgba(29, 78, 216, 0.2);

    /* Neutral Colors */
    --background: #ffffff;
    --foreground: #1f2937;
    --card: #ffffff;
    --card-foreground: #1f2937;
    --muted: #f3f4f6;
    --muted-foreground: #6b7280;
    --border: #e5e7eb;
    --input: #e5e7eb;

    /* Status Colors */
    --destructive: #dc2626;
    --destructive-10: rgba(220, 38, 38, 0.1);
    --success: #16a34a;
    --success-10: rgba(22, 163, 74, 0.1);
    --warning: #d97706;
    --warning-10: rgba(217, 119, 6, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-elegant: 0 2px 8px -2px rgba(0, 0, 0, 0.08), 0 4px 16px -4px rgba(0, 0, 0, 0.06);
    --shadow-elegant-lg: 0 4px 16px -4px rgba(0, 0, 0, 0.1), 0 8px 32px -8px rgba(0, 0, 0, 0.08);

    /* Radius */
    --radius: 0.65rem;
    --radius-sm: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Sidebar */
    --sidebar-width: 220px;
    --sidebar-width-collapsed: 64px;
    --sidebar-bg: #053a62;
    --sidebar-fg: #ffffff;
    --sidebar-muted: #d0d4dd;
    --sidebar-accent: #064a7d;
    --sidebar-border: #064a7d;
}

/* Base Styles */
* {
    border-color: var(--border);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--muted);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   CSS Fix - Prevent navbar flash on page load
   ===================================================== */
/* Disable transitions on page load to prevent navbar flashing */
.no-transition, .no-transition * {
    transition: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
}

/* During page load with no-transition, force sidebar overflow hidden */
body.no-transition #sidebar {
    overflow-x: hidden !important;
}

/* Initial sidebar collapsed state applied before DOM is ready */
html.sidebar-collapsed-initial body {
    --sidebar-width: 80px;
}

html.sidebar-collapsed-initial #sidebar {
    width: 80px;
}

html.sidebar-collapsed-initial #sidebar .sidebar-text {
    opacity: 0;
    visibility: hidden;
}

html.sidebar-collapsed-initial #sidebar .sidebar-brand-text {
    opacity: 0;
    visibility: hidden;
}

/* =====================================================
   Floating Logo
   ===================================================== */
.floating-logo {
    position: fixed;
    bottom: -20px;
    right: 24px;
    width: 140px;
    height: 140px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 0;
    pointer-events: none;
}

.floating-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
}

/* Hide on mobile to avoid interference */
@media (max-width: 768px) {
    .floating-logo {
        display: none;
    }
}

/* =====================================================
   Layout - Sidebar & Main Content
   ===================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-x: visible; /* Allow dropdown to extend outside sidebar */
    overflow-y: auto; /* Allow vertical scrolling if needed */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari, and newer Edge */
#sidebar::-webkit-scrollbar {
    display: none;
}

/* Apply initial collapsed state immediately based on class set in head */
html.sidebar-initial-collapsed #sidebar {
    width: var(--sidebar-width-collapsed);
    overflow-x: hidden; /* Force hidden during initial load */
}

html.sidebar-initial-collapsed body {
    --sidebar-width: 80px;
}

html.sidebar-initial-collapsed .sidebar-text {
    opacity: 0;
    visibility: hidden;
    width: 0; /* Completely collapse text width */
    overflow: hidden;
}

html.sidebar-initial-collapsed .sidebar-brand-text {
    opacity: 0;
    visibility: hidden;
    width: 0; /* Completely collapse text width */
    overflow: hidden;
}

html.sidebar-initial-collapsed .sidebar-user-info {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

html.sidebar-initial-collapsed .sidebar-section-title {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

/* Collapsed Sidebar State */
#sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
    overflow-x: visible; /* Allow dropdown to extend beyond collapsed sidebar */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

#sidebar.collapsed::-webkit-scrollbar {
    display: none;
}

#sidebar.collapsed .sidebar-header {
    padding: 0;
}

#sidebar.collapsed .sidebar-text {
    display: none;
}

#sidebar.collapsed .sidebar-brand-text {
    display: none;
}

/* Toggle button moves and icon rotates when sidebar is collapsed */
body.sidebar-collapsed .sidebar-toggle-btn {
    left: var(--sidebar-width-collapsed);
}

body.sidebar-collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

#sidebar.collapsed .sidebar-section-title {
    display: none;
}

#sidebar.collapsed .sidebar-user-info {
    display: none;
}

#sidebar.collapsed .sidebar-nav {
    padding: 3rem 0.5rem 0.5rem 0.5rem;
}

#sidebar.collapsed .sidebar-menu-link {
    justify-content: center;
    padding: 0.5rem;
    gap: 0;
}

#sidebar.collapsed .sidebar-footer {
    padding: 0.5rem;
}

#sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 0.5rem;
    gap: 0;
}

/* Sidebar Header */
#sidebar .sidebar-header {
    height: 96px;
    min-height: 96px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-fg);
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.025em;
    width: 100%;
    position: relative;
}

.sidebar-brand img {
    height: 32px;
    margin-right: 0.5rem;
}

/* Sidebar Header Toggle Button */
.sidebar-header-toggle {
    position: absolute;
    right: 0;
    background: transparent;
    border: none;
    color: var(--sidebar-fg);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
}

.sidebar-header-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-fg);
}

.sidebar-header-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

/* When sidebar is collapsed, center the toggle button and adjust brand layout */
#sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

#sidebar.collapsed .sidebar-header-toggle {
    position: static;
    margin: 0;
}

.sidebar-header-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-fg);
}

.sidebar-header-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

/* When sidebar is collapsed, center the toggle button and adjust brand layout */
#sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

#sidebar.collapsed .sidebar-header-toggle {
    margin: 0;
}

.sidebar-brand-text,
.sidebar-text {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-brand-text {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 3rem 0.5rem 0.5rem 0.5rem;
    overflow-x: visible; /* Allow dropdown to extend outside navigation area */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin-bottom: 0.125rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap; /* Prevent text wrapping that could cause overflow */
    overflow: hidden; /* Hide any overflow text */
}

.sidebar-menu-link:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-fg);
}

.sidebar-menu-link.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.sidebar-menu-link.active i {
    color: var(--primary-foreground);
}

.sidebar-menu-link i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
    text-decoration: underline;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--sidebar-border);
    overflow: visible; /* Allow dropdown to extend outside footer area */
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-user:hover {
    background: var(--sidebar-accent);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: var(--sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    position: relative;
    /* z-index removed to allow modals to properly stack above backdrop */
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-width-collapsed);
}

.content-wrapper {
    flex: 1;
    padding: 1.5rem;
    padding-left: 2.5rem; /* Extra left padding for toggle button clearance */
}

/* =====================================================
   Cards (shadcn style)
   ===================================================== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-elegant);
    transition: box-shadow 0.2s ease;
}

.card-hover:hover {
    box-shadow: var(--shadow-elegant-lg);
}

.card-header {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border-bottom: none;
    background: transparent;
    border-top-left-radius: calc(var(--radius-xl) - 1px) !important;
    border-top-right-radius: calc(var(--radius-xl) - 1px) !important;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
    background: transparent;
    border-top: none;
}

/* Stats Cards */
.stat-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elegant-lg);
}

.stat-card .card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
}

.stat-card .stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--muted-foreground);
}

.stat-card .stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.stat-card .stat-sublabel {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

/* Colored stat values */
.stat-value-primary { color: var(--primary); }
.stat-value-success { color: var(--success); }
.stat-value-warning { color: var(--warning); }
.stat-value-danger { color: var(--destructive); }

/* =====================================================
   Buttons
   ===================================================== */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--primary-foreground);
}

.btn-outline-secondary {
    background: #ffffff;
    border-color: var(--border);
    color: var(--foreground);
}

.btn-outline-secondary:hover {
    background: var(--muted);
    color: var(--foreground);
    border-color: var(--border);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
}

.btn-ghost:hover {
    background: var(--muted);
    color: var(--foreground);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

/* =====================================================
   Form Controls
   ===================================================== */
.form-control, .form-select {
    border-radius: var(--radius);
    border: 1px solid var(--input);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--background);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-20);
    outline: none;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.375rem;
}

.form-text {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Search input with icon */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    pointer-events: none;
}

.search-input-wrapper .form-control {
    padding-left: 2.5rem;
}

/* =====================================================
   Badges (Priority & Status)
   ===================================================== */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid transparent;
}

/* Priority Badges */
.badge-critical {
    background: var(--destructive-10);
    color: var(--destructive);
    border-color: rgba(220, 38, 38, 0.2);
}

.badge-high {
    background: rgba(249, 115, 22, 0.1);
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.2);
}

.badge-medium {
    background: rgba(234, 179, 8, 0.1);
    color: #a16207;
    border-color: rgba(234, 179, 8, 0.2);
}

.badge-low {
    background: var(--success-10);
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.2);
}

/* Status Badges */
.badge-new {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.2);
}

.badge-open, .badge-in-progress {
    background: rgba(147, 51, 234, 0.1);
    color: #7c3aed;
    border-color: rgba(147, 51, 234, 0.2);
}

.badge-pending, .badge-on-hold, .badge-waiting {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-resolved {
    background: var(--success-10);
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.2);
}

.badge-closed {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
    border-color: rgba(107, 114, 128, 0.2);
}

/* Overdue badge */
.badge-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* =====================================================
   Tables
   ===================================================== */
.table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
    border-top: none;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table-hover tbody tr:hover {
    background: var(--muted);
}

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

/* =====================================================
   Ticket List Items
   ===================================================== */
.ticket-item {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.ticket-item:hover {
    background: var(--muted);
    color: inherit;
}

.ticket-item:last-child {
    border-bottom: none;
}

.ticket-number {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

/* Ticket number link in list - inherits styling, no underline */
a.ticket-number-link {
    color: inherit;
    text-decoration: none;
}
a.ticket-number-link:hover {
    text-decoration: underline;
}

/* Linked ticket numbers - styled as blue hyperlinks */
.linked-ticket-number {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8125rem;
    color: #0d6efd;
    text-decoration: underline;
}

.linked-ticket-number:hover {
    color: #0a58ca;
}

.ticket-title {
    font-weight: 600;
    color: var(--foreground);
    margin: 0.25rem 0;
    font-size: 1rem;
}

.ticket-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.ticket-meta {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

/* =====================================================
   Priority/Status Breakdown List
   ===================================================== */
.breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.breakdown-item:hover {
    background: var(--muted);
    color: inherit;
}

.breakdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
}

/* =====================================================
   Empty State
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state > i {
    font-size: 3rem;
    color: var(--muted-foreground);
    opacity: 0.5;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
}

/* =====================================================
   Back Button
   ===================================================== */
.back-button-section {
    margin-bottom: 1.5rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--secondary);
    color: var(--secondary-foreground);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.back-button:hover {
    background: var(--secondary-hover);
    color: var(--secondary-foreground);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.back-button i {
    font-size: 0.875rem;
}

/* =====================================================
   Page Headers
   ===================================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.page-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 0.5rem;
}

/* =====================================================
   Comments
   ===================================================== */
.comment-item {
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--background);
    margin-bottom: 1rem;
}

.comment-item.internal {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 500;
    font-size: 0.875rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.comment-content {
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.badge-internal {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
    font-size: 0.6875rem;
}

/* =====================================================
   Activity Feed
   ===================================================== */
.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon i {
    color: var(--primary);
    font-size: 1rem;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

/* =====================================================
   Alerts
   ===================================================== */
.alert-info {
    --bs-alert-color: #4d3a02;
    --bs-alert-bg: #fff3cd;
    --bs-alert-border-color: #dbc071;
    --bs-alert-link-color: #4d3a02;
}

.alert-overdue {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-lg);
}

.alert-overdue .card-title {
    color: var(--destructive);
}

/* =====================================================
   Login Page
   ===================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    height: 48px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* =====================================================
   Dropdown Menus
   ===================================================== */
.dropdown-menu {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 0.25rem;
    z-index: 1050;
}

/* Sidebar dropdown needs higher z-index to appear above main content */
#sidebar .dropdown-menu {
    z-index: 1300 !important; /* Increased to ensure it's above everything */
}

/* Sidebar footer needs proper z-index for dropdown */
#sidebar .sidebar-footer {
    position: relative;
    z-index: 1100;
}

#sidebar .sidebar-footer .dropdown {
    position: static;
}

#sidebar .sidebar-footer .dropdown-menu {
    position: fixed !important;
    z-index: 1300 !important;
}

/* Force dropdown positioning for collapsed sidebar */
#sidebar.collapsed .dropdown-menu {
    position: fixed !important;
    left: 90px !important; /* Position to the right of collapsed sidebar */
    transform: translateX(0) !important;
    min-width: 200px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: var(--muted);
}

.dropdown-item.text-danger {
    color: var(--destructive);
}

.dropdown-item.text-danger:hover {
    background: var(--destructive-10);
}

/* =====================================================
   Filter Card
   ===================================================== */
.filter-card .card-header {
    padding: 1rem 1.5rem;
}

.filter-card .card-body {
    padding: 1rem 1.5rem 1.5rem;
}

/* =====================================================
   Details Page Sidebar
   ===================================================== */
.detail-sidebar .card {
    margin-bottom: 1rem;
}

.detail-sidebar .card-header {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.detail-sidebar .card-title {
    font-size: 0.875rem;
}

.detail-sidebar .card-body {
    padding: 1rem 1.25rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
}

.detail-item dt {
    color: var(--muted-foreground);
    font-weight: normal;
}

.detail-item dd {
    font-weight: 500;
    margin-bottom: 0;
}

/* =====================================================
   Responsive - Dashboard Mobile Optimizations
   ===================================================== */

/* Mobile Dashboard Optimizations - Smaller screens (phones) */
@media (max-width: 575.98px) {
    /* Dashboard page header - stack elements vertically */
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        margin-bottom: 1.5rem;
    }
    
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .page-title {
        font-size: 1.5rem;
        display: none; /* Hidden on mobile - shown in mobile header instead */
    }
    
    .page-description {
        font-size: 0.875rem;
        margin-top: 0.25rem;
    }
    
    /* Dashboard stat cards - adjust layout for mobile */
    .stat-card {
        min-height: auto;
    }
    
    .stat-card .card-header {
        padding: 1rem 1rem 0.5rem;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .stat-card .card-body {
        padding: 0.5rem 1rem 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
        line-height: 1.1;
    }
    
    .stat-card .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-card .stat-sublabel {
        font-size: 0.7rem;
    }
    
    .stat-card .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    /* Priority & Status breakdown cards - make full width on mobile */
    .breakdown-item {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.875rem;
    }
    
    .breakdown-value {
        font-size: 0.875rem;
        font-weight: 600;
    }
    
    /* Quick action cards - better mobile layout */
    .card .d-flex.align-items-center.gap-3 {
        gap: 0.75rem !important;
    }
    
    .card .d-flex.align-items-center.gap-3 .stat-icon {
        width: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
    }
    
    .card .d-flex.align-items-center.gap-3 .stat-value {
        font-size: 1.25rem !important;
    }
    
    .card .d-flex.align-items-center.gap-3 .stat-label {
        font-size: 0.8rem !important;
    }
    
    /* Welcome card improvements */
    .card.bg-primary .card-body {
        padding: 1.5rem 1rem;
    }
    
    .card.bg-primary h4 {
        font-size: 1.25rem;
    }
    
    /* Compact spacing for mobile */
    .row {
        --bs-gutter-x: 1rem;
    }
}

/* Mobile Dashboard Optimizations - Small tablets and large phones */
@media (max-width: 767.98px) {
    /* Content wrapper - reduced padding to prevent overflow */
    .content-wrapper {
        padding: 0.75rem;
    }
    
    /* Reduce row gutters on mobile to prevent horizontal scrolling */
    .row {
        --bs-gutter-x: 0.75rem;
    }
    
    /* Dashboard cards - ensure proper spacing */
    .card {
        margin-bottom: 0.75rem;
    }
    
    .stat-card .card-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }
    
    .stat-card .card-body {
        padding: 0.75rem 1.25rem 1.25rem;
    }
    
    /* Page header - clean spacing */
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    /* Hide page title on mobile since it's shown in mobile header */
    .page-title {
        display: none;
    }
    
    .page-description {
        font-size: 0.9rem !important;
    }
    
    /* Back button mobile styles - hide separate back button on mobile */
    .back-button-section {
        display: none;
    }
    
    /* Fix page header spacing issues on mobile */
    .page-header .d-flex.align-items-center.gap-3 {
        gap: 0.75rem !important;
    }
    
    .page-header .btn-ghost {
        padding: 0.5rem;
        min-width: auto;
        flex-shrink: 0;
        margin-right: 0;
    }
    
    .page-header .btn-ghost i {
        font-size: 1rem;
        margin: 0;
    }
    body {
        overflow-x: hidden;
    }
    
    .main-content {
        overflow-x: hidden;
    }
    
    /* Ensure all cards fit within viewport */
    .card {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Priority breakdown and status cards adjustments */
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-description {
        font-size: 0.8rem;
    }
    
    /* Table responsiveness improvements */
    .table-responsive {
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .table th {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    /* Hide less important table columns on mobile */
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none;
    }
    
    /* Make ticket numbers and subjects more readable */
    .ticket-number {
        font-size: 0.8rem !important;
        font-weight: 600;
    }
    
    /* Button adjustments for mobile */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Ultra-small mobile devices (320px - 480px) */
@media (max-width: 479.98px) {
    /* Even tighter spacing for very small screens */
    .content-wrapper {
        padding: 0.5rem;
    }
    
    /* Reduce row gutters further */
    .row {
        --bs-gutter-x: 0.5rem;
    }
    
    /* Make stat cards more compact */
    .stat-card .card-header,
    .stat-card .card-body {
        padding: 0.75rem 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-card .stat-label,
    .stat-card .stat-sublabel {
        font-size: 0.75rem;
    }
}

/* Sidebar overlay for mobile only */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    pointer-events: none;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
    box-shadow: var(--shadow-sm);
}

/* Mobile Navigation Styles */
@media (max-width: 767.98px) {
    /* Show mobile header */
    .mobile-header {
        display: flex !important;
    }
    
    .mobile-header .mobile-header-left,
    .mobile-header .hamburger-btn {
        display: flex !important;
    }
    
    /* Hide sidebar footer - user dropdown is in mobile header */
    .sidebar-footer {
        display: none !important;
    }
    
    /* Adjust main content for mobile */
    .main-content {
        margin-top: 56px;
        margin-left: 0;
    }
    
    /* Sidebar slides in from left on mobile */
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1300;
    }
    
    /* Sidebar visible state */
    #sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Show mobile sidebar header with close button */
    .mobile-sidebar-header {
        display: flex !important;
    }
    
    /* Hide desktop sidebar header */
    .sidebar-header.desktop-only {
        display: none !important;
    }
    
    /* Sidebar overlay */
    .sidebar-overlay {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Lock body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Hide page header back buttons on mobile since mobile header handles navigation */
    .page-header .btn-ghost {
        display: none !important;
    }
    
    /* But show them specifically for ticket-related pages where they go to /Tickets */
    .page-header .btn-ghost[href*="Tickets"] {
        display: flex !important;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: var(--radius);
        background: var(--secondary);
        color: var(--secondary-foreground);
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    /* Ensure page header content is visible below mobile header */
    .page-header {
        margin-top: 1rem;
    }
    
    /* Hide page titles on mobile, keep descriptions and back buttons */
    .page-header .page-title {
        display: none;
    }
    
    /* Reset collapsed styling on mobile sidebar */
    #sidebar.collapsed {
        width: 280px;
    }
    
    #sidebar.collapsed .sidebar-text,
    #sidebar.collapsed .sidebar-brand-text,
    #sidebar.collapsed .sidebar-section-title {
        opacity: 1;
        visibility: visible;
        display: inline;
    }
}

/* High-specificity mobile overrides to ensure proper display */
@media screen and (max-width: 767.98px) {
    header.mobile-header {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    header.mobile-header > .mobile-header-left {
        display: flex !important;
        visibility: visible !important;
    }
    
    header.mobile-header button.hamburger-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure sidebar is hidden by default on mobile */
    nav#sidebar {
        transform: translateX(-100%);
    }
    
    nav#sidebar.mobile-open {
        transform: translateX(0);
    }
}

.mobile-header-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

/* Ensure hamburger and mobile-header-left are already hidden inside .mobile-header which is display:none by default */

.hamburger-btn:hover {
    background: var(--muted);
    color: #2d3748;
}

.hamburger-btn i {
    font-size: 1.5rem;
}

.mobile-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 50%;
    text-align: center;
    pointer-events: none;
}

.mobile-header-logo {
    height: 28px;
    width: auto;
    flex-shrink: 0;
}

.mobile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-radius: var(--radius);
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s ease;
    border: none;
}

.mobile-back-btn:hover {
    background: var(--secondary-hover);
    color: var(--secondary-foreground);
    text-decoration: none;
    transform: scale(0.95);
}

.mobile-back-btn i {
    font-size: 1rem;
}

/* Mobile User Dropdown Button */
.mobile-user-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0.25rem;
    border-radius: var(--radius);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-user-btn:hover {
    background: var(--muted);
}

.mobile-user-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-20);
}

/* Mobile Avatar */
.mobile-avatar-wrapper {
    position: relative;
    display: inline-flex;
}

.mobile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.mobile-avatar-badge {
    position: absolute;
    top: -4px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background-color: #dc3545;
    color: white;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background);
}

/* Mobile Sidebar Header */
.mobile-sidebar-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--sidebar-border);
}

.mobile-sidebar-header .sidebar-brand-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sidebar-fg);
}

.close-sidebar-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--sidebar-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-fg);
}

.close-sidebar-btn i {
    font-size: 1.25rem;
}

/* Desktop-only elements */
.desktop-only {
    display: flex;
}

/* Mobile Header Dropdown Customizations */
.mobile-header .dropdown-menu {
    min-width: 200px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0;
    margin-top: 0.25rem;
}

.mobile-header .dropdown-header {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
}

.mobile-header .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.mobile-header .dropdown-item:hover {
    background: var(--muted);
}

.mobile-header .dropdown-item.text-danger:hover {
    background: var(--destructive-10);
    color: var(--destructive);
}

.mobile-menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    color: var(--foreground);
}

.mobile-menu-btn:hover {
    background: var(--muted);
}

/* =====================================================
   Utilities
   ===================================================== */
.text-muted-foreground {
    color: var(--muted-foreground) !important;
}

.bg-muted {
    background: var(--muted) !important;
}

.border-subtle {
    border-color: var(--border) !important;
}

.shadow-elegant {
    box-shadow: var(--shadow-elegant) !important;
}

.shadow-elegant-lg {
    box-shadow: var(--shadow-elegant-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

.font-mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace !important;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading/Skeleton Animation */
.skeleton {
    background: linear-gradient(90deg, var(--muted) 25%, #e5e7eb 50%, var(--muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Smooth transitions */
.transition-all {
    transition: all 0.2s ease;
}

.transition-shadow {
    transition: box-shadow 0.2s ease;
}

/* Text utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Spacing utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Tom Select - Hide placeholder on focus */
.ts-control.focus .ts-input-placeholder,
.ts-wrapper.focus .ts-control > input::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

.ts-control.focus input::placeholder {
    color: transparent !important;
}

/* Also target the dropdown-input state */
.ts-wrapper.dropdown-active .ts-control > input::placeholder,
.ts-wrapper.input-active .ts-control > input::placeholder {
    color: transparent !important;
}

/* Tom Select - Match filter dropdowns to form-control height */
#filterForm .form-control {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

#filterForm .ts-wrapper .ts-control {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    padding: 6px 0.75rem !important;
}

/* Hide individual item pills, show summary badge instead */
#filterForm .ts-control .ts-item-hidden {
    display: none !important;
}

#filterForm .ts-control .ts-selection-summary {
    color: var(--bs-body-color);
    font-size: 0.875rem;
    white-space: nowrap;
    line-height: 1.5;
}

/* Hide placeholder text when selections are active */
#filterForm .ts-wrapper.has-summary .ts-control > input::placeholder {
    color: transparent !important;
}
#filterForm .ts-wrapper.has-summary .ts-control > input {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
}

/* =====================================================
   System Alerts Banner & Modal
   ===================================================== */

/* Banner container - fixed at top of content area */
.system-alerts-banner {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
}

.system-alerts-banner .alert {
    border-radius: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.system-alerts-banner .alert .btn-close {
    padding: 0.5rem;
    font-size: 0.75rem;
}

.system-alerts-banner .alert-link {
    margin-left: 0.5rem;
    text-decoration: underline;
}

/* Modal styling for alerts */
#systemAlertModal .modal-header {
    border-bottom: none;
}

#systemAlertModal .modal-footer {
    border-top: 1px solid var(--border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .system-alerts-banner .alert {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
        padding-right: 2rem;
    }
    
    .system-alerts-banner .alert .btn-close {
        padding: 0.4rem;
    }
}

/* Fix modal z-index to appear above sidebar dropdowns */
.modal {
    z-index: 1400 !important;
}

.modal-backdrop {
    z-index: 1350 !important;
}

/* Ensure modal dialog appears above backdrop */
.modal-dialog {
    z-index: 1401 !important;
    position: relative;
}
