/* Nexis Stylesheet - Estética Premium Glassmorphism Dark Mode */

:root {
    /* Color Palette */
    --bg-app: #060913;
    --bg-sidebar: #0b1120;
    --bg-card: rgba(17, 24, 39, 0.6);
    --bg-card-hover: rgba(23, 33, 53, 0.8);
    --border-premium: rgba(255, 255, 255, 0.05);
    --border-premium-focus: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-transparent: rgba(99, 102, 241, 0.15);
    
    --cyan: #06b6d4;
    --cyan-transparent: rgba(6, 182, 212, 0.15);
    
    --emerald: #10b981;
    --emerald-transparent: rgba(16, 185, 129, 0.15);
    
    --amber: #f59e0b;
    --amber-transparent: rgba(245, 158, 11, 0.15);
    
    --rose: #ef4444;
    --rose-transparent: rgba(239, 68, 68, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Layout Structure */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 10% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-premium);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-premium);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--cyan);
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.sidebar-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-normal);
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
    transform: translateX(4px);
}

.menu-item.active {
    color: var(--text-primary);
    background-color: var(--primary-transparent);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

.menu-icon {
    width: 20px;
    height: 20px;
    transition: var(--transition-normal);
}

.menu-item.active .menu-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-premium);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

.status-dot.offline {
    background-color: var(--rose);
    box-shadow: 0 0 8px var(--rose);
}

.status-dot.syncing {
    background-color: var(--amber);
    box-shadow: 0 0 8px var(--amber);
    animation: pulse 1.5s infinite;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Top Header */
.top-header {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: justify;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-premium);
    background-color: rgba(6, 9, 19, 0.4);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-title p {
    font-size: 13px;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Content Sections */
.content-section {
    display: none;
    flex-grow: 1;
    padding: 30px 40px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

/* Dashboard Section */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.metric-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Dashboard Details Layout */
.dashboard-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.detail-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 380px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* List details */
.list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.alert-item:hover {
    background-color: rgba(245, 158, 11, 0.08);
    transform: scale(1.01);
}

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

.alert-warning-icon {
    width: 20px;
    height: 20px;
    color: var(--amber);
}

.alert-title {
    font-size: 14px;
    font-weight: 600;
}

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

.alert-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background-color: var(--amber-transparent);
    color: var(--amber);
}

/* Activity Log */
.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    background-color: var(--primary);
    box-shadow: 0 0 6px var(--primary);
}

.log-dot.success {
    background-color: var(--emerald);
    box-shadow: 0 0 6px var(--emerald);
}

.log-dot.info {
    background-color: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
}

.log-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-text {
    font-size: 13.5px;
    line-height: 1.4;
}

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

/* Tables Layout */
.table-actions-header {
    position: sticky;
    top: 12px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.search-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-normal);
}

.search-box input:focus {
    border-color: var(--border-premium-focus);
    box-shadow: var(--shadow-glow);
    background-color: var(--bg-card-hover);
}

.table-container {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    min-height: 250px;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-premium);
    background-color: rgba(255, 255, 255, 0.01);
}

.data-table td {
    padding: 6px 12px;
    font-size: 12.5px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

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

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

/* Stock column quantity and controls */
.qty-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border-premium);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-fast);
}

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

