:root {
    --color-primary: #0f4c75;
    --color-primary-dark: #093550;
    --color-primary-light: #1b7aa2;
    --color-accent: #3282b8;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-text: #1f2937;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-bg: #f3f4f6;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-sidebar: #0f172a;
    --color-sidebar-hover: #1e293b;
    --color-sidebar-active: #1b7aa2;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.625rem;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sidebar-width: 240px;
    --topbar-height: 60px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    height: var(--topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-title {
    font-weight: 700;
    color: white;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.625rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.22);
    border: 2px solid var(--color-sidebar);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.38);
}

.nav-section {
    margin-bottom: 1.25rem;
}

.nav-section-title {
    display: block;
    padding: 0 0.625rem;
    margin-bottom: 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.125rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background-color: var(--color-sidebar-hover);
    color: #f1f5f9;
}

.nav-link.active {
    background-color: rgba(27, 122, 162, 0.2);
    color: white;
    box-shadow: inset 3px 0 0 0 var(--color-primary-light);
}

.nav-link i {
    font-size: 1rem;
    width: 1.125rem;
    text-align: center;
}

.sidebar-signout {
    flex-shrink: 0;
    padding: 0.75rem 0.75rem 0.875rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), var(--color-sidebar) 22%);
}

.sidebar-signout-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 50px;
    padding: 0.625rem 0.75rem;
    color: #cbd5e1;
    text-decoration: none;
    background-color: rgba(30, 41, 59, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-signout-link:hover {
    color: #ffffff;
    background-color: rgba(51, 65, 85, 0.96);
    border-color: rgba(148, 163, 184, 0.32);
    transform: translateY(-1px);
}

.sidebar-signout-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    background-color: rgba(239, 68, 68, 0.16);
    border-radius: var(--radius-sm);
}

.sidebar-signout-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-signout-text strong {
    font-size: 0.8125rem;
    font-weight: 600;
}

.sidebar-signout-text small {
    margin-top: 0.125rem;
    color: #94a3b8;
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    height: var(--topbar-height);
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.375rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-right: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
}

.sidebar-toggle:hover {
    background-color: var(--color-bg);
    color: var(--color-text);
}

.topbar-search {
    flex: 1;
    max-width: 360px;
}

.search-input {
    position: relative;
}

.search-input i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.search-input input {
    width: 100%;
    padding: 0.4375rem 0.875rem 0.4375rem 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background-color: var(--color-bg);
    font-size: 0.8125rem;
    color: var(--color-text);
    transition: all 0.15s ease;
}

.search-input input:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(50, 130, 184, 0.08);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-left: auto;
}

.action-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background-color: white;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.action-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--color-danger);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.35rem;
    border-radius: 999px;
    border: 2px solid white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border: 0;
    border-radius: 999px;
    background-color: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.user-menu:hover,
.user-menu:focus-visible,
.user-menu.show {
    background-color: var(--color-bg);
    color: var(--color-primary);
}

.user-menu:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.38);
    outline-offset: 2px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(15, 76, 117, 0.12);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.25;
}

.user-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chevron {
    margin-right: 0.25rem;
    font-size: 0.625rem;
    transition: transform 0.15s ease;
}

.user-menu.show .user-menu-chevron {
    transform: rotate(180deg);
}

.user-role {
    font-size: 0.6875rem;
    color: var(--color-text-secondary);
}

