:root {
    /* --- Premium Dark Theme --- */
    --bg-body: #0a0e1a;
    --bg-sidebar: #0f1419;
    --bg-card: #161b26;
    --bg-input: #1e2532;
    --bg-hover: #1e2532;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: #1e2532;
    --border-highlight: #2d3748;

    /* Accents - Vibrant & Premium */
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-danger: #ef4444;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    /* Shadows - Organic & Floating */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* --- Utilities --- */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.flex-column {
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

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

.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

h1, h2, h3, .hardware-title, .software-title, .users-page-title, .pf-page-title {
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
}

/* --- Layout Grid --- */
.app-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    background-color: rgba(15, 20, 25, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    position: relative;
    /* overflow: hidden; Removed to avoid cutting logo during adjustments */
}

.logo-full {
    height: 26px; /* Increased size as requested */
    width: auto;
    max-width: 165px;
    object-fit: contain;
    filter: brightness(1.2) saturate(1.3) contrast(1.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-shield {
    display: none; /* Hidden in expanded mode */
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-section h3 {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 5px;
}

.nav-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 4px 0 12px rgba(59, 130, 246, 0.5);
}

.nav-item .icon {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

/* --- Sidebar Toggle Button --- */
#sidebar-toggle {
    position: relative;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    /* margin-right: auto; REMOVED to align logo correctly */
    transition: all 0.2s ease;
    color: var(--text-primary);
}

#sidebar-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-primary);
    border-color: rgba(59, 130, 246, 0.4);
    transform: scale(1.05);
}

#sidebar-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* --- Sidebar Collapsed State --- */
.sidebar {
    width: 250px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    position: relative;
}

.sidebar--collapsed {
    width: 84px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Hide full logo, show shield when collapsed */
.sidebar--collapsed .logo {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sidebar--collapsed .logo-full {
    display: none;
}

.sidebar--collapsed .logo-shield {
    display: block;
    animation: shieldGlow 3s infinite alternate ease-in-out, logoFadeIn 0.5s ease-out;
}

@keyframes shieldGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.2));
        transform: scale(1);
    }
    to {
        filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5));
        transform: scale(1.05);
    }
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar--collapsed .sidebar-header {
    justify-content: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar--collapsed #sidebar-toggle {
    margin: 0 auto;
    background: rgba(59, 130, 246, 0.15); /* More visible when collapsed */
    border-color: rgba(59, 130, 246, 0.3);
}

.sidebar--collapsed #sidebar-toggle:hover {
    background: var(--accent-primary);
    color: white;
}

/* Hide text in nav items and buttons when collapsed */
.sidebar--collapsed .nav-item,
.sidebar--collapsed .btn-logout {
    justify-content: center;
    padding: 12px 0;
    position: relative;
    white-space: nowrap;
}

/* Show only the icon, hide all text nodes */
.sidebar--collapsed .nav-item {
    font-size: 0;
    gap: 0;
}

.sidebar--collapsed .nav-item svg {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    display: block;
}

.sidebar--collapsed .btn-logout {
    font-size: 0;
    gap: 0;
}

.sidebar--collapsed .btn-logout svg {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    display: block;
}

/* Tooltips for collapsed sidebar */
.sidebar--collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar--collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.sidebar--collapsed .btn-logout::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar--collapsed .btn-logout:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- Main Content Adjustment --- */
.app-container {
    grid-template-columns: 250px 1fr;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container:has(.sidebar--collapsed) {
    grid-template-columns: 84px 1fr;
}

/* --- Sidebar Overlay (Mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 49;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* --- Main Content --- */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.05), transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05), transparent 40%),
                #0a0e1a;
    min-height: 0;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-online {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- View Transitions --- */
.view-section {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.view-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.view-section.active .hardware-card,
.view-section.active .stat-card,
.view-section.active .users-card,
.view-section.active .software-card {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Stagger row animations */
.view-section.active tr:nth-child(1) { animation-delay: 0.1s; }
.view-section.active tr:nth-child(2) { animation-delay: 0.15s; }
.view-section.active tr:nth-child(3) { animation-delay: 0.2s; }
.view-section.active tr:nth-child(4) { animation-delay: 0.25s; }
.view-section.active tr:nth-child(5) { animation-delay: 0.3s; }

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
    animation: slideInRight 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
}

.toast-success::before { background: var(--accent-success); }
.toast-error::before { background: var(--accent-danger); }
.toast-warning::before { background: var(--accent-warning); }

.toast-fade-out {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.3s ease;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
}

.toast-close:hover { color: var(--text-primary); }

.status-online-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-success);
    margin-right: 8px;
    animation: pulse-online 2s infinite;
}