.stock-indicator {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.stock-bar-wrapper {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.stock-bar {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.stock-qty-text {
    font-size: 12px;
    font-weight: 600;
}

/* Badges & Accents */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-warning {
    background-color: var(--amber-transparent);
    color: var(--amber);
}

.badge-success {
    background-color: var(--emerald-transparent);
    color: var(--emerald);
}

.badge-danger {
    background-color: var(--rose-transparent);
    color: var(--rose);
}

.badge-info {
    background-color: var(--cyan-transparent);
    color: var(--cyan);
}

.bg-indigo-transparent { background-color: var(--primary-transparent); }
.bg-cyan-transparent { background-color: var(--cyan-transparent); }
.bg-emerald-transparent { background-color: var(--emerald-transparent); }
.bg-amber-transparent { background-color: var(--amber-transparent); }

.text-indigo { color: var(--primary); }
.text-cyan { color: var(--cyan); }
.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-rose { color: var(--rose); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-normal);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-premium);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background-color: var(--rose);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-premium);
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon.edit-btn:hover {
    color: var(--cyan);
    background-color: var(--cyan-transparent);
    border-color: rgba(6, 182, 212, 0.3);
}

.btn-icon.delete-btn:hover {
    color: var(--rose);
    background-color: var(--rose-transparent);
    border-color: rgba(239, 68, 68, 0.3);
}

.icon {
    width: 16px;
    height: 16px;
}

/* Modals & Dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

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

.modal {
    width: 100%;
    max-width: 600px;
    background-color: #0b1120;
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

.modal-close-btn svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

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

/* Forms & Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-6 { width: calc(50% - 8px); }
.col-4 { width: calc(33.33% - 10.6px); }
.col-8 { width: calc(66.66% - 5.3px); }

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

input, textarea, select {
    padding: 6px 10px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12.5px;
    outline: none;
    transition: var(--transition-normal);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--border-premium-focus);
    box-shadow: var(--shadow-glow);
    background-color: rgba(255, 255, 255, 0.04);
}

input[readonly] {
    background-color: rgba(255, 255, 255, 0.01);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.input-tip {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* Select wrapper */
.select-wrapper {
    position: relative;
}

select {
    appearance: none;
    padding-right: 32px;
    cursor: pointer;
}

select option {
    background-color: #0f172a; /* Slate 900 */
    color: var(--text-primary);
    padding: 8px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.settings-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-premium);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.instruction-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.4) 0%, rgba(9, 13, 22, 0.6) 100%);
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.instruction-steps li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-transparent);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.instruction-steps p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.code-link {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed var(--cyan);
}

.code-link:hover {
    color: var(--text-primary);
    border-bottom-style: solid;
}

/* Toast Notification Container */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background-color: #0b1120;
    border: 1px solid var(--border-premium);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    transform: translateY(20px);
    opacity: 0;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.2s, transform 0.2s;
}

.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }
.toast.info { border-color: rgba(6, 182, 212, 0.3); }

.toast-icon {
    width: 20px;
    height: 20px;
}

.toast.success .toast-icon { color: var(--emerald); }
.toast.error .toast-icon { color: var(--rose); }
.toast.info .toast-icon { color: var(--cyan); }

.toast-message {
    font-size: 13.5px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Table Empty and Loading states */
.table-loading, .table-empty {
    padding: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}

.table-loading p {
    font-size: 14px;
    color: var(--text-secondary);
}

.table-empty svg {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
}

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

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    gap: 12px;
    padding: 40px 0;
}

.empty-icon {
    width: 32px;
    height: 32px;
}

/* Shadow premium */
.shadow-premium {
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-premium);
}

.shadow-premium:hover {
    box-shadow: var(--shadow-md);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

.animate-up {
    animation: animateUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Table sorting styles */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}
th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary-light) !important;
}
.sort-icon {
    font-size: 10px;
    margin-left: 6px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
th.sortable:hover .sort-icon {
    opacity: 1;
}

/* Bulk Action Bar styles */
.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background-color: var(--card-bg);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 14px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);
    z-index: 1000;
    min-width: 480px;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#bulk-select-count {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 14px;
}
.bulk-actions-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}
.client-row-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
#select-all-clients {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    vertical-align: middle;
}

/* --- AUTENTICACIÓN (LOGIN, RECOVERY, SETUP) --- */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 45%),
                radial-gradient(circle at bottom left, rgba(244, 63, 94, 0.1), transparent 45%),
                #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    backdrop-filter: blur(8px);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.auth-brand {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.auth-brand .brand-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.auth-brand .brand-logo svg {
    width: 32px;
    height: 32px;
}

