/* =====================================================
   SISTEMA DE ASSISTÊNCIA TÉCNICA - DESIGN SYSTEM
   Premium Dark Theme with Glassmorphism
   =====================================================  */

/* ---- CSS Custom Properties ---- */
:root {
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --teal: #14b8a6;
    --orange: #f97316;
    --purple: #a855f7;
    --indigo: #6366f1;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(30, 41, 59, 0.6);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(99, 102, 241, 0.3);

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --navbar-height: 65px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.8);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --border-color: rgba(15, 23, 42, 0.1);
    --border-glow: rgba(99, 102, 241, 0.2);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-hover);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    overflow: hidden;
}

.login-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--teal);
    bottom: -50px;
    left: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 200px;
    height: 200px;
    background: var(--info);
    top: 20%;
    left: 60%;
    animation-delay: -15s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    75% {
        transform: translate(20px, 10px) scale(1.05);
    }
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
    color: white;
    box-shadow: 0 8px 32px var(--primary-glow);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 8px 32px var(--primary-glow);
    }

    50% {
        box-shadow: 0 8px 48px rgba(99, 102, 241, 0.6);
    }
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-version {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login-form .input-icon-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.login-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    z-index: 2;
}

.login-form .form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 16px 14px 48px;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
}

.login-form .form-control:focus {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-primary);
}

.login-form .form-control::placeholder {
    color: var(--text-muted);
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

.forgot-link {
    font-size: 13px;
    color: var(--primary-hover);
}

.btn-login {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* =====================================================
   APP LAYOUT
   ===================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: 66px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.brand-icon {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.brand-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.sidebar-toggle {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--primary);
    color: white;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-text,
.sidebar.collapsed .system-version-text,
.sidebar.collapsed .system-version-label {
    display: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar .nav-section {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.sidebar .nav-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-hover);
}

.sidebar .nav-link .bi-chevron-down {
    transition: transform 0.3s ease;
}

.sidebar .nav-link:not(.collapsed) .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    color: var(--primary-hover);
    border-left: 3px solid var(--primary);
}

.sidebar .nav-link.active i {
    color: var(--primary);
}

/* Submenu Styling & Hierarchy */
.sidebar .nav .nav {
    position: relative;
    margin-left: 28px;
    padding-left: 0;
    border-left: 1px solid rgba(148, 163, 184, 0.12); /* Thinner Vertical line */
    margin-bottom: 4px;
    margin-top: 4px;
}

.sidebar .nav .nav .nav-link {
    margin: 0;
    padding: 6px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    border-radius: 0;
}

.sidebar .nav .nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 1px;
    background: rgba(148, 163, 184, 0.12);
}

.sidebar .nav .nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary-hover);
}

.sidebar .nav .nav .nav-link.active {
    background: rgba(99, 102, 241, 0.03);
    color: var(--primary);
    font-weight: 600;
    border-left: none;
}

.sidebar .nav .nav .nav-link.active::after {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 8px var(--primary-glow);
}

.sidebar .nav .nav .nav-link i {
    font-size: 14px !important;
    width: 18px !important;
    opacity: 0.6;
}

/* Deeply nested (Level 3 - e.g. Attributes under Equipment) */
.sidebar .nav .nav .nav {
    margin-left: 16px;
}

.sidebar .nav .nav .nav .nav-link {
    font-size: 0.8rem;
    padding-left: 12px;
    opacity: 0.9;
}

.sidebar .nav .nav .nav .nav-link small {
    font-size: 0.8rem;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.system-version-label {
    margin-bottom: 10px;
    text-align: center;
}

.system-version-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.user-mini-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
}

.user-avatar {
    font-size: 28px;
    color: var(--primary);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
}