/* Notification dropdown */
.notification-dropdown {
    width: 360px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.notification-header h6 {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.notification-body {
    max-height: 360px;
    overflow-y: auto;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
}

.notification-empty p {
    margin: 0;
    font-size: 0.8125rem;
}

.notification-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

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

.notification-item:hover {
    background-color: #f8fafc;
}

.notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

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

.notification-title {
    margin: 0 0 0.25rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
    line-height: 1.35;
}

.notification-text {
    margin: 0 0 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.notification-severity {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.notification-footer {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
    background-color: #fafbfc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* User dropdown */
.user-dropdown {
    width: 280px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-dropdown-info .user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
}

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

.user-dropdown-info .user-role {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-top: 0.125rem;
}

.user-dropdown .dropdown-item {
    padding: 0.625rem 1rem;
}

/* Profile page */
.profile-avatar {
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.5rem;
}

.profile-hero {
    position: relative;
    overflow: hidden;
    padding: 2rem 1.5rem 1.75rem;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 45%, var(--color-accent) 100%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 16px 40px rgba(9, 53, 80, 0.18);
}

.profile-hero::before,
.profile-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.profile-hero::before {
    width: 220px;
    height: 220px;
    top: -110px;
    right: -70px;
}

.profile-hero::after {
    width: 180px;
    height: 180px;
    bottom: -90px;
    left: -60px;
}

.profile-hero-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(8px);
}

.profile-avatar-large {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(135deg, #ffffff 0%, #eaf4fb 100%);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2.5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
}

.profile-hero-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.profile-hero-email {
    color: rgba(248, 250, 252, 0.82);
    font-size: 0.95rem;
}

.profile-role-badge {
    background: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
}

.profile-hero-meta {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.profile-hero-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    backdrop-filter: blur(6px);
}

.profile-hero-meta-item .text-success {
    color: #d1fae5 !important;
}

.profile-hero-meta-label {
    color: rgba(248, 250, 252, 0.74);
    font-size: 0.8rem;
}

.profile-hero-meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.profile-form .input-group-text {
    background-color: #f8fafc;
    border-right: 0;
    color: var(--color-primary);
    padding: 0.75rem 0.9rem;
}

.profile-form .form-control {
    border-left: 0;
    color: var(--color-text);
    padding: 0.75rem 0.9rem;
}

.profile-form .form-control:focus {
    box-shadow: none;
    border-color: var(--color-primary-light);
    background-color: #ffffff;
}

.profile-form .form-control:disabled {
    background-color: #f8fafc;
    color: var(--color-text-secondary);
}

.profile-form .form-label {
    color: var(--color-text);
    font-weight: 600;
    margin-bottom: 0.55rem;
}

.profile-form .form-text {
    color: var(--color-text-secondary);
}

.app-content {
    flex: 1;
}

.app-content > .container-fluid {
    padding: 1.25rem;
}

.app-footer {
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 0.875rem 1.25rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.page-title h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.page-title p {
    color: var(--color-text-secondary);
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid rgba(15, 76, 117, 0.08);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-header h5 {
    font-weight: 600;
    margin: 0;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.card-body {
    padding: 1.35rem 1.35rem 1.5rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card form .row {
    row-gap: 1rem;
}

.card form .row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.card form .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #334155;
    margin-bottom: 0.45rem;
}

.card form .form-control,
.card form .form-select,
.card form textarea.form-control {
    min-height: 42px;
    padding: 0.7rem 0.85rem;
    border: 1px solid #d7e2eb;
    border-radius: 0.8rem;
    background-color: #fcfdff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.card form .form-control:focus,
.card form .form-select:focus,
.card form textarea.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(50, 130, 184, 0.12), inset 0 1px 2px rgba(15, 23, 42, 0.03);
    background-color: #ffffff;
}

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

.card form .btn {
    min-height: 42px;
    border-radius: 0.8rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(15, 76, 117, 0.12);
}

.card form .btn:hover {
    transform: translateY(-1px);
}

.card form .btn-outline-secondary {
    box-shadow: none;
}

.card .alert {
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 76, 117, 0.08);
}

/* Tables */
.table {
    font-size: 0.8125rem;
    margin-bottom: 0;
    color: var(--color-text);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
    color: #475569;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #dbe3eb;
    border-top: none;
    padding: 0.95rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.25;
}

.table tbody td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    line-height: 1.5;
    background-color: #ffffff;
}

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

.table tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.table tbody tr:hover td {
    background-color: #f4f8fb;
}

.table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.table tbody tr:nth-child(even) td {
    background-color: #fbfcfe;
}

.table tbody tr:nth-child(even):hover td {
    background-color: #f4f8fb;
}

.table tfoot td,
.table tfoot th {
    border-top: 2px solid var(--color-border);
    background-color: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
}

.table-responsive {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card .table-responsive {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.table-actions {
    display: inline-flex;
    gap: 0.375rem;
    align-items: center;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Empty table state */
table.dataTable td.dataTables_empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    background-color: #fafbfc;
}

.btn {
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.4375rem 0.875rem;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
}

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

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

.btn-outline-secondary {
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.status-active { background-color: #d1fae5; color: #065f46; }
.status-active::before { background-color: var(--color-success); }

.status-in-service { background-color: #dbeafe; color: #1e40af; }
.status-in-service::before { background-color: var(--color-info); }

.status-under-repair { background-color: #fef3c7; color: #92400e; }
.status-under-repair::before { background-color: var(--color-warning); }

.status-grounded { background-color: #fee2e2; color: #991b1b; }
.status-grounded::before { background-color: var(--color-danger); }

.status-disposed { background-color: #f3f4f6; color: #4b5563; }
.status-disposed::before { background-color: var(--color-text-muted); }

.status-pending { background-color: #fef3c7; color: #92400e; }
.status-pending::before { background-color: var(--color-warning); }

.status-approved { background-color: #d1fae5; color: #065f46; }
.status-approved::before { background-color: var(--color-success); }

.status-rejected { background-color: #fee2e2; color: #991b1b; }
.status-rejected::before { background-color: var(--color-danger); }

.status-cancelled { background-color: #f3f4f6; color: #4b5563; }
.status-cancelled::before { background-color: var(--color-text-muted); }

.status-completed { background-color: #dbeafe; color: #1e40af; }
.status-completed::before { background-color: var(--color-info); }

.status-info { background-color: #dbeafe; color: #1e40af; }
.status-info::before { background-color: var(--color-info); }

.status-warning { background-color: #fef3c7; color: #92400e; }
.status-warning::before { background-color: var(--color-warning); }

.status-critical { background-color: #fee2e2; color: #991b1b; }
.status-critical::before { background-color: var(--color-danger); }

.status-delivery { background-color: #d1fae5; color: #065f46; }
.status-delivery::before { background-color: var(--color-success); }

.status-withdrawal { background-color: #fee2e2; color: #991b1b; }
.status-withdrawal::before { background-color: var(--color-danger); }

.status-coupon { background-color: #fef3c7; color: #92400e; }
.status-coupon::before { background-color: var(--color-warning); }

.status-adjustment { background-color: #dbeafe; color: #1e40af; }
.status-adjustment::before { background-color: var(--color-info); }

.status-opening { background-color: #f3f4f6; color: #4b5563; }
.status-opening::before { background-color: var(--color-text-muted); }

.status-depot { background-color: #dbeafe; color: #1e40af; }
.status-depot::before { background-color: var(--color-info); }

.status-available { background-color: #d1fae5; color: #065f46; }
.status-available::before { background-color: var(--color-success); }

.status-issued { background-color: #dbeafe; color: #1e40af; }
.status-issued::before { background-color: var(--color-info); }

.status-used { background-color: #f3f4f6; color: #4b5563; }
.status-used::before { background-color: var(--color-text-muted); }

.status-expired { background-color: #fef3c7; color: #92400e; }
.status-expired::before { background-color: var(--color-warning); }

.metric-card {
    background: linear-gradient(145deg, var(--color-surface), #f8fafc);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-primary-light), var(--color-accent));
    opacity: 0.8;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.metric-card.text-center::before {
    display: none;
}

.metric-card.text-center {
    border-top: 3px solid var(--color-primary-light);
}

.metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.metric-value small {
    font-size: 0.75rem;
    font-weight: 500;
}

.metric-change {
    font-size: 0.75rem;
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px dashed var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(50, 130, 184, 0.08);
    color: var(--color-primary);
}

.metric-icon.text-success { background: rgba(16, 185, 129, 0.08); color: var(--color-success); }
.metric-icon.text-warning { background: rgba(245, 158, 11, 0.08); color: var(--color-warning); }
.metric-icon.text-danger  { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); }
.metric-icon.text-info    { background: rgba(59, 130, 246, 0.08); color: var(--color-info); }
.metric-icon.text-primary { background: rgba(15, 76, 117, 0.08); color: var(--color-primary); }

.vehicle-hero-card {
    overflow: hidden;
    border: 1px solid rgba(15, 76, 117, 0.14);
    box-shadow: 0 14px 40px rgba(15, 76, 117, 0.08);
}

.vehicle-hero-media {
    position: relative;
    min-height: 220px;
    background: linear-gradient(135deg, #f8fbff 0%, #e8f1f8 100%);
}

.vehicle-hero-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.vehicle-hero-placeholder {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--color-primary);
}

.vehicle-hero-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.vehicle-summary-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: 0.2rem;
}

.vehicle-progress {
    height: 0.45rem;
    background-color: #e5eef6;
}

.vehicle-progress .progress-bar {
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent));
}

.analytics-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.insight-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(15, 76, 117, 0.06), rgba(91, 192, 190, 0.1));
    border: 1px solid rgba(15, 76, 117, 0.1);
}

.vehicle-history-badge {
    background: rgba(15, 76, 117, 0.08);
    color: var(--color-primary);
}

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

.form-control, .form-select {
    border-color: var(--color-border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    padding: 0.4375rem 0.75rem;
    line-height: 1.5;
    transition: all 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(50, 130, 184, 0.08);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

.form-check-label {
    font-size: 0.8125rem;
    color: var(--color-text);
}

.form-check-input {
    border-color: var(--color-border);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-text {
    font-size: 0.75rem;
}

.file-drop-zone {
    position: relative;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    background-color: #f8fafc;
    padding: 1rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.file-drop-zone.is-dragover {
    border-color: var(--color-accent);
    background-color: #eef7fb;
    box-shadow: 0 0 0 3px rgba(50, 130, 184, 0.08);
}

.file-drop-zone .form-control[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-drop-content {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 78px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

.file-drop-content i {
    color: var(--color-primary);
    font-size: 2rem;
}

.file-drop-content strong,
.file-drop-content span {
    display: block;
}

.file-drop-content strong {
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
}

.file-drop-content span {
    font-size: 0.75rem;
}

.file-drop-selection {
    position: relative;
    z-index: 1;
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.file-drop-selection.has-files {
    display: block;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-color: var(--color-border) !important;
    border-radius: var(--radius) !important;
    min-height: 36px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
    padding-left: 0.75rem;
    font-size: 0.8125rem;
}

.vehicle-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-bg), #e5e7eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 2rem;
}

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

.details-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--color-border);
}

.details-list li:last-child {
    border-bottom: none;
}

.details-list li span {
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
}

.details-list li strong {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.8125rem;
}

.document-item {
    background-color: #f9fafb;
    transition: background-color 0.15s ease;
}

.document-item:hover {
    background-color: #f3f4f6;
}

.insight-selectable {
    border: 1px solid transparent;
    border-radius: 0.85rem;
    margin-bottom: 0.5rem;
    padding: 0.8rem 0.9rem;
    transition: all 0.15s ease;
    background-color: transparent;
    text-align: left;
}

.insight-selectable:hover,
.insight-selectable.active {
    background: linear-gradient(135deg, rgba(15, 76, 117, 0.05), rgba(50, 130, 184, 0.08));
    border-color: rgba(15, 76, 117, 0.12);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
    transform: translateY(-1px);
}

.insight-preview {
    border: 1px solid rgba(15, 76, 117, 0.1);
    border-radius: 0.95rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.98));
}

/* DataTables */
.dataTables_wrapper {
    padding-top: 0;
}

/* Top and bottom control rows */
.dataTables_wrapper .row {
    --bs-gutter-y: 0;
    align-items: center;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .row:first-child {
    margin-bottom: 0 !important;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dataTables_wrapper .row:last-child {
    margin-top: 0 !important;
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--color-border);
    background-color: #f8fafc;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 0;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter {
    text-align: right;
}

.dataTables_wrapper .dataTables_length select {
    display: inline-block;
    width: auto;
    min-width: 70px;
    padding: 0.375rem 1.75rem 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--color-text);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.15s ease;
}

.dataTables_wrapper .dataTables_length select:hover,
.dataTables_wrapper .dataTables_filter input:hover {
    border-color: #cbd5e1;
}

.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(50, 130, 184, 0.08);
}

.dataTables_wrapper .dataTables_filter input {
    display: inline-block;
    width: auto;
    min-width: 240px;
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text);
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-left: 0;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(50, 130, 184, 0.08);
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.325rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.625rem !important;
    border-radius: var(--radius) !important;
    border: 1px solid #dbe3eb !important;
    margin: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    color: var(--color-text-secondary) !important;
    background: #ffffff !important;
    line-height: 1 !important;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: #eef7fb !important;
    color: var(--color-primary) !important;
    border-color: rgba(50, 130, 184, 0.28) !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(15, 76, 117, 0.12);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent)) !important;
    color: white !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 8px 18px rgba(15, 76, 117, 0.24);
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-weight: 600;
    gap: 0.25rem;
    padding: 0 0.75rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous::before {
    content: '\f284';
    font-family: 'bootstrap-icons';
    font-size: 0.875rem;
    font-weight: 400;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.next::after {
    content: '\f285';
    font-family: 'bootstrap-icons';
    font-size: 0.875rem;
    font-weight: 400;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--color-text-muted) !important;
    background: #f1f5f9 !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: transparent !important;
    border-color: transparent !important;
}

.dataTables_wrapper .dataTables_paginate .ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    user-select: none;
}

@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100%;
        min-width: unset;
    }

    .dataTables_wrapper .dataTables_paginate {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .row:first-child > [class*="col-"] + [class*="col-"] {
        margin-top: 0.5rem;
    }
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.25rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background-color: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.125rem;
    top: 0.25rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--color-border);
}

.timeline-marker.success { background-color: var(--color-success); }
.timeline-marker.warning { background-color: var(--color-warning); }
.timeline-marker.danger { background-color: var(--color-danger); }
.timeline-marker.info { background-color: var(--color-info); }

.timeline-content {
    background-color: #f9fafb;
    border-radius: var(--radius);
    padding: 0.875rem;
    border: 1px solid var(--color-border);
}

.timeline-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.timeline-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.375rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.empty-state-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.empty-state-text {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

/* Nav subsections */
.nav-subsection {
    padding-left: 1.75rem;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

/* Form section */
.form-section {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(15, 76, 117, 0.08);
    border-radius: 0.95rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.96));
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(15, 76, 117, 0.08);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.875rem;
}

/* Inspection checklist */
.inspection-category {
    background-color: #f9fafb;
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--color-border);
    margin-bottom: 0.875rem;
}

.inspection-category-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.875rem;
    color: var(--color-text);
}

/* Tab navigation */
.nav-tabs-faoms {
    border-bottom: 1px solid var(--color-border);
    gap: 0.25rem;
}

.nav-tabs-faoms .nav-link {
    color: var(--color-text-secondary);
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
}

.nav-tabs-faoms .nav-link:hover {
    color: var(--color-text);
    border-color: var(--color-border);
    background-color: transparent;
}

.nav-tabs-faoms .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: transparent;
}

/* Action toolbar */
.action-toolbar {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.6875rem;
    padding: 0.3em 0.55em;
}

/* List group */
.list-group-item {
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
    border-color: var(--color-border);
}

/* Alerts */
.alert {
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
}

/* Dropdown */
.dropdown-item {
    font-size: 0.8125rem;
    padding: 0.5rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item i {
    font-size: 0.9375rem;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

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

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

    .topbar-search {
        display: none;
    }

    .page-header {
        flex-direction: column;
    }

    .page-actions {
        justify-content: flex-start;
        width: 100%;
    }
}
