/* CSS Variables - Identity Blue Theme */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-rgb: 37, 99, 235;
    --secondary-color: #64748b;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;

    --bg-color: #f0f4fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: rgba(37, 99, 235, 0.1);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 22px rgba(17, 24, 39, 0.10);

    --sidebar-width: 260px;
    --topbar-height: 64px;

    --transition: all 0.2s ease;

    /* Gradient for topbar */
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

/* App Layout */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Light Theme (DMS Style) */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h1 span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info span,
.sidebar.collapsed .btn-logout span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-header {
    text-align: center;
    padding: 16px 0;
}

.sidebar.collapsed .sidebar-header h1 {
    justify-content: center;
}

.sidebar-header {
    padding: 16px 20px;
    background: var(--bg-card);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    margin: 0;
}

.sidebar-header h1 i {
    font-size: 22px;
}

.sidebar-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.sidebar.collapsed .sidebar-logo {
    height: 36px;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    font-size: 14px;
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Nav badge (unread count) */
.nav-badge { background: #dc3545; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
.sidebar.collapsed .nav-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 3px; margin-left: 0; }

/* Sidebar nav icon colors */
.nav-item[data-view="dashboard"] i { color: #2563eb; }
.nav-item[data-view="tickets"] i { color: #0d6efd; }
.nav-item[data-view="create-ticket"] i { color: #198754; }
.nav-item[data-view="service-catalog"] i { color: #fd7e14; }
.nav-item[data-view="categories"] i { color: #20c997; }
.nav-item[data-view="knowledge-base"] i { color: #6610f2; }
.nav-item[data-view="assets"] i { color: #0dcaf0; }
.nav-item[data-view="reports"] i { color: #d63384; }
.nav-item[data-view="workflow"] i { color: #ffc107; }
.nav-item[data-view="webhooks"] i { color: #6c757d; }
.nav-item[data-view="settings"] i { color: #adb5bd; }

.nav-item:hover i,
.nav-item.active i {
    opacity: 1;
}

.sidebar-footer {
    padding: 15px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-info i {
    font-size: 24px;
    color: var(--primary-color);
}

.btn-logout {
    width: 100%;
    padding: 10px 12px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-logout:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--text-white);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    overflow-x: hidden;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

/* Top Bar - Gradient Style (DMS Style) */
.top-bar {
    height: var(--topbar-height);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    color: var(--text-white);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    color: var(--text-white);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.25);
}

.search-box {
    flex: 1;
    max-width: 450px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

.search-box input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.topbar-page-actions {
    margin-left: auto;
}

.top-bar-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    color: var(--text-white);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-white);
}

#notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger-color);
    color: var(--text-white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Content Area */
.content-area {
    padding: 20px;
    min-height: calc(100vh - var(--topbar-height));
}

/* Cards - DMS Style */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

/* Stats Grid - DMS KPI Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue { background-color: rgba(111, 66, 193, 0.12); color: var(--primary-color); }
.stat-icon.green { background-color: rgba(25, 135, 84, 0.12); color: var(--success-color); }
.stat-icon.yellow { background-color: rgba(255, 193, 7, 0.12); color: #b58100; }
.stat-icon.red { background-color: rgba(220, 53, 69, 0.12); color: var(--danger-color); }
.stat-icon.cyan { background-color: rgba(13, 202, 240, 0.12); color: var(--info-color); }
.stat-icon.purple { background-color: rgba(37, 99, 235, 0.12); color: var(--primary-color); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 12.5px;
}

th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

tr:hover {
    background-color: var(--bg-color);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
}

.status-new { background-color: #dbeafe; color: #1e40af; }
.status-open { background-color: #fef3c7; color: #92400e; }
.status-inprogress { background-color: #e0e7ff; color: #3730a3; }
.status-onhold { background-color: #f3f4f6; color: #374151; }
.status-resolved { background-color: #d1fae5; color: #065f46; }
.status-closed { background-color: #e5e7eb; color: #4b5563; }
.status-cancelled { background-color: #fee2e2; color: #991b1b; }

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.priority-critical { background-color: #fee2e2; color: #991b1b; }
.priority-high { background-color: #ffedd5; color: #9a3412; }
.priority-medium { background-color: #fef3c7; color: #92400e; }
.priority-low { background-color: #d1fae5; color: #065f46; }

/* Buttons - DMS Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--text-white);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover {
    background-color: #157347;
    color: var(--text-white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-white);
}

.btn-danger:hover {
    background-color: #bb2d3b;
    color: var(--text-white);
}

.btn:disabled, .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon-only {
    padding: 10px;
    min-width: 38px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.15);
}

.form-control:disabled {
    background-color: var(--bg-color);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Modal - DMS Style */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--bg-card);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal.modal-large {
    max-width: 900px;
}

.modal.modal-small {
    max-width: 400px;
}

.modal.modal-fullwidth {
    max-width: calc(100vw - 60px);
    width: calc(100vw - 60px);
    max-height: calc(100vh - 40px);
    height: calc(100vh - 40px);
}

.modal.modal-fullwidth .modal-body {
    flex: 1;
    overflow-y: auto;
}

/* Quill editor inside modal */
.kb-editor-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.kb-editor-container .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.kb-editor-container .ql-container {
    border: none;
    font-size: 14px;
    min-height: 300px;
}

.kb-editor-container .ql-editor {
    min-height: 300px;
}

.modal.modal-fullwidth .kb-editor-container .ql-container,
.modal.modal-fullwidth .kb-editor-container .ql-editor {
    min-height: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }
.toast.info { border-left: 4px solid var(--info-color); }

.toast-icon {
    font-size: 18px;
}

.toast.success .toast-icon { color: var(--success-color); }
.toast.error .toast-icon { color: var(--danger-color); }
.toast.warning .toast-icon { color: var(--warning-color); }
.toast.info .toast-icon { color: var(--info-color); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Filters */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-input-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    transition: var(--transition);
}

.search-input-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 13px;
    background-color: var(--bg-card);
    cursor: pointer;
}

/* Ticket Detail */
.ticket-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ticket-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ticket-number {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.ticket-subject {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.ticket-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.meta-value {
    font-size: 14px;
    font-weight: 500;
}

/* Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment {
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

.comment.internal {
    background-color: #fef3c7;
    border-left: 3px solid var(--warning-color);
}

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

.comment-author {
    font-weight: 600;
}

.comment-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-body {
    font-size: 14px;
    line-height: 1.6;
}

/* Mention Autocomplete */
.mention-dropdown { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #dee2e6); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 280px; overflow-y: auto; }
.mention-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; transition: background .1s; }
.mention-dropdown-item:hover, .mention-dropdown-item.selected { background: var(--primary-light-bg, #e8f0fe); }
.mention-dropdown-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-color, #2563eb); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.mention-dropdown-info { flex: 1; min-width: 0; }
.mention-dropdown-name { font-size: 13px; font-weight: 600; color: var(--text-primary, #212529); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-dropdown-email { font-size: 11px; color: var(--text-secondary, #6c757d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mention Highlight */
.mention-highlight { background: var(--primary-light-bg, #dbeafe); color: var(--primary-color, #2563eb); padding: 1px 4px; border-radius: 3px; font-weight: 600; font-size: 0.95em; }

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--text-light);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover {
    background-color: var(--bg-color);
}

.pagination button.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px 0;
}

.pagination-controls .pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.star-rating {
    display: flex;
    gap: 4px;
}

/* Service Request Detail */
/* SR Detail Banner */
.sr-detail-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.sr-detail-banner.badge-info { background: linear-gradient(135deg, #e0f2fe, #bae6fd); border-left: 4px solid #0ea5e9; }
.sr-detail-banner.badge-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); border-left: 4px solid #f59e0b; }
.sr-detail-banner.badge-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); border-left: 4px solid #10b981; }
.sr-detail-banner.badge-danger { background: linear-gradient(135deg, #fee2e2, #fecaca); border-left: 4px solid #ef4444; }
.sr-detail-banner.badge-primary { background: linear-gradient(135deg, #dbeafe, #bfdbfe); border-left: 4px solid #2563eb; }
.sr-detail-banner.badge-secondary { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); border-left: 4px solid #6b7280; }

.sr-detail-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sr-detail-banner-left > i {
    font-size: 24px;
    opacity: 0.7;
}

.sr-detail-banner-service {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sr-detail-banner-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.sr-detail-banner-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* SR Detail Columns */
.sr-detail-columns {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

@media (max-width: 768px) {
    .sr-detail-columns {
        grid-template-columns: 1fr;
    }
}

.sr-detail-main {
    min-width: 0;
}

.sr-detail-sidebar {
    border-left: 1px solid var(--border-color);
    padding-left: 24px;
}

.sr-detail-sidebar h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* SR Detail Info Table */
.sr-detail-info-table {
    margin-bottom: 20px;
}

.sr-detail-info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.sr-detail-info-row:last-child {
    border-bottom: none;
}

.sr-detail-info-label {
    width: 160px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sr-detail-info-label i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
    opacity: 0.7;
}

.sr-detail-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* SR Detail Notes */
.sr-detail-notes {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.sr-detail-section {
    margin-bottom: 20px;
}

.sr-detail-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Service Request Timeline */
.sr-timeline {
    position: relative;
    padding-left: 28px;
}

.sr-timeline-item {
    position: relative;
    padding-bottom: 20px;
    padding-left: 20px;
}

.sr-timeline-item:not(.last)::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.sr-timeline-item.pending::before {
    border-left: 2px dashed var(--border-color);
    background: none;
}

.sr-timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    z-index: 1;
}

.sr-timeline-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.sr-timeline-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.sr-timeline-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.sr-timeline-item.pending .sr-timeline-label {
    color: var(--text-light);
    font-style: italic;
}

/* Service Catalog Item Detail */
.svc-detail-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.svc-detail-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.svc-detail-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.svc-detail-hero-desc {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.svc-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.svc-detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.svc-detail-chip i {
    font-size: 12px;
    color: var(--primary-color);
}

.svc-detail-chip-rating {
    background: #fffbeb;
    border-color: #fde68a;
}

.svc-detail-stars {
    font-size: 14px;
    letter-spacing: 1px;
}

.svc-detail-desc h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.svc-detail-desc h4 i {
    color: var(--primary-color);
    opacity: 0.7;
}

.svc-detail-desc-body {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .ticket-detail {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Clickable rows */
tr.clickable {
    cursor: pointer;
}

tr.clickable:hover {
    background-color: #f0f9ff;
}

/* Action buttons in table */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* Login Screen - DMS Purple Theme */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--gradient-primary);
}

.login-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-header {
    margin-bottom: 32px;
}

.login-header i {
    font-size: 56px;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: block;
}

.login-logo {
    height: 100px;
    width: auto;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.login-body {
    margin-bottom: 32px;
}

.login-body p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.login-body .btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    width: 100%;
    border-radius: var(--border-radius-sm);
}

.login-footer {
    color: var(--text-light);
    font-size: 12px;
}

.login-screen.hidden {
    display: none;
}

/* User role badge */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.superadmin {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
}

.role-badge.admin {
    background-color: var(--danger-color);
    color: white;
}

.role-badge.agent {
    background-color: var(--primary-color);
    color: white;
}

.role-badge.user {
    background-color: var(--secondary-color);
    color: white;
}

/* Tabs */
.tabs,
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
    background: var(--bg-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    min-height: 400px;
}

/* Form improvements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Text utilities */
.text-success {
    color: var(--success-color);
}

.text-muted {
    color: var(--text-light);
}

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

/* Badge improvements */
.badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* ========================================
   KNOWLEDGE BASE STYLES
   ======================================== */

/* KB Page Header */
.kb-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.kb-page-header h2 {
    display: none;
}

/* KB Search Section */
.kb-search-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
}

.kb-search-section h3 {
    color: white;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.kb-search-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-bottom: 20px;
}

.kb-search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.kb-search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
}

.kb-search-box input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.kb-search-box input:focus {
    outline: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.kb-search-box input::placeholder {
    color: var(--text-secondary);
}

/* KB Filters */
.kb-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.kb-filters .filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.kb-filters select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.kb-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.kb-filters .btn-clear {
    margin-left: auto;
}

/* KB Stats Summary */
.kb-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.kb-stat-card {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.kb-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 20px;
}

.kb-stat-card .stat-icon.published {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kb-stat-card .stat-icon.draft {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.kb-stat-card .stat-icon.views {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.kb-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.kb-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* KB Articles Grid */
.kb-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* KB Article Card */
.kb-article-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.kb-article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.kb-article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.kb-article-card:hover::before {
    transform: scaleY(1);
}

.kb-article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.kb-article-number {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(var(--primary-rgb), 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.kb-article-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-article-card:hover .kb-article-title {
    color: var(--primary-color);
}

.kb-article-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.kb-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.kb-article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kb-article-meta i {
    color: var(--primary-color);
    font-size: 12px;
}

.kb-article-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.kb-article-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 20px;
}

.kb-article-stats .fa-eye {
    color: #3b82f6;
}

.kb-article-stats .fa-thumbs-up {
    color: #10b981;
}

/* Status Badge in KB */
.kb-article-card .status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-pending {
    background: #e0e7ff;
    color: #3730a3;
}

.status-badge.status-published {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-archived {
    background: #f3f4f6;
    color: #6b7280;
}

/* KB Empty State */
.kb-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
}

.kb-empty-state i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.kb-empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.kb-empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .kb-articles-grid {
        grid-template-columns: 1fr;
    }

    .kb-search-section {
        padding: 24px 16px;
    }

    .kb-stats {
        flex-direction: column;
    }

    .kb-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .kb-filters .btn-clear {
        margin-left: 0;
    }
}

/* Knowledge Base Detail View */
.kb-detail {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.kb-detail-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kb-detail-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.kb-detail-summary {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.kb-detail-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.kb-detail-content .kb-rich-content.ql-editor {
    padding: 0;
    height: auto;
    overflow: visible;
    color: inherit;
    line-height: inherit;
}

.kb-detail-content .kb-rich-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-color);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    margin: 1em 0;
    padding: 10px 14px;
}

.kb-detail-content .kb-rich-content pre.ql-syntax,
.kb-detail-content .kb-rich-content pre {
    margin: 1em 0;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    background: #1f2937;
    color: #f8fafc;
    overflow-x: auto;
}

.kb-detail-content .kb-rich-content .ql-code-block-container {
    margin: 1em 0;
    border-radius: var(--border-radius-sm);
    background: #1f2937;
    color: #f8fafc;
    overflow-x: auto;
}

.kb-detail-content .kb-rich-content .ql-code-block {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    padding-left: 14px;
    padding-right: 14px;
}

.kb-detail-content .kb-rich-content .ql-code-block:first-child {
    padding-top: 12px;
}

.kb-detail-content .kb-rich-content .ql-code-block:last-child {
    padding-bottom: 12px;
}

.kb-detail-content .kb-rich-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.kb-detail-content .kb-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
}

.kb-detail-content .kb-rich-content iframe,
.kb-detail-content .kb-rich-content video {
    max-width: 100%;
    border-radius: var(--border-radius-sm);
}

.kb-detail-content code {
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

.kb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.kb-tag {
    background: var(--bg-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.kb-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.kb-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kb-info-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.kb-info-value {
    font-size: 14px;
    font-weight: 500;
}

.kb-versions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.kb-version-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.kb-version-num {
    font-weight: 600;
    font-size: 12px;
}

.kb-version-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.kb-version-notes {
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
}

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

    .kb-detail-sidebar {
        order: -1;
    }
}

/* ========================================
   SERVICE CATALOG STYLES
   ======================================== */

/* Catalog Search */
.catalog-search {
    margin-bottom: 24px;
}

.catalog-search .search-box {
    max-width: 500px;
    position: relative;
}

.catalog-search .search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.catalog-search .search-box input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
}

.catalog-search .search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Section Headers */
.popular-services,
.all-services {
    margin-bottom: 32px;
}

.popular-services h3,
.all-services h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popular-services h3 i {
    color: #f59e0b;
}

.all-services h3 i {
    color: var(--primary-color);
}

/* Service Grid */
.service-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Service Card */
.service-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card.popular {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, var(--bg-card) 100%);
}

.service-card.popular::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transform: scaleX(1);
}

.service-card.inactive {
    opacity: 0.6;
}

/* Service Icon */
.service-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.service-icon.hardware { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.service-icon.software { background: linear-gradient(135deg, var(--primary-color), var(--primary-light)); }
.service-icon.access { background: linear-gradient(135deg, #10b981, #34d399); }
.service-icon.other { background: linear-gradient(135deg, #6b7280, #9ca3af); }

/* Service Info */
.service-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-info h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.service-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Service Meta Info */
.service-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.service-meta span,
span.service-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.service-meta i {
    color: var(--primary-color);
}

.service-meta .fa-star {
    color: #f59e0b;
}

.service-meta .fa-clock {
    color: #0ea5e9;
}

.service-meta .fa-dollar-sign {
    color: #10b981;
}

/* Service Card Button */
.service-card .btn {
    align-self: flex-start;
    margin-top: 8px;
}

.service-card .btn-sm {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Service Request Form */
.service-request-form .dynamic-field {
    margin-bottom: 16px;
}

/* My Requests Table */
.request-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.request-pending { background-color: #fef3c7; color: #92400e; }
.request-approved { background-color: #d1fae5; color: #065f46; }
.request-rejected { background-color: #fee2e2; color: #991b1b; }
.request-inprogress { background-color: #e0e7ff; color: #3730a3; }
.request-completed { background-color: #e5e7eb; color: #4b5563; }
.request-cancelled { background-color: #f3f4f6; color: #6b7280; }

/* Manage Catalog Modal */
.catalog-management {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.catalog-management .service-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.catalog-management .service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.catalog-management .service-item:last-child {
    border-bottom: none;
}

.catalog-management .service-item:hover {
    background: var(--bg-color);
}

.catalog-management .service-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.catalog-management .service-item-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.catalog-management .service-item-details h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.catalog-management .service-item-details span {
    font-size: 12px;
    color: var(--text-secondary);
}

.catalog-management .service-item-actions {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .service-grid,
    .services-grid {
        grid-template-columns: 1fr;
    }

    .catalog-search .search-box {
        max-width: 100%;
    }
}

/* ========================================
   REPORTS & ANALYTICS STYLES
   ======================================== */

/* Reports Page Header */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.reports-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.reports-header h2 i {
    color: var(--primary-color);
}

.reports-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.date-range-picker input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-primary);
}

.date-range-picker input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.date-range-picker span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Reports Summary Banner */
.reports-summary-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    padding: 24px 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.reports-summary-banner .summary-item {
    text-align: center;
    color: white;
}

.reports-summary-banner .summary-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.reports-summary-banner .summary-label {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

/* Reports Stats Grid */
.reports-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.report-stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

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

.report-stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.report-stat-card .stat-icon.total {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.report-stat-card .stat-icon.open {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.report-stat-card .stat-icon.resolved {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.report-stat-card .stat-icon.created {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
}

.report-stat-card .stat-icon.critical {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

.report-stat-card .stat-icon.overdue {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.report-stat-card .stat-icon.unassigned {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
}

.report-stat-card .stat-icon.time {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
}

.report-stat-card .stat-content {
    flex: 1;
}

.report-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.report-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.report-stat-card .stat-trend {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.report-stat-card .stat-trend.up {
    color: #10b981;
}

.report-stat-card .stat-trend.down {
    color: #ef4444;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    margin-bottom: 0;
}

.chart-controls select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-color);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Agent Performance Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.agent-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.agent-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.agent-info {
    flex: 1;
}

.agent-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.agent-role {
    font-size: 13px;
    color: var(--text-secondary);
}

.agent-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.agent-stat {
    padding: 14px 10px;
    background: var(--bg-color);
    border-radius: 12px;
    text-align: center;
}

.agent-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-rating {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-rating-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.agent-rating-stars {
    color: #f59e0b;
    font-size: 14px;
}

/* SLA Compliance Styles */
.sla-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.sla-overview-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 28px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.sla-overview-card .sla-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.sla-overview-card .sla-icon.response {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.sla-overview-card .sla-icon.resolution {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.sla-overview-card .sla-icon.overall {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.sla-overview-card .sla-value {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
}

.sla-overview-card .sla-value.good { color: #10b981; }
.sla-overview-card .sla-value.warning { color: #f59e0b; }
.sla-overview-card .sla-value.poor { color: #ef4444; }

.sla-overview-card .sla-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.sla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sla-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.sla-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sla-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sla-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sla-badge.good { background: #d1fae5; color: #065f46; }
.sla-badge.warning { background: #fef3c7; color: #92400e; }
.sla-badge.poor { background: #fee2e2; color: #991b1b; }

/* Escalation Badges */
.escalation-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.escalation-level-1 { background: #d1fae5; color: #065f46; }
.escalation-level-2 { background: #fef3c7; color: #92400e; }
.escalation-level-3 { background: #fee2e2; color: #991b1b; }
.escalation-level-4 { background: #fecaca; color: #7c2d12; }

.text-danger { color: #dc3545 !important; }

.sla-percentage {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.sla-percentage.good { color: #10b981; }
.sla-percentage.warning { color: #f59e0b; }
.sla-percentage.poor { color: #ef4444; }

.sla-gauge {
    width: 100%;
    height: 10px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sla-gauge-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.sla-gauge-fill.good { background: linear-gradient(90deg, #10b981, #34d399); }
.sla-gauge-fill.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.sla-gauge-fill.poor { background: linear-gradient(90deg, #ef4444, #f87171); }

.sla-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Patterns Section */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.pattern-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.pattern-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.pattern-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pattern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 10px;
}

.pattern-item-label {
    font-size: 14px;
    color: var(--text-primary);
}

.pattern-item-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsive Reports */
@media (max-width: 1200px) {
    .reports-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sla-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .patterns-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .reports-stats-grid {
        grid-template-columns: 1fr;
    }

    .sla-overview {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .reports-header {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-picker {
        flex-wrap: wrap;
        justify-content: center;
    }

    .reports-summary-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   WEBHOOKS MANAGEMENT STYLES
   ======================================== */
.webhooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.webhook-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.webhook-card.inactive {
    opacity: 0.7;
    background: var(--bg-color);
}

.webhook-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.webhook-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.webhook-title h4 {
    font-size: 16px;
    font-weight: 600;
}

.webhook-actions {
    display: flex;
    gap: 5px;
}

.webhook-body {
    margin-bottom: 15px;
}

.webhook-url {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.webhook-url code {
    font-size: 12px;
    word-break: break-all;
    flex: 1;
}

.webhook-events {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.webhook-events .tag {
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.webhook-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.webhook-footer {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.webhook-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    margin-bottom: 8px;
}

.webhook-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.webhook-error {
    font-size: 12px;
    color: var(--danger-color);
    margin-top: 8px;
}

.events-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--bg-color);
}

.checkbox-label input {
    margin-right: 8px;
}

.checkbox-label span {
    font-weight: 500;
}

.checkbox-label small {
    margin-left: 22px;
}

.test-result {
    padding: 20px;
    border-radius: var(--border-radius);
}

.test-result.success {
    background: #d1fae5;
}

.test-result.error {
    background: #fee2e2;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.test-result.success .result-status { color: var(--success-color); }
.test-result.error .result-status { color: var(--danger-color); }

.result-details .detail-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.result-details label {
    font-weight: 600;
    min-width: 100px;
}

.result-details pre {
    background: white;
    padding: 10px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 12px;
    max-height: 200px;
}

/* ========================================
   MENTIONS/NOTIFICATIONS STYLES
   ======================================== */
.notifications-dropdown {
    position: relative;
}

.mentions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.mentions-menu.show {
    display: block;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.dropdown-header a {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
}

.dropdown-header a:hover {
    text-decoration: underline;
}

.mentions-menu .mentions-list {
    max-height: 300px;
    overflow-y: auto;
}

.mention-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.mention-item:hover {
    background: var(--bg-color);
}

.mention-item.unread {
    background: #eff6ff;
    border-left: 3px solid var(--primary-color);
}

.mention-content {
    font-size: 13px;
    margin-bottom: 4px;
}

.mention-ticket {
    color: var(--primary-color);
    font-weight: 500;
}

.mention-preview {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-time {
    font-size: 11px;
    color: var(--text-light);
}

.dropdown-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.dropdown-footer a {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

/* Full mentions page */
.mentions-list-container {
    margin-top: 20px;
    min-height: calc(100vh - var(--topbar-height) - 60px);
}

.mention-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.mention-card.unread {
    border-left: 4px solid var(--primary-color);
    background: #fafbff;
}

.mention-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mention-info {
    font-size: 14px;
}

.mention-card-body {
    margin-bottom: 12px;
}

.mention-ticket-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-right: 10px;
}

.mention-ticket-link:hover {
    text-decoration: underline;
}

.mention-ticket-subject {
    color: var(--text-secondary);
}

.mention-card-comment blockquote {
    background: var(--bg-color);
    padding: 12px 15px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
}

.mention-card-actions {
    display: flex;
    gap: 10px;
}

.loading-small {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* ========================================
   ASSETS/CMDB STYLES
   ======================================== */
.assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.assets-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.asset-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.asset-type-hardware { background-color: #dbeafe; color: #1e40af; }
.asset-type-software { background-color: #e0e7ff; color: #3730a3; }
.asset-type-service { background-color: #d1fae5; color: #065f46; }
.asset-type-network { background-color: #fef3c7; color: #92400e; }
.asset-type-database { background-color: #fee2e2; color: #991b1b; }
.asset-type-storage { background-color: #f3e8ff; color: #6b21a8; }
.asset-type-virtual { background-color: #ccfbf1; color: #0f766e; }
.asset-type-cloud { background-color: #e0f2fe; color: #0369a1; }
.asset-type-other { background-color: #f3f4f6; color: #374151; }

.asset-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.asset-status-active { background-color: #d1fae5; color: #065f46; }
.asset-status-instock { background-color: #dbeafe; color: #1e40af; }
.asset-status-deploying { background-color: #fef3c7; color: #92400e; }
.asset-status-maintenance { background-color: #ffedd5; color: #9a3412; }
.asset-status-retired { background-color: #e5e7eb; color: #4b5563; }
.asset-status-disposed { background-color: #f3f4f6; color: #6b7280; }
.asset-status-missing { background-color: #fee2e2; color: #991b1b; }
.asset-status-onorder { background-color: #e0e7ff; color: #3730a3; }
.asset-status-reserved { background-color: #f3e8ff; color: #6b21a8; }

.criticality-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.criticality-low { background-color: #d1fae5; color: #065f46; }
.criticality-medium { background-color: #fef3c7; color: #92400e; }
.criticality-high { background-color: #ffedd5; color: #9a3412; }
.criticality-critical { background-color: #fee2e2; color: #991b1b; }

.asset-warnings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.warning-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--warning-color);
}

.warning-card.expired {
    border-left-color: var(--danger-color);
}

.warning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.warning-asset-tag {
    font-family: monospace;
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.warning-days {
    font-weight: 600;
    color: var(--warning-color);
}

.warning-card.expired .warning-days {
    color: var(--danger-color);
}

.warning-details {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Asset detail modal */
.asset-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.asset-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asset-detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.asset-detail-value {
    font-size: 14px;
    font-weight: 500;
}

.asset-linked-tickets {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.asset-linked-tickets h4 {
    font-size: 14px;
    margin-bottom: 10px;
}

.linked-ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    font-size: 13px;
}

.linked-ticket-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.linked-ticket-item a:hover {
    text-decoration: underline;
}

/* Asset linking in ticket detail */
.asset-link-section {
    margin-top: 15px;
}

.asset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.asset-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.asset-chip .remove-asset {
    cursor: pointer;
    color: var(--text-secondary);
}

.asset-chip .remove-asset:hover {
    color: var(--danger-color);
}

/* Asset Detail Page (mirrors ticket-detail layout) */
.asset-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.asset-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.asset-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.asset-tag-badge {
    display: inline-block;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.asset-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.asset-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.criticality-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.criticality-low { background: #d1fae5; color: #065f46; }
.criticality-medium { background: #fef3c7; color: #92400e; }
.criticality-high { background: #fed7aa; color: #9a3412; }
.criticality-critical { background: #fecaca; color: #991b1b; }

.asset-detail-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px;
    gap: 0;
}

.asset-detail-tabs .tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.asset-detail-tabs .tab-btn:hover {
    color: var(--text-primary);
}

.asset-detail-tabs .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-meta-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-meta-value {
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .asset-detail {
        grid-template-columns: 1fr;
    }
}

/* Assets Page Header */
.assets-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.assets-page-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.assets-tab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.assets-tab:hover {
    color: var(--text-primary);
    background: var(--bg-color);
}

.assets-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.3);
}

/* Assets Filters Bar */
.assets-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.assets-search {
    flex: 1;
    min-width: 0;
    position: relative;
}

.assets-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
}

.assets-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.assets-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.assets-filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.assets-filter-group .form-control {
    width: 140px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
}

/* Assets Card Grid */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.asset-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.asset-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.1);
    transform: translateY(-2px);
}

.asset-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.asset-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-color);
    color: var(--text-secondary);
}

.asset-card-icon.icon-badge-success { background: #dcfce7; color: #16a34a; }
.asset-card-icon.icon-badge-info { background: #dbeafe; color: #2563eb; }
.asset-card-icon.icon-badge-primary { background: #e0e7ff; color: #4f46e5; }
.asset-card-icon.icon-badge-warning { background: #fef3c7; color: #d97706; }
.asset-card-icon.icon-badge-secondary { background: #f3f4f6; color: #6b7280; }
.asset-card-icon.icon-badge-dark { background: #e5e7eb; color: #374151; }
.asset-card-icon.icon-badge-danger { background: #fee2e2; color: #dc2626; }

.asset-card-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.asset-card-badges .badge {
    font-size: 11px;
    padding: 2px 8px;
}

.asset-card-badges .criticality-badge {
    font-size: 11px;
    padding: 2px 8px;
}

.asset-card-body {
    margin-bottom: 12px;
}

.asset-card-tag {
    margin-bottom: 4px;
}

.asset-card-tag code {
    font-size: 11px;
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.asset-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-card-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.asset-card-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    min-height: 26px;
}

.asset-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.asset-card-meta i {
    font-size: 11px;
}

.asset-card-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.asset-card:hover .asset-card-delete {
    opacity: 1;
}

.asset-card-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Dashboard type breakdown */
.asset-type-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.type-breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.type-breakdown-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.type-breakdown-info {
    flex: 1;
    min-width: 0;
}

.type-breakdown-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.type-breakdown-bar-track, .type-breakdown-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-color);
    overflow: hidden;
}

.type-breakdown-fill, .type-breakdown-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.type-breakdown-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.type-breakdown-count small {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Warranty warning list */
.warranty-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.warranty-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.warranty-item:hover {
    background: var(--bg-color);
}

.warranty-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.warranty-item-info {
    flex: 1;
    min-width: 0;
}

.warranty-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.warranty-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warranty-item-tag {
    font-size: 11px;
    background: var(--bg-color);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.warranty-item-bar-track {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-color);
    overflow: hidden;
    margin-bottom: 4px;
}

.warranty-item-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.warranty-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.warranty-item-days {
    text-align: center;
    flex-shrink: 0;
    min-width: 50px;
}

.warranty-item-days strong {
    display: block;
    font-size: 20px;
    line-height: 1;
}

.warranty-item-days small {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* RTL support for assets */
[dir="rtl"] .assets-search i {
    left: auto;
    right: 12px;
}

[dir="rtl"] .assets-search input {
    padding: 9px 36px 9px 12px;
}

[dir="rtl"] .asset-card-delete {
    right: auto;
    left: 12px;
}

[dir="rtl"] .type-breakdown-count {
    text-align: left;
}

@media (max-width: 768px) {
    .assets-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .assets-page-tabs {
        overflow-x: auto;
    }

    .assets-grid {
        grid-template-columns: 1fr;
    }

    .assets-filters {
        flex-wrap: wrap;
    }

    .assets-search {
        flex: 1 1 100%;
    }

    .assets-filter-group {
        flex-wrap: wrap;
    }
}

/* Page Header improvements */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    display: none;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Error message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Badge improvements for general use */
.badge-success { background-color: var(--success-color); color: white; }
.badge-warning { background-color: var(--warning-color); color: white; }
.badge-danger { background-color: var(--danger-color); color: white; }
.badge-info { background-color: var(--info-color); color: white; }
.badge-secondary { background-color: var(--secondary-color); color: white; }

/* SLA Compliance Cards */
.sla-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.sla-stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-top: 4px solid transparent;
    position: relative;
}

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

.sla-stat-card .sla-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.sla-stat-card .sla-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sla-stat-card .sla-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Compliance rate card - large hero */
.sla-stat-card.sla-hero {
    grid-column: span 2;
    flex-direction: row;
    gap: 24px;
    padding: 28px 32px;
}

.sla-stat-card.sla-hero .sla-icon {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
}

.sla-stat-card.sla-hero .sla-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.sla-stat-card.sla-hero .sla-value {
    font-size: 36px;
}

.sla-stat-card.sla-hero .sla-degree {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

/* Color variants */
.sla-stat-card.sla-success { border-top-color: var(--success-color); }
.sla-stat-card.sla-success .sla-icon { background: rgba(25, 135, 84, 0.12); color: var(--success-color); }
.sla-stat-card.sla-success .sla-value { color: var(--success-color); }
.sla-stat-card.sla-success .sla-degree { background: rgba(25, 135, 84, 0.12); color: var(--success-color); }

.sla-stat-card.sla-warn { border-top-color: var(--warning-color); }
.sla-stat-card.sla-warn .sla-icon { background: rgba(255, 193, 7, 0.15); color: #b58100; }
.sla-stat-card.sla-warn .sla-value { color: #b58100; }
.sla-stat-card.sla-warn .sla-degree { background: rgba(255, 193, 7, 0.15); color: #b58100; }

.sla-stat-card.sla-danger { border-top-color: var(--danger-color); }
.sla-stat-card.sla-danger .sla-icon { background: rgba(220, 53, 69, 0.12); color: var(--danger-color); }
.sla-stat-card.sla-danger .sla-value { color: var(--danger-color); }
.sla-stat-card.sla-danger .sla-degree { background: rgba(220, 53, 69, 0.12); color: var(--danger-color); }

.sla-stat-card.sla-info { border-top-color: var(--info-color); }
.sla-stat-card.sla-info .sla-icon { background: rgba(13, 202, 240, 0.12); color: var(--info-color); }

.sla-stat-card.sla-primary { border-top-color: var(--primary-color); }
.sla-stat-card.sla-primary .sla-icon { background: rgba(37, 99, 235, 0.12); color: var(--primary-color); }

/* SLA progress bar */
.sla-progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.sla-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.sla-progress-fill.fill-success { background: var(--success-color); }
.sla-progress-fill.fill-warning { background: var(--warning-color); }
.sla-progress-fill.fill-danger { background: var(--danger-color); }

/* SLA section divider */
.sla-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sla-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Resolution Heatmap (GitHub-style, table-based) */
.heatmap-container {
    overflow-x: auto;
    padding: 4px 0;
}

.hm-table {
    border-collapse: separate;
    border-spacing: 3px;
}

.hm-table th,
.hm-table td {
    padding: 0;
    border: none;
}

.hm-month {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    padding-bottom: 6px !important;
}

.hm-day-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 6px !important;
    width: 32px;
    white-space: nowrap;
}

.hm-cell {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    outline: 1px solid rgba(27, 31, 35, 0.06);
    outline-offset: -1px;
}

.hm-cell:not(.hm-empty):not(.hm-future):hover {
    outline: 2px solid var(--text-primary);
    outline-offset: -1px;
}

.hm-empty,
.hm-future {
    outline: none;
}

.hm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 4px;
}

.hm-summary {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.hm-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .sla-stats-grid { grid-template-columns: 1fr 1fr; }
    .sla-stat-card.sla-hero { grid-column: span 2; flex-direction: column; text-align: center; }
    .sla-stat-card.sla-hero .sla-hero-content { align-items: center; }
}
.badge-primary { background-color: var(--primary-color); color: white; }

/* Button warning style */
.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    color: white;
}

/* Text utilities */
.text-warning {
    color: var(--warning-color);
}

/* ========================================
   WORKFLOW AUTOMATION STYLES
   ======================================== */
.workflow-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.workflow-rules-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.workflow-rule-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.workflow-rule-card.inactive {
    opacity: 0.7;
    background: var(--bg-color);
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.rule-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rule-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.rule-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.rule-actions {
    display: flex;
    gap: 5px;
}

.rule-body {
    padding: 15px 20px;
}

.rule-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.rule-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.rule-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.rule-detail i {
    color: var(--primary-color);
    width: 16px;
}

.rule-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rule-stats {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.rule-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rule-validity {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Workflow form sections */
.form-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h4 i {
    color: var(--primary-color);
}

/* Condition and action rows */
.condition-row,
.action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.condition-row .form-control,
.action-row .form-control {
    flex-shrink: 0;
}

.action-params {
    display: flex;
    gap: 5px;
    flex: 1;
}

.action-params .form-control {
    flex: 1;
}

.btn-remove-condition,
.btn-remove-action {
    flex-shrink: 0;
}

/* Checkbox inline */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

/* Test result styling */
.test-result.success {
    background: #d1fae5;
    padding: 20px;
    border-radius: var(--border-radius);
}

.test-result.error {
    background: #fee2e2;
    padding: 20px;
    border-radius: var(--border-radius);
}

.result-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.test-result.success .result-status {
    color: var(--success-color);
}

.test-result.error .result-status {
    color: var(--danger-color);
}

.result-details .detail-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.result-details label {
    font-weight: 600;
    min-width: 80px;
}

/* ========== Language Toggle Button ========== */
.btn-lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.btn-lang-toggle:hover {
    background: var(--bg-hover);
}

.sidebar.collapsed .btn-lang-toggle span {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    padding: 15px 8px;
}

.sidebar.collapsed .btn-lang-toggle {
    justify-content: center;
    padding: 8px 0;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .btn-logout {
    justify-content: center;
    padding: 10px 0;
}

/* ========== RTL Support ========== */
[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

[dir="rtl"] .sidebar.collapsed + .main-content {
    margin-left: 0;
    margin-right: 60px;
}

[dir="rtl"] .nav-item {
    text-align: right;
}

[dir="rtl"] .search-box i {
    left: auto;
    right: 14px;
}

[dir="rtl"] .search-box input {
    padding: 12px 44px 12px 14px;
}

[dir="rtl"] .toast-container {
    right: auto;
    left: 20px;
}

[dir="rtl"] .toast {
    direction: rtl;
}

[dir="rtl"] .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* RTL mobile overrides */
@media (max-width: 768px) {
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }

    [dir="rtl"] .main-content {
        margin-right: 0;
    }
}

/* Kanban Board */
.kanban-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.kanban-filters select,
.kanban-filters input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 160px;
}

.kanban-board {
    display: flex;
    gap: 16px;
    min-height: calc(100vh - 280px);
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    flex: 1;
    min-width: 300px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.kanban-column-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.kanban-column-count {
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: 50%;
    min-width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.kanban-column-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
}

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

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kanban-card-number {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
}

.kanban-card-subject {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-primary);
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kanban-card-assignee {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-card-assignee i {
    color: var(--primary-light);
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.kanban-assign-btn {
    padding: 3px 8px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
}

.kanban-empty {
    text-align: center;
    color: var(--text-light);
    padding: 40px 20px;
    font-style: italic;
}

.kanban-card-due {
    font-size: 11px;
}

.kanban-card-due.overdue {
    color: var(--danger-color);
    font-weight: 600;
}

/* ─── Attachment Upload Area ─── */
.upload-area {
    border: 2px dashed var(--border-color, #dee2e6);
    border-radius: var(--border-radius, 8px);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-color, #f8f9fa);
    margin-bottom: 15px;
}
.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(111, 66, 193, 0.05);
}
.upload-area i {
    font-size: 2em;
    color: var(--text-secondary, #6c757d);
    margin-bottom: 8px;
}
.upload-area p {
    margin: 5px 0 0;
    color: var(--text-secondary, #6c757d);
    font-size: 0.85em;
}

.attachment-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.attachment-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.attachment-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.attachment-preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.attachment-thumb {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.15s;
}
.attachment-thumb:hover {
    transform: scale(1.05);
}
.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Image Lightbox ─── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0,0,0,0.6);
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
}
.lightbox-counter {
    display: inline;
    margin-left: 10px;
    opacity: 0.7;
}

/* ─── My Maintenance View ─── */
.my-maintenance-header {
    margin-bottom: 20px;
}

.my-maintenance-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.my-maint-tab {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.my-maint-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.my-maint-tab.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.my-maint-tab.tab-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.my-maint-tab.tab-danger.active {
    background: var(--danger-color);
    color: #fff;
}

.my-maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.my-maint-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-left: 4px solid var(--primary-color);
}

.my-maint-card.urgency-overdue {
    border-left-color: var(--danger-color);
}

.my-maint-card.urgency-today {
    border-left-color: #fd7e14;
}

.my-maint-card.urgency-week {
    border-left-color: #ffc107;
}

.my-maint-card.urgency-upcoming {
    border-left-color: var(--success-color);
}

.my-maint-card-left {
    flex: 1;
    min-width: 0;
}

.my-maint-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.my-maint-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.my-maint-asset-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.my-maint-asset-link:hover {
    text-decoration: underline;
}

.my-maint-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.my-maint-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.my-maint-due {
    text-align: right;
}

.my-maint-due-date {
    font-size: 14px;
    font-weight: 600;
}

.my-maint-due-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.my-maint-due.urgency-overdue .my-maint-due-date,
.my-maint-due.urgency-overdue .my-maint-due-label {
    color: var(--danger-color);
}

.my-maint-due.urgency-today .my-maint-due-date {
    color: #fd7e14;
}

.my-maint-actions {
    display: flex;
    gap: 5px;
}

.my-maint-instances {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 12px;
    margin-top: -2px;
}

/* RTL adjustments for my-maintenance */
[dir="rtl"] .my-maint-card {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

[dir="rtl"] .my-maint-card.urgency-overdue {
    border-right-color: var(--danger-color);
}

[dir="rtl"] .my-maint-card.urgency-today {
    border-right-color: #fd7e14;
}

[dir="rtl"] .my-maint-card.urgency-week {
    border-right-color: #ffc107;
}

[dir="rtl"] .my-maint-card.urgency-upcoming {
    border-right-color: var(--success-color);
}

[dir="rtl"] .my-maint-card-right {
    align-items: flex-start;
}

[dir="rtl"] .my-maint-due {
    text-align: left;
}

/* ─── CMDB Module ─────────────────────────────────────────── */

/* CI State Badges */
.ci-state-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.ci-state-operational { background: #d1fae5; color: #065f46; }
.ci-state-nonoperational { background: #fee2e2; color: #991b1b; }
.ci-state-maintenance { background: #fef3c7; color: #92400e; }
.ci-state-decommissioned { background: #e5e7eb; color: #4b5563; }

/* CI Impact Badges */
.ci-impact-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: .75rem; font-weight: 600; }
.ci-impact-high { background: #fee2e2; color: #991b1b; }
.ci-impact-medium { background: #fef3c7; color: #92400e; }
.ci-impact-low { background: #d1fae5; color: #065f46; }

/* CI Assignments */
.cmdb-assignments-list { display: flex; flex-direction: column; gap: 6px; }
.cmdb-assignment-item { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.cmdb-assignment-item i { color: #6c757d; width: 16px; }
.cmdb-assignment-row select { font-size: .85rem; }
.cmdb-actions-cell { white-space: nowrap; display: flex; gap: 4px; }

.cmdb-loading { text-align: center; padding: 60px 20px; color: #6c757d; font-size: 1.1rem; }
.cmdb-layout { display: flex; gap: 0; min-height: calc(100vh - 120px); background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Tree Panel */
.cmdb-tree-panel { width: 260px; min-width: 260px; border-right: 1px solid #e9ecef; background: #f8f9fa; display: flex; flex-direction: column; }
.cmdb-tree-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #e9ecef; }
.cmdb-tree-header h6 { margin: 0; font-size: .85rem; color: #495057; }
.cmdb-tree-list { overflow-y: auto; flex: 1; padding: 8px 0; }
.cmdb-tree-node { display: flex; align-items: center; gap: 8px; padding: 7px 16px; cursor: pointer; font-size: .85rem; color: #495057; transition: background .15s; position: relative; }
.cmdb-tree-node:hover { background: #e9ecef; }
.cmdb-tree-node.active { background: #e3f2fd; color: #1565c0; font-weight: 600; }
.cmdb-tree-toggle { font-size: .7rem; cursor: pointer; width: 14px; text-align: center; }
.cmdb-tree-spacer { width: 14px; display: inline-block; }
.cmdb-tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdb-tree-count { font-size: .75rem; color: #adb5bd; }
.cmdb-tree-actions { display: none; gap: 4px; font-size: .75rem; }
.cmdb-tree-node:hover .cmdb-tree-actions { display: flex; }
.cmdb-tree-actions i { padding: 2px 4px; border-radius: 3px; cursor: pointer; }
.cmdb-tree-actions i:hover { background: #dee2e6; }

/* Content Panel */
.cmdb-content-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cmdb-breadcrumb { padding: 10px 20px; font-size: .85rem; color: #6c757d; border-bottom: 1px solid #f0f0f0; }
.cmdb-breadcrumb-link { cursor: pointer; color: #0d6efd; }
.cmdb-breadcrumb-link:hover { text-decoration: underline; }
.cmdb-breadcrumb i { font-size: .65rem; margin: 0 4px; color: #adb5bd; }

/* Toolbar */
.cmdb-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #e9ecef; gap: 12px; flex-wrap: wrap; }
.cmdb-toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.cmdb-toolbar-right { display: flex; align-items: center; gap: 8px; }
.cmdb-search { position: relative; flex: 1; max-width: 320px; }
.cmdb-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #adb5bd; font-size: .85rem; }
.cmdb-search input { width: 100%; padding: 6px 12px 6px 32px; border: 1px solid #dee2e6; border-radius: 6px; font-size: .85rem; }
.cmdb-search input:focus { outline: none; border-color: #86b7fe; box-shadow: 0 0 0 3px rgba(13,110,253,.15); }
.cmdb-status-filter { padding: 6px 10px; border: 1px solid #dee2e6; border-radius: 6px; font-size: .85rem; background: #fff; }

/* Table */
.cmdb-table-wrap { flex: 1; overflow: auto; }
.cmdb-table { width: 100%; border-collapse: collapse; }
.cmdb-table thead th { position: sticky; top: 0; background: #f8f9fa; padding: 10px 16px; font-size: .8rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid #e9ecef; text-align: left; white-space: nowrap; }
.cmdb-table tbody td { padding: 10px 16px; font-size: .85rem; border-bottom: 1px solid #f0f0f0; }
.cmdb-row { cursor: pointer; transition: background .15s; }
.cmdb-row:hover { background: #f8f9fa; }
.cmdb-item-name { font-weight: 600; color: #212529; }
.cmdb-item-tag { font-size: .75rem; color: #adb5bd; }

/* CI Type Badge */
.ci-type-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: .75rem; font-weight: 600; color: #fff; background: #6c757d; }

/* Pagination */
.cmdb-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px 20px; border-top: 1px solid #e9ecef; }
.cmdb-page-ellipsis { padding: 0 6px; color: #adb5bd; }

/* ─── CI Detail ─────────────────────────────────────── */
.cmdb-detail { background: #fff; min-height: calc(100vh - 120px); }
.cmdb-detail-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid #e9ecef; gap: 16px; }
.cmdb-detail-header-left { display: flex; align-items: center; gap: 16px; }
.cmdb-detail-title-wrap { }
.cmdb-detail-name { margin: 0; font-size: 1.2rem; }
.cmdb-detail-badges { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cmdb-detail-header-right { display: flex; gap: 8px; }
.asset-criticality-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: .75rem; font-weight: 600; }
.criticality-low { background: #d4edda; color: #155724; }
.criticality-medium { background: #fff3cd; color: #856404; }
.criticality-high { background: #f8d7da; color: #721c24; }
.criticality-critical { background: #721c24; color: #fff; }

/* Detail Tabs */
.cmdb-detail-tabs { display: flex; gap: 0; border-bottom: 2px solid #e9ecef; padding: 0 24px; flex-wrap: wrap; }
.cmdb-tab { padding: 10px 18px; border: none; background: none; cursor: pointer; font-size: .85rem; color: #6c757d; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: all .15s; }
.cmdb-tab:hover { color: #212529; background: #f8f9fa; }
.cmdb-tab.active { color: #0d6efd; border-bottom-color: #0d6efd; font-weight: 600; }

/* Tab Content */
.cmdb-detail-body { padding: 24px; }
.cmdb-empty { text-align: center; padding: 48px 20px; color: #adb5bd; }
.cmdb-empty i { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.cmdb-empty p { margin: 0; font-size: .95rem; }
.cmdb-section-toolbar { margin-bottom: 16px; }

/* Overview Grid */
.cmdb-overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.cmdb-overview-section h6 { font-size: .85rem; font-weight: 600; color: #495057; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #e9ecef; }
.cmdb-overview-full { grid-column: 1 / -1; }
.cmdb-field { margin-bottom: 10px; }
.cmdb-field-label { font-size: .75rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.cmdb-field-value { font-size: .9rem; color: #212529; }

/* Attributes Grid */
.cmdb-attributes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Relationships */
.cmdb-rel-table { margin-top: 0; }
.cmdb-rel-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: .75rem; font-weight: 600; color: #fff; }
.cmdb-ci-link { color: #0d6efd; text-decoration: none; font-weight: 500; }
.cmdb-ci-link:hover { text-decoration: underline; }

/* Impact Analysis */
.cmdb-impact-analysis { }
.cmdb-impact-section { margin-bottom: 24px; }
.cmdb-impact-section h6 { font-size: .85rem; font-weight: 600; color: #495057; margin-bottom: 10px; }
.cmdb-impact-root { padding: 16px; background: #e3f2fd; border-radius: 8px; margin-bottom: 24px; border-left: 4px solid #0d6efd; }
.cmdb-impact-node { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; margin-bottom: 4px; background: #f8f9fa; border: 1px solid #e9ecef; }
.cmdb-impact-rel { font-size: .7rem; padding: 2px 8px; background: #e9ecef; border-radius: 8px; color: #6c757d; font-weight: 600; }

/* History Timeline */
.cmdb-history-timeline { }
.cmdb-history-entry { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.cmdb-history-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f8f9fa; flex-shrink: 0; }
.cmdb-history-content { flex: 1; }
.cmdb-history-action { font-size: .85rem; font-weight: 500; }
.cmdb-history-values { font-size: .8rem; margin-top: 4px; }
.cmdb-history-old { color: #dc3545; text-decoration: line-through; }
.cmdb-history-new { color: #198754; font-weight: 500; }
.cmdb-history-meta { font-size: .75rem; color: #adb5bd; margin-top: 4px; }

/* Type Designer */
.cmdb-type-designer { padding: 24px; }
.cmdb-type-designer-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.cmdb-type-designer-header h5 { flex: 1; margin: 0; }
.cmdb-type-list { }
.cmdb-type-card { border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.cmdb-type-card-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.cmdb-type-card-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .9rem; }
.cmdb-type-card-info { flex: 1; }
.cmdb-type-card-info strong { display: block; font-size: .9rem; }
.cmdb-type-card-info small { color: #6c757d; font-size: .8rem; }
.cmdb-type-card-actions { display: flex; align-items: center; gap: 8px; }
.cmdb-type-schema { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 12px; border-top: 1px solid #f0f0f0; }
.cmdb-schema-field { font-size: .75rem; padding: 3px 10px; background: #f0f0f0; border-radius: 12px; color: #495057; display: inline-flex; align-items: center; gap: 4px; }

/* Schema Form Rows */
.cmdb-schema-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cmdb-schema-row input[type="text"] { flex: 1; }
.cmdb-schema-row select { width: 100px; }
.cmdb-schema-req { display: flex; align-items: center; gap: 4px; font-size: .8rem; white-space: nowrap; }

/* Responsive */
@media (max-width: 768px) {
    .cmdb-layout { flex-direction: column; }
    .cmdb-tree-panel { width: 100%; min-width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid #e9ecef; }
    .cmdb-overview-grid { grid-template-columns: 1fr; }
    .cmdb-attributes-grid { grid-template-columns: 1fr; }
    .cmdb-detail-header { flex-direction: column; }
}

/* RTL Support */
[dir="rtl"] .cmdb-tree-panel { border-right: none; border-left: 1px solid #e9ecef; }
[dir="rtl"] .cmdb-search i { left: auto; right: 10px; }
[dir="rtl"] .cmdb-search input { padding: 6px 32px 6px 12px; }
[dir="rtl"] .cmdb-table thead th { text-align: right; }
[dir="rtl"] .cmdb-impact-root { border-left: none; border-right: 4px solid #0d6efd; }