.auth-brand h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.auth-brand p {
    color: var(--text-tertiary);
    font-size: 14px;
    margin: 0;
}

.auth-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
}

.auth-card .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-card .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-card .form-group input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14.5px;
    outline: none;
    transition: all 0.2s ease;
}

.auth-card .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

/* Ocultar barra lateral en login */
body.auth-locked .sidebar,
body.auth-locked .main-header,
body.auth-locked .main-content {
    filter: blur(10px);
    pointer-events: none;
}

/* --- PERSISTENT ROW COLORING SYSTEM --- */
.row-color-rose {
    background-color: rgba(244, 63, 94, 0.22) !important;
}
.row-color-rose:hover {
    background-color: rgba(244, 63, 94, 0.32) !important;
}

.row-color-emerald {
    background-color: rgba(16, 185, 129, 0.22) !important;
}
.row-color-emerald:hover {
    background-color: rgba(16, 185, 129, 0.32) !important;
}

.row-color-amber {
    background-color: rgba(245, 158, 11, 0.22) !important;
}
.row-color-amber:hover {
    background-color: rgba(245, 158, 11, 0.32) !important;
}

.row-color-cyan {
    background-color: rgba(6, 182, 212, 0.38) !important;
}
.row-color-cyan:hover {
    background-color: rgba(6, 182, 212, 0.48) !important;
}

.row-color-violet {
    background-color: rgba(139, 92, 246, 0.22) !important;
}
.row-color-violet:hover {
    background-color: rgba(139, 92, 246, 0.32) !important;
}

/* Color Option Circles inside Modal */
.color-picker-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.color-option:hover {
    transform: scale(1.15);
    border-color: #ffffff;
    box-shadow: 0 0 15px currentColor;
}

.color-option.active {
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 0 20px currentColor, 0 0 0 2px var(--primary);
}

.color-option-none { background-color: #334155; color: #64748b; }
.color-option-rose { background-color: rgb(244, 63, 94); color: rgb(244, 63, 94); }
.color-option-emerald { background-color: rgb(16, 185, 129); color: rgb(16, 185, 129); }
.color-option-amber { background-color: rgb(245, 158, 11); color: rgb(245, 158, 11); }
.color-option-cyan { background-color: rgb(6, 182, 212); color: rgb(6, 182, 212); }
.color-option-violet { background-color: rgb(139, 92, 246); color: rgb(139, 92, 246); }

/* Prevent text selection during click-and-drag checkboxes selection */
.clients-table-drag-active,
.clients-table-drag-active tr,
.clients-table-drag-active td {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* --- MOBILE & RESPONSIVE DESIGNS --- */
.hamburger-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}
.hamburger-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}
.sidebar-close-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile Sidebar Drawer Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(6, 9, 19, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}
.sidebar-overlay.active {
    display: block;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    }
    
    .hamburger-menu-btn,
    .sidebar-close-btn {
        display: flex;
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .main-content {
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
    }
    
    .top-header {
        padding: 0 20px;
        height: 70px;
        gap: 16px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }
    
    .top-header {
        height: auto;
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .controls-bar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .search-box, .select-wrapper, #client-state-filter {
        width: 100% !important;
    }
    
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
    
    .modal {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 20px !important;
    }
    
    .bulk-action-bar {
        min-width: 90% !important;
        left: 5% !important;
        transform: translateY(0) !important;
        bottom: 16px !important;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        align-items: stretch;
    }
    
    .bulk-actions-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .bulk-actions-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Switch Toggle custom styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary-transparent);
    border-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--primary);
}

/* Tarjetas de Prueba (Demos) */
.prueba-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prueba-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.prueba-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

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

.prueba-card-credentials {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.prueba-screen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 6px;
}

.prueba-screen-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.prueba-screen-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

select option {
    background-color: #1e293b;
    color: #f8fafc;
}