.swal2-container {
    z-index: 20000 !important;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding-top: var(--navbar-height);
    transition: var(--transition);
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ---- Top Navbar ---- */
.top-navbar {
    height: var(--navbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1040;
}

.sidebar.collapsed~.main-content .top-navbar {
    left: var(--sidebar-collapsed);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    color: var(--text-primary);
    padding: 4px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-actions .btn {
    font-size: 13px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.user-dropdown:hover {
    color: var(--primary-hover);
}

.user-avatar-sm {
    font-size: 24px;
    color: var(--primary);
}

.navbar-notifications {
    position: relative;
}

.navbar-notification-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.navbar-notification-toggle:hover,
.navbar-notification-toggle:focus-visible {
    color: var(--primary-hover);
    background: rgba(99, 102, 241, 0.08);
}

.navbar-notification-toggle > i {
    font-size: 1.15rem;
}

.navbar-notification-badge {
    position: absolute;
    top: 5px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.24);
}

.navbar-notification-menu {
    width: min(360px, calc(100vw - 24px));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 22px 40px rgba(15, 23, 42, 0.16);
}

.navbar-notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
    border-bottom: 1px solid var(--border-color);
}

.navbar-notification-header strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.96rem;
}

.navbar-notification-header small {
    display: block;
    color: var(--text-secondary);
    margin-top: 2px;
}

.navbar-notification-mark-all {
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.navbar-notification-list {
    max-height: min(420px, 68vh);
    overflow-y: auto;
}

.navbar-notification-empty {
    padding: 18px 16px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.navbar-notification-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    text-align: left;
    transition: var(--transition);
}

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

.navbar-notification-item:hover,
.navbar-notification-item:focus-visible {
    background: rgba(99, 102, 241, 0.06);
    outline: none;
}

.navbar-notification-item.is-unread {
    background: rgba(56, 189, 248, 0.08);
}

.navbar-notification-item.is-unread:hover,
.navbar-notification-item.is-unread:focus-visible {
    background: rgba(56, 189, 248, 0.14);
}

.navbar-notification-item-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
}

.navbar-notification-item-body {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.navbar-notification-item-meta {
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
}

/* ---- Page Content ---- */
.page-content {
    padding: 24px;
}

/* =====================================================
   COMPONENTS
   ===================================================== */

/* ---- Glassmorphism Cards ---- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.glass-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.glass-card .card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.glass-card .card-body {
    padding: 20px;
}

/* ---- Stat Cards ---- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card-primary::before {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-card-success::before {
    background: linear-gradient(90deg, var(--success), var(--teal));
}

.stat-card-warning::before {
    background: linear-gradient(90deg, var(--warning), var(--orange));
}

.stat-card-info::before {
    background: linear-gradient(90deg, var(--info), var(--primary));
}

.stat-card-danger::before {
    background: linear-gradient(90deg, var(--danger), var(--orange));
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-card-body {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.1;
}

.stat-icon {
    font-size: 40px;
    opacity: 0.15;
    color: var(--text-primary);
}

.stat-card-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

.stat-card-footer a {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-footer a:hover {
    color: var(--primary-hover);
}

/* ---- Buttons ---- */
.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--primary-glow);
    color: white;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-outline-light {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-light:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary-hover);
}

/* ---- Tables ---- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    color: var(--text-primary) !important;
    border-color: var(--border-color);
}

.table> :not(caption)>*>* {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color);
    box-shadow: inset 0 0 0 9999px transparent !important;
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 13px;
}

.table-hover tbody tr:hover>* {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

table.dataTable.table-striped>tbody>tr.odd>* {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] table.dataTable.table-striped>tbody>tr.odd>* {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 12px !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: var(--text-secondary) !important;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* ---- Forms ---- */
.form-control,
.form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 13px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.bg-purple {
    background-color: var(--purple) !important;
}

.bg-indigo {
    background-color: var(--indigo) !important;
}

.bg-teal {
    background-color: var(--teal) !important;
}

.bg-orange {
    background-color: var(--orange) !important;
}

/* ---- Alerts ---- */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* ---- Dropdown ---- */
.dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.dropdown-item {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.dropdown-header {
    color: var(--text-primary);
    font-size: 13px;
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* ---- Modals ---- */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ---- Financial Items ---- */
.finance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.finance-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.finance-value {
    font-size: 16px;
    font-weight: 700;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ---- OS Detail Sections ---- */
.detail-group {
    margin-bottom: 16px;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* ---- Animations ---- */
.animate-slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---- Nav Tabs Override ---- */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: transparent;
    border-bottom-color: var(--primary);
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--primary-hover);
    border-color: transparent;
    border-bottom-color: var(--primary);
}

/* ---- Info Cards for OS view ---- */
.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 100%;
}

.info-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Print Styles ---- */
@media print {

    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    .glass-card,
    .card {
        border: 1px solid #ddd;
        background: white;
    }
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.show~.sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .top-navbar {
        left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .stat-value {
        font-size: 22px;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 16px;
    }

    .login-card {
        padding: 24px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ---- Action buttons group ---- */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btns .btn {
    padding: 4px 8px;
    font-size: 13px;
}

/* ---- Card (overrides) ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}