/* --- Batch Action Toolbar --- */
.selection-toolbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 100px);
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.2);
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(12px);
}

.selection-toolbar.active {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: all;
}

.selection-count {
    font-weight: 700;
    color: var(--accent-primary);
    padding-right: 15px;
    border-right: 1px solid var(--border-color);
}

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

.batch-btn {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.batch-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.batch-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* --- Table Checkboxes --- */
.machine-checkbox-cell {
    width: 40px;
    text-align: center;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
/* --- Mobile Selection Toolbar --- */
@media (max-width: 768px) {
    .selection-toolbar {
        bottom: 12px;
        width: 95%;
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .selection-count {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 8px;
        text-align: center;
    }
    
    .selection-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .batch-btn span {
        display: none; /* Icon only on very small screens to save space */
    }
}
/* --- Insights Widget --- */
.insights-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.insight-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 12px;
    border-left: 4px solid var(--accent-primary);
    transition: transform 0.2s;
}

.insight-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.05);
}

.insight-item.warning { border-left-color: #f59e0b; }
.insight-item.danger { border-left-color: #ef4444; }
.insight-item.info { border-left-color: #3b82f6; }

.insight-header {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.insight-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.insight-loading, .insight-empty, .insight-error {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#views-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- Header --- */
.top-header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 10;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.notification-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.notification-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    border: 2px solid var(--bg-body);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.clock-widget {
    display: flex;
    flex-direction: column;
}

#clock-time {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

#clock-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid rgba(59, 130, 246, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* --- Buttons Premium --- */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* Shimmer Animation */
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.3s;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.btn-icon-inside {
    width: 18px;
    height: 18px;
}
.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.stat-icon.blue {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

.stat-icon.green {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.purple {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.1);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-radius: 12px;
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-radius: 12px;
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================
   Hardware Add Modal (redesigned)
   ========================================== */

.hw-add-modal-content {
    max-width: 680px;
    width: 95vw;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.hw-add-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
}

.hw-add-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.hw-add-modal-subtitle {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin: 0;
}

/* Shared close button (used on both modals) */
.hw-modal-close-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.hw-modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Form body */
.hw-add-form {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.hw-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.hw-add-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hw-add-field-full {
    grid-column: 1 / -1;
}

.hw-add-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.hw-add-required {
    color: #f87171;
    margin-left: 2px;
}

.hw-add-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.hw-add-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.hw-add-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
}

.hw-add-date {
    color-scheme: dark;
}

/* Currency field */
.hw-add-currency-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.hw-add-currency-prefix {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

.hw-add-currency-input {
    padding-left: 2.5rem !important;
}

/* Footer */
.hw-add-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.hw-add-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   Hardware Details Modal (redesigned header)
   ========================================== */

/* Hardware Details Modal (redesigned header) */
.hw-detail-modal {
    max-width: 780px;
    width: 95vw;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.hw-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.06) 100%);
    gap: 1rem;
}

/* --- Timeline History --- */
.hw-history-tabs {
    display: flex;
    gap: 1.5rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.hw-history-tab {
    padding: 1rem 0;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: 0.95rem;
}

.hw-history-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.hw-history-tab:hover:not(.active) {
    color: var(--text-primary);
}

.hw-history-timeline {
    padding: 1.5rem;
    position: relative;
    max-height: 500px;
    overflow-y: auto;
}

.timeline-item {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
}

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

.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 1;
}

.timeline-icon.created { border-color: var(--accent-success); color: var(--accent-success); }
.timeline-icon.hardware_change { border-color: var(--accent-primary); color: var(--accent-primary); }
.timeline-icon.ownership_change { border-color: var(--accent-purple); color: var(--accent-purple); }
.timeline-icon.status_change { border-color: var(--accent-warning); color: var(--accent-warning); }
.timeline-icon.deleted { border-color: var(--accent-danger); color: var(--accent-danger); }

.timeline-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

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

.timeline-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

.timeline-badge.system,
.timeline-badge.portal { background: rgba(139, 92, 246, 0.2); color: #c084fc; }
.timeline-badge.agent { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

.timeline-detail {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Edit Form Styles */
.hw-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.hw-edit-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.hw-edit-tag-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.hw-edit-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.hw-edit-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.hw-edit-tag .remove-tag {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.hw-edit-tag .remove-tag:hover {
    opacity: 1;
    color: var(--accent-danger);
}

.hw-edit-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hw-edit-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hw-edit-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.hw-edit-info-val {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.hw-detail-modal-title-area {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.hw-detail-modal-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hw-detail-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-detail-modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.hw-detail-modal .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
    padding: 1.25rem 1.5rem;
}

/* --- Hardware Page --- */
.hardware-page {

    padding: 1.5rem 2rem;
}

.hardware-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hardware-page-header h1.hardware-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.hardware-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
}

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

.hardware-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.hardware-card-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.hardware-card-toolbar .search-box {
    max-width: 200px;
    min-width: 140px;
}

.hardware-card-toolbar .search-box input {
    padding: 6px 12px;
    padding-right: 32px;
    font-size: 0.8rem;
    height: 32px;
}

.hardware-card-toolbar .search-icon {
    font-size: 0.75rem;
}

.hardware-card-toolbar .btn-filter,
.hardware-card-toolbar .btn-icon,
.hardware-card-toolbar .btn-secondary,
.hardware-card-toolbar .btn-primary {
    padding: 5px 10px;
    font-size: 0.78rem;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.hardware-card-body .table-container {
    border: none;
    border-radius: 0;
}

/* Controls Panel */
.controls-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.controls-left,
.controls-right,
.controls-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-center {
    flex: 1;
    justify-content: center;
}

/* Custom Inputs */
.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    padding-right: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.btn-filter,
.btn-icon,
.custom-select {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-filter:hover,
.btn-icon:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Table Container */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
}

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

th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.tag-badge {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Dropdowns & Menus */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 180px;
    z-index: 50;
    box-shadow: var(--shadow-lg);
}

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

.dropdown-item {
    padding: 8px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto; /* Centralização automática horizontal e margem vertical segura */
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

/* Settings Panel */
.settings-panel {
    padding: 1rem;
}

.settings-panel h2 {
    margin-bottom: 0.5rem;
}

.section-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.section-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.form-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-row label {
    min-width: 140px;
}

.form-row input[type="number"] {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
}

/* Dashboard Panel */
.dashboard-panel {
    padding: 1.5rem 2rem;
    max-width: 100%;
}

.dashboard-panel h2 {
    margin-bottom: 0.5rem;
}

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

.dashboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-header-actions .btn-primary,
.dashboard-header-actions .btn-secondary {
    white-space: nowrap;
}

/* Dashboard Widgets Grid */
.dashboard-widgets-grid,
#dashboard-widgets {
    display: grid !important;
    /* User Defined Preference: 180px */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    grid-auto-rows: minmax(110px, auto) !important;
    gap: 1.25rem !important;
    align-items: start !important;
    padding-bottom: 2rem;
}

/* Widget Card */
.dashboard-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 16px;
    padding: 0.9rem;
    container-type: inline-size;
    /* User Defined Preference */
    width: 100%;
    min-height: 110px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    isolation: isolate;
    backdrop-filter: blur(6px);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

/* Widget Accents */
.dashboard-widget[data-accent="green"] {
    border-top-color: var(--accent-success);
}

.dashboard-widget[data-accent="orange"] {
    border-top-color: var(--accent-warning);
}

.dashboard-widget[data-accent="red"] {
    border-top-color: var(--accent-danger);
}

.dashboard-widget[data-accent="purple"] {
    border-top-color: #8b5cf6;
}

.dashboard-widget[data-accent="cyan"] {
    border-top-color: #06b6d4;
}

/* Widget Text & Icons */
.dashboard-widget h3 {
    font-size: 0.65rem;
    /* Reduced from 0.75rem */
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    /* Reduced from 0.5rem */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-widget .widget-value {
    font-size: clamp(1.1rem, 15cqw, 1.8rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-widget .widget-value.sub {
    font-size: 0.7rem;
    /* Reduced from 0.8rem */
    font-weight: 400;
    color: var(--text-muted);
    margin-top: auto;
}

.dashboard-widget h3 span {
    font-size: 1rem;
    /* Reduced from 1.25rem */
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    padding: 0;
    border-radius: 50%;
    width: 28px;
    /* Reduced from 36px */
    height: 28px;
    /* Reduced from 36px */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-widget[data-accent="green"] h3 span {
    color: var(--accent-success);
}

.dashboard-widget[data-accent="orange"] h3 span {
    color: var(--accent-warning);
}

.dashboard-widget[data-accent="red"] h3 span {
    color: var(--accent-danger);
}

.dashboard-widget[data-accent="purple"] h3 span {
    color: #8b5cf6;
}

.dashboard-widget[data-accent="cyan"] h3 span {
    color: #06b6d4;
}

.dashboard-widget .widget-chart {
    position: relative;
    height: 176.4px;
    margin-top: 0.5rem;
}

.dashboard-widget .widget-list {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.dashboard-widget .widget-list li {
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(71, 85, 105, 0.35);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

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


/* Widget Sizes (Desktop Default) */
.dashboard-widget.size-small {
    grid-column: span 1;
    grid-row: span 1;
}

.dashboard-widget.size-medium {
    grid-column: span 2;
    grid-row: span 2;
    min-width: 0;
    max-height: 260px;
}

.dashboard-widget.size-large {
    grid-column: span 2;
}

.dashboard-widget.full-width {
    grid-column: 1 / -1;
}


/* Modal Add Widget */
.modal-add-widget {
    max-width: 880px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
}

.modal-add-widget h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-add-widget>.text-muted {
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.5;
}

.add-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.5rem 0.5rem 0;
    flex: 1;
    min-height: 360px;
    max-height: calc(85vh - 180px);
}

.add-widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.add-widget-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    transition: width 0.3s ease;
}

.add-widget-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.add-widget-card:hover::before {
    width: 4px;
}

.add-widget-card .widget-card-icon-container {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: all 0.25s ease;
}

.add-widget-card:hover .widget-card-icon-container {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15));
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.add-widget-card .widget-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.add-widget-card .widget-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.add-widget-card .widget-card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.add-widget-card .widget-card-size {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.15));
    color: var(--accent-primary);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Personalize Modal */
.modal-personalize {
    max-width: 95vw;
    width: 900px;
}

.personalize-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.personalize-main h3,
.personalize-available h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Available Widgets Grid (matching main grid style) */
.personalize-available-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    min-height: 140px;
    max-height: 280px;
    overflow-y: auto;
}

.available-widget-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    text-align: center;
    position: relative;
    user-select: none;
}

.available-widget-card:hover {
    border-color: var(--accent-success);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.available-widget-card .add-widget-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s ease;
}

.available-widget-card:hover .add-widget-btn {
    opacity: 1;
}

.available-widget-card .add-widget-btn:hover {
    background: var(--accent-success);
    color: white;
    transform: scale(1.1);
}

/* Draggable Grid */
.personalize-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    min-height: 196px;
    max-height: 280px;
    overflow-y: auto;
}

.draggable-widget-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: move;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    text-align: center;
    position: relative;
    user-select: none;
}

.draggable-widget-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.draggable-widget-card .remove-widget-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.draggable-widget-card:hover .remove-widget-btn {
    opacity: 1;
}

.draggable-widget-card .remove-widget-btn:hover {
    background: var(--accent-danger);
    color: white;
    transform: scale(1.1);
}

.draggable-widget-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

/* Import Mapping */
.import-mapping-list {
    margin-top: 0.5rem;
}

.import-mapping-list .form-row {
    align-items: center;
}

.import-map-select {
    min-width: 180px;
}

/* Hardware Page Specifics */
.hardware-page {
    padding: 1rem;
}

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

.hardware-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

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

.hardware-card-body {
    padding: 0;
}

.hardware-card-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* --- Media Queries (Consolidated) --- */

/* Large Screens / Desktop adjustment */
@media (max-width: 950px) {

    .dashboard-widgets-grid,
    #dashboard-widgets {
        /* User preference: 150px minmax for smaller screens */
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }

    .dashboard-widget.size-small,
    .dashboard-widget.size-medium {
        grid-column: span 1;
    }

    .dashboard-widget.size-large {
        grid-column: span 2;
    }
}

/* Tablet / Mobile */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    /* Consider adding a mobile menu toggle instead of hiding */

    .add-widget-grid {
        grid-template-columns: 1fr;
    }

    .modal-add-widget {
        max-width: 95vw;
        padding: 2rem;
    }

    .personalize-container {
        grid-template-columns: 1fr;
    }

    .dashboard-widget.size-large {
        grid-column: span 1;
    }

    /* Force single column for widgets if very small */
    .dashboard-widgets-grid,
    #dashboard-widgets {
        grid-template-columns: 1fr !important;
    }

    .hardware-card-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .search-box input {
        min-width: 0;
    }
}


/* Users Management Page */
.users-page {
    padding: 1.5rem 2rem;
    max-width: 100%;
}

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

h1.users-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

/* --- KPI Stats Cards --- */
.users-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.um-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

.um-stat-card:hover {
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.um-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.um-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.um-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.um-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.um-stat-icon-total {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.um-stat-icon-active {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.um-stat-icon-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.um-stat-icon-vacation {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

/* --- Tabs (Pill Style) --- */
.um-tabs-bar {
    display: inline-flex;
    background: var(--bg-input);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color);
}

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

.um-tab:hover {
    color: var(--text-secondary);
}

.um-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.um-tab svg {
    opacity: 0.7;
}

.um-tab.active svg {
    opacity: 1;
}

/* --- Users Card (Table Container) --- */
.users-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: visible;
}

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

.users-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.users-card-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
}

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

/* --- User Avatar in Table --- */
.um-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.um-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.um-user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.um-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.um-user-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* --- Status Badge (Pill) --- */
.um-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.um-status-badge.active {
    background: var(--accent-primary);
    color: white;
}

.um-status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.um-status-badge.vacation {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* --- Count Columns --- */
.um-count-cell {
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Action Buttons --- */
.um-actions {
    display: flex;
    gap: 6px;
}

.um-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.um-action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

.um-action-btn.danger:hover {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* --- Department Table --- */
.um-dept-name {
    font-weight: 600;
    color: var(--text-primary);
}

.um-dept-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.um-dept-manager {
    color: var(--text-secondary);
}

.um-dept-count {
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

/* --- Tab Panels --- */
.um-tab-panel {
    animation: umFadeIn 0.25s ease;
}

@keyframes umFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive KPI Cards --- */
@media (max-width: 1024px) {
    .users-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .users-page {
        padding: 1rem;
    }

    .um-tabs-bar {
        width: 100%;
    }

    .um-tab {
        flex: 1;
        justify-content: center;
    }
}

/* Status Badge (legacy, keep for backwards compatibility) */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon-small {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-icon-small.danger:hover {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ==============================
   SOFTWARE PAGE (ITAM Module)
   ============================== */

.software-page {
    padding: 1.5rem 2rem;
}

.software-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.software-page-header h1.software-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Card */
.software-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
}

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

.software-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sw-icon-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.software-card-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.software-card-toolbar .search-box {
    max-width: 220px;
    min-width: 160px;
}

.software-card-toolbar .search-box input {
    padding: 6px 12px;
    padding-right: 32px;
    font-size: 0.8rem;
    height: 34px;
}

.software-card-toolbar .search-icon {
    font-size: 0.75rem;
}

.software-card-toolbar .btn-icon {
    padding: 5px 10px;
    font-size: 0.78rem;
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Table overrides inside software card */
.software-table-container {
    border: none;
    border-radius: 0;
    border-top: none;
}

.software-card-body .table-container table th {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
    letter-spacing: 0.5px;
}

.software-card-body .table-container table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.software-card-body .table-container table tr {
    height: 64px;
    transition: background-color 0.15s ease;
}

.software-card-body .table-container table tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Sortable columns */
.sortable-col {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable-col:hover {
    color: var(--accent-primary);
}

.sortable-col::after {
    content: ' ↕';
    font-size: 0.65rem;
    opacity: 0.4;
}

.sortable-col.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: var(--accent-primary);
}

.sortable-col.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: var(--accent-primary);
}

/* Software name cell: name + version */
.sw-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sw-name-cell .sw-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.sw-name-cell .sw-version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Usage / Utilization bar */
.usage-cell {
    min-width: 120px;
}

.usage-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 4px;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.usage-bar-fill.usage-normal {
    background: var(--accent-primary);
}

.usage-bar-fill.usage-warning {
    background: var(--accent-warning);
}

.usage-bar-fill.usage-critical {
    background: var(--accent-danger);
}

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

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.status-ativo {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-badge.status-inativo {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-badge.status-expirando {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Cost cell */
.cost-cell {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Action edit */
.action-edit {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-edit:hover {
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .software-page {
        padding: 1rem 1rem;
    }
}

@media (max-width: 768px) {
    .software-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .software-page-header .btn-primary {
        width: 100%;
        justify-content: center;
    }

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

    .software-card-toolbar {
        justify-content: stretch;
    }

    .software-card-toolbar .search-box {
        max-width: 100%;
        flex: 1;
    }

    .software-table-container {
        overflow-x: auto;
    }
}

/* Filter Dropdown Panel */
.software-card-toolbar {
    position: relative;
}

.sw-filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 260px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.sw-filter-row {
    margin-bottom: 0.75rem;
}

.sw-filter-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sw-filter-row select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.sw-filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Filter active indicator */
.btn-icon.filter-active {
    background: var(--accent-color);
    color: #fff;
}

/* Generic Dropdown Panel (shared by export, columns, filter) */
.sw-dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

/* Export dropdown options */
.sw-dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.sw-dropdown-option:hover {
    background: var(--bg-hover);
}

/* Column toggle dropdown */
.sw-dropdown-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.sw-col-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.sw-col-check:hover {
    background: var(--bg-hover);
}

.sw-col-check input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ==========================================
   Hardware Filter Panel (Unified)
   ========================================== */

.hw-filter-panel {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

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

.hw-filter-clear-all {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.hw-filter-clear-all:hover {
    background: rgba(59, 130, 246, 0.1);
}

.hw-filter-section {
    margin-bottom: 0.875rem;
}

.hw-filter-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Status pills */
.hw-filter-status-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hw-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.hw-status-pill:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.hw-status-pill.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.hw-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hw-status-dot.online {
    background: #34d399;
}

.hw-status-dot.offline {
    background: #f87171;
}

/* Tipo select */
.hw-filter-select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}

.hw-filter-select:focus {
    border-color: var(--accent-primary);
}

/* Value range */
.hw-filter-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hw-filter-range-input {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}

.hw-filter-range-input:focus {
    border-color: var(--accent-primary);
}

.hw-filter-range-sep {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Tags checkboxes */
.hw-filter-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 100px;
    overflow-y: auto;
}

.hw-filter-tag-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.hw-filter-tag-check:hover {
    border-color: #3b82f6;
    color: var(--text-primary);
}

.hw-filter-tag-check input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.hw-filter-no-tags {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Filter panel action buttons */
.hw-filter-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.875rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Filter badge (active count on button) */
.hw-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: white;
    color: var(--accent-primary);
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 2px;
}

.btn-icon.filter-active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ==========================================
   Peripherals & Equipment Module
   ========================================== */

.pf-page {

    padding: 1.5rem 2rem;
    max-width: 100%;
}

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

h1.pf-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

/* 5-column stats grid */
.pf-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pf-value-highlight {
    font-size: 1.35rem !important;
    color: #22d3ee !important;
}

/* Status badges for peripherals */
.pf-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.pf-status-badge.in_use {
    background: var(--accent-primary);
    color: white;
}

.pf-status-badge.available {
    background: transparent;
    border: 1px solid var(--border-highlight);
    color: var(--text-secondary);
}

.pf-status-badge.faulty {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.pf-status-badge.maintenance {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Name cell bold */
.pf-name-cell {
    font-weight: 600;
    color: var(--text-primary);
}

/* Price cell */
.pf-price-cell {
    font-weight: 500;
    white-space: nowrap;
}

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

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

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

    .pf-page {
        padding: 1rem;
    }

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

/* Count Badge for titles */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background-color: var(--accent-primary, #3b82f6);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* --- Warranty Badges --- */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}
.status-active { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-expired { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.status-unknown { background: rgba(107, 114, 128, 0.1); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.2); }

/* --- SOFTWARE MACHINES MODAL --- */
.sw-machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 1.5rem;
}

.sw-machines-grid::-webkit-scrollbar {
    width: 6px;
}
.sw-machines-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.sw-machines-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sw-machine-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: all 0.2s;
}

.sw-machine-card.installed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
    opacity: 1;
}

.sw-machine-card.not-installed {
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(255,255,255,0.05);
}

.sw-mc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sw-mc-hostname {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sw-mc-body {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sw-machine-card.installed .sw-mc-body {
    border-top: 1px solid rgba(16, 185, 129, 0.15);
}

.sw-mc-badge-installed {
    display: inline-flex;
    align-items: center;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.sw-mc-badge-not {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 6px;
}

.sw-mc-footer {
    margin-top: 0.5rem;
}

.btn-uninstall-future {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: default;
    transition: all 0.2s;
}

.btn-uninstall-future:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* --- VIEW TOGGLE --- */
.sw-machines-view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- LIST VIEW OVERRIDES --- */
.sw-machines-grid.list-view {
    display: flex;
    flex-direction: column;
}

.sw-machines-grid.list-view .sw-machine-card {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1.5rem;
}

.sw-machines-grid.list-view .sw-mc-header {
    flex: 2;
    min-width: 200px;
}

.sw-machines-grid.list-view .sw-mc-body {
    padding-top: 0;
    border-top: none;
    flex: 1;
    display: flex;
    justify-content: center;
}

.sw-machines-grid.list-view .sw-mc-footer {
    margin-top: 0;
    flex: 1.5;
    display: flex;
    justify-content: flex-end;
}

.sw-machines-grid.list-view .sw-machine-card.installed .sw-mc-body {
    border-top: none;
}

.sw-machines-grid.list-view .btn-uninstall-future {
    width: auto;
    padding: 6px 12px;
}