/* ============================================
   Xyvora Screen - Enterprise SaaS Monitoring
   Design System: Dark Premium
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #06B6D4;
    --purple: #7C3AED;
    --orange: #F97316;
    
    --bg-main: #0F172A;
    --bg-card: #111827;
    --bg-secondary: #1E293B;
    --bg-hover: rgba(255,255,255,.03);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --border-color: rgba(255,255,255,.05);
    --border-input: #334155;
    
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;
    
    --sidebar-w: 260px;
    --topbar-h: 72px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 20px;
    
    --transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-card: 0 1px 3px rgba(0,0,0,.2);
    --shadow-card-hover: 0 12px 40px rgba(0,0,0,.3);
    --shadow-metric-hover: 0 8px 30px rgba(37,99,235,.1);
    --shadow-btn: 0 1px 2px rgba(0,0,0,.05);
    
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    background-image: radial-gradient(ellipse at top, rgba(30,41,59,.4) 0%, var(--bg-main) 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

::selection {
    background: rgba(37,99,235,.3);
    color: #fff;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(37,99,235,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(37,99,235,.5); }

/* ===== Sidebar ===== */
.xyvora-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #111827;
    border-right: 1px solid var(--border-color);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 250ms ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.xyvora-sidebar .sidebar-logo {
    padding: var(--space-sm) var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    min-height: 80px;
}

.xyvora-sidebar .sidebar-logo img {
    max-width: 170px;
    height: auto;
    display: block;
}

.xyvora-sidebar .sidebar-powered {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 4px;
}

.xyvora-sidebar .sidebar-menu {
    padding: var(--space-xs) var(--space-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 4px;
}

.xyvora-sidebar .sidebar-menu .nav-item {
    list-style: none;
}

.xyvora-sidebar .sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.xyvora-sidebar .sidebar-menu .nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.xyvora-sidebar .sidebar-menu .nav-link.active,
.xyvora-sidebar .sidebar-menu .nav-link.active-page {
    background: rgba(37,99,235,.15);
    color: var(--text-primary);
    border-left-color: var(--primary);
}

.xyvora-sidebar .sidebar-menu .nav-link i {
    width: 22px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
}

.xyvora-sidebar .sidebar-menu .nav-link .sidebar-badge {
    margin-left: auto;
    background: rgba(37,99,235,.15);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.xyvora-sidebar .sidebar-plan {
    margin: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.xyvora-sidebar .sidebar-plan .plan-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.xyvora-sidebar .sidebar-plan .plan-name-a {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.xyvora-sidebar .sidebar-plan .plan-usage {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.xyvora-sidebar .sidebar-plan .progress {
    height: 6px;
    background: rgba(255,255,255,.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.xyvora-sidebar .sidebar-plan .progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 500ms ease;
}

.xyvora-sidebar .sidebar-plan .plan-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: rgba(37,99,235,.15);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.xyvora-sidebar .sidebar-plan .plan-btn:hover {
    background: rgba(37,99,235,.25);
}

/* ===== Topbar ===== */
.xyvora-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: #0F172A;
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    transition: var(--transition);
    gap: var(--space-md);
}

.xyvora-topbar .topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.xyvora-topbar .topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: var(--transition);
}

.xyvora-topbar .topbar-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.xyvora-topbar .topbar-title-section {
    flex-shrink: 0;
}

.xyvora-topbar .topbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.xyvora-topbar .topbar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.3;
}

.xyvora-topbar .topbar-live {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.xyvora-topbar .topbar-live .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: livePulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(34,197,94,.5);
}

.xyvora-topbar .topbar-live .live-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.xyvora-topbar .topbar-live .live-text strong {
    color: var(--success);
    font-weight: 600;
}

.xyvora-topbar .topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.xyvora-topbar .topbar-search {
    position: relative;
    width: 100%;
    max-width: 450px;
}

.xyvora-topbar .topbar-search input {
    width: 100%;
    background: #0F172A;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 10px 16px 10px 42px;
    color: var(--text-primary);
    font-size: 13px;
    height: 44px;
    transition: var(--transition);
    outline: none;
}

.xyvora-topbar .topbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.xyvora-topbar .topbar-search input::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

.xyvora-topbar .topbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.xyvora-topbar .topbar-search .search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
}

.xyvora-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.xyvora-topbar .topbar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
    position: relative;
}

.xyvora-topbar .topbar-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.xyvora-topbar .topbar-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
    border: 2px solid var(--bg-main);
}

.xyvora-topbar .topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.xyvora-topbar .topbar-avatar:hover {
    border-color: rgba(37,99,235,.3);
    transform: scale(1.05);
}

/* ===== Main Content ===== */
.xyvora-main {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    transition: var(--transition);
}

.xyvora-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* ===== Cards ===== */
.card, .xyvora-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    margin-bottom: var(--space-sm);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0 var(--space-sm) 0;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: var(--space-sm);
}

.card-body { padding: 0; }

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-color);
    padding: var(--space-sm) 0 0 0;
    margin-top: var(--space-sm);
}

/* ===== View Controls ===== */
.view-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.view-controls .view-toggle {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 3px;
}

.view-controls .view-toggle .btn {
    padding: 6px 14px;
    height: 36px;
    font-size: 13px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    border: none;
}

.view-controls .view-toggle .btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.view-controls .filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 13px;
    height: 36px;
    outline: none;
    cursor: pointer;
}

.view-controls .filter-select:focus {
    border-color: var(--primary);
}

/* ===== Metric Cards (5-column) ===== */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    transition: var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-metric-hover);
}

.metric-card .metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: var(--space-sm);
}

.metric-blue .metric-icon { background: rgba(37,99,235,.15); color: #2563EB; }
.metric-green .metric-icon { background: rgba(34,197,94,.15); color: #22C55E; }
.metric-red .metric-icon { background: rgba(239,68,68,.15); color: #EF4444; }
.metric-purple .metric-icon { background: rgba(124,58,237,.15); color: #7C3AED; }
.metric-orange .metric-icon { background: rgba(249,115,22,.15); color: #F97316; }

.metric-card .metric-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}

.metric-card .metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.metric-card .metric-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.metric-card .metric-trend.up { color: var(--success); }
.metric-card .metric-trend.down { color: var(--error); }

.metric-card .metric-progress {
    margin-top: var(--space-xs);
}

.metric-card .metric-progress .progress {
    height: 6px;
    background: rgba(255,255,255,.06);
    border-radius: 3px;
    overflow: hidden;
}

.metric-card .metric-progress .progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #F97316, #F59E0B);
}

.metric-card .metric-progress .progress-text {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* ===== Monitor Wall (Equipment Grid) ===== */
.monitor-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-sm);
}

.monitor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.monitor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.monitor-card .monitor-image {
    position: relative;
    width: 100%;
    padding-top: 60%;
    background: #000;
    overflow: hidden;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.monitor-card .monitor-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 300ms ease;
}

.monitor-card:hover .monitor-image img {
    transform: scale(1.05);
}

.monitor-card .monitor-image .placeholder-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 48px;
}

.monitor-card .monitor-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    color: #fff;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.monitor-badge.online { background: rgba(34,197,94,.85); box-shadow: 0 0 10px rgba(34,197,94,.3); }
.monitor-badge.offline { background: rgba(239,68,68,.85); }
.monitor-badge.capturando { background: rgba(37,99,235,.85); }
.monitor-badge.sem-comunicacao { background: rgba(245,158,11,.85); }

.monitor-card .monitor-actions-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0,0,0,.5);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    font-size: 16px;
}

.monitor-card:hover .monitor-actions-btn {
    opacity: 1;
}

.monitor-card .monitor-status-indicator {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,.6);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    color: #fff;
}

.monitor-card .monitor-info {
    padding: var(--space-sm);
}

.monitor-card .monitor-info .device-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.monitor-card .monitor-info .device-details {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.monitor-card .monitor-info .device-details span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.monitor-card .monitor-info .device-details i {
    width: 14px;
    font-size: 11px;
    color: var(--text-muted);
}

.monitor-card .monitor-info .last-capture {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.monitor-card .monitor-actions {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255,255,255,.02);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.monitor-card .monitor-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
    height: 28px;
    border-radius: 8px;
}

/* ===== Timeline ===== */
.timeline { padding: var(--space-sm); }

.timeline-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 28px;
    bottom: -4px;
    width: 2px;
    background: rgba(255,255,255,.06);
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
    border: 2px solid var(--bg-card);
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Problem List ===== */
.problem-list { display: flex; flex-direction: column; }

.problem-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.problem-item:last-child { border-bottom: none; }
.problem-item:hover { background: rgba(255,255,255,.02); }

.problem-priority {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.problem-priority.high { background: var(--error); }
.problem-priority.medium { background: var(--warning); }
.problem-priority.low { background: var(--text-muted); }

.problem-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.problem-status.offline { background: var(--error); box-shadow: 0 0 6px rgba(239,68,68,.4); }
.problem-status.warning { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,.4); }
.problem-status.ok { background: var(--success); }

.problem-info { flex: 1; min-width: 0; }

.problem-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.problem-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.problem-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== Botões ===== */
.btn {
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    height: 44px;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
}

.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.3); }

.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); }
.btn-secondary:hover { background: #334155; color: var(--text-primary); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16A34A; color: #fff; }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #DC2626; color: #fff; }

.btn-warning { background: var(--warning); color: #000; }

.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-outline-secondary { background: transparent; border: 1px solid var(--border-input); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--bg-secondary); color: var(--text-primary); }

.btn-outline-danger { background: transparent; border: 1px solid var(--error); color: var(--error); }
.btn-outline-danger:hover { background: var(--error); color: #fff; }

.btn-outline-success { background: transparent; border: 1px solid var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-outline-warning { background: transparent; border: 1px solid var(--warning); color: var(--warning); }
.btn-outline-warning:hover { background: var(--warning); color: #000; }

.btn-sm { padding: 6px 14px; font-size: 12px; height: 36px; border-radius: 10px; }
.btn-lg { padding: 14px 28px; font-size: 16px; height: 52px; }

/* ===== Inputs ===== */
.form-control, .form-select {
    background: #0F172A;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    height: 46px;
    transition: var(--transition);
    outline: none;
    width: 100%;
    font-family: var(--font-family);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    background: #0F172A;
    color: var(--text-primary);
}

.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { height: auto; min-height: 120px; resize: vertical; }

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ===== Tabelas ===== */
.table {
    color: var(--text-primary);
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #CBD5E1;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,.03);
    font-size: 14px;
}

.table tbody tr:hover { background: rgba(255,255,255,.03); }
.table tbody tr:last-child td { border-bottom: none; }
.table-responsive { border-radius: var(--radius-lg); }

/* ===== DataTables ===== */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: var(--space-sm); }

.dataTables_wrapper .dataTables_length select {
    background: #0F172A;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 6px 12px;
}

.dataTables_wrapper .dataTables_filter input {
    background: #0F172A;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 12px;
    margin-left: 8px;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.dataTables_wrapper .dataTables_info { color: var(--text-secondary); font-size: 13px; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    padding: 6px 12px !important;
    margin: 0 2px;
    color: var(--text-secondary) !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(37,99,235,.15) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 0;
    margin-bottom: var(--space-sm);
    background: transparent;
}

.breadcrumb-item { font-size: 13px; color: var(--text-secondary); }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-primary); }
.breadcrumb-item+.breadcrumb-item::before { color: var(--text-muted); }

/* ===== Page Title ===== */
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: var(--space-sm); }

/* ===== Badges ===== */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    letter-spacing: .3px;
}

.bg-success { background: rgba(34,197,94,.15) !important; color: var(--success) !important; }
.bg-danger { background: rgba(239,68,68,.15) !important; color: var(--error) !important; }
.bg-warning { background: rgba(245,158,11,.15) !important; color: var(--warning) !important; }
.bg-info { background: rgba(59,130,246,.15) !important; color: var(--info) !important; }
.bg-secondary { background: rgba(148,163,184,.15) !important; color: var(--text-secondary) !important; }
.bg-dark { background: var(--bg-secondary) !important; color: var(--text-primary) !important; }
.bg-primary { background: rgba(37,99,235,.15) !important; color: var(--primary) !important; }

/* ===== Alerts ===== */
.alert { border-radius: var(--radius-md); padding: var(--space-sm); font-size: 14px; border: none; }
.alert-success { background: rgba(34,197,94,.1); color: var(--success); }
.alert-danger { background: rgba(239,68,68,.1); color: var(--error); }
.alert-warning { background: rgba(245,158,11,.1); color: var(--warning); }
.alert-info { background: rgba(59,130,246,.1); color: var(--info); }
.alert-dismissible .btn-close { filter: invert(1) brightness(200%); }

/* ===== Loading ===== */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,.8); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 9999;
}
.loading-overlay.show { display: flex; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid rgba(37,99,235,.2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Notification Sidebar ===== */
.notification-sidebar {
    position: fixed; top: 0; right: -420px; width: 420px; height: 100%;
    background: var(--bg-card); border-left: 1px solid var(--border-color);
    z-index: 1050; transition: right 250ms ease; overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0,0,0,.3);
}
.notification-sidebar.open { right: 0; }
.notification-sidebar .notification-header { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.notification-sidebar .notification-item { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); transition: var(--transition); cursor: pointer; }
.notification-sidebar .notification-item:hover { background: rgba(255,255,255,.03); }
.notification-sidebar .notification-item.unread { border-left: 3px solid var(--primary); }

/* ===== Dropdown ===== */
.dropdown-menu {
    background: #111827; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.dropdown-menu .dropdown-item {
    color: var(--text-secondary); padding: 10px 14px;
    border-radius: 8px; font-size: 13px; transition: var(--transition);
}
.dropdown-menu .dropdown-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.dropdown-menu .dropdown-item i { width: 20px; text-align: center; }
.dropdown-divider { border-color: var(--border-color); margin: 4px 0; }

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; background: #0F172A; padding: var(--space-sm);
    position: relative;
}
.auth-page::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at top, rgba(37,99,235,.08) 0%, transparent 60%);
    pointer-events: none;
}
.auth-card {
    background: #111827; border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); box-shadow: 0 8px 48px rgba(0,0,0,.3);
    width: 100%; max-width: 440px; padding: var(--space-lg); position: relative;
}
.auth-card .auth-logo { text-align: center; margin-bottom: var(--space-lg); }
.auth-card .auth-logo img { max-width: 200px; height: auto; }
.auth-card .auth-logo h1 { font-size: 22px; font-weight: 700; margin-top: var(--space-sm); }
.auth-card .auth-logo p { color: var(--text-secondary); font-size: 13px; }

/* ===== Modal ===== */
.modal { background: rgba(15,23,42,.7); backdrop-filter: blur(8px); }
.modal-content { background: #111827; border: 1px solid var(--border-color); border-radius: var(--radius-xl); box-shadow: 0 16px 64px rgba(0,0,0,.4); }
.modal-header { border-bottom: 1px solid var(--border-color); padding: var(--space-md); }
.modal-body { padding: var(--space-md); }
.modal-footer { border-top: 1px solid var(--border-color); padding: var(--space-md); }
.modal .btn-close { filter: invert(1) brightness(200%); }

/* ===== Progress ===== */
.progress { background: var(--bg-secondary); border-radius: 8px; overflow: hidden; }
.progress-bar { background: var(--primary); border-radius: 8px; }

/* ===== Tooltip ===== */
.tooltip-inner { background: var(--bg-secondary); color: var(--text-primary); border-radius: 8px; padding: 6px 12px; font-size: 12px; border: 1px solid var(--border-color); }

/* ===== Live Indicator Animation ===== */
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.85); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .xyvora-container { padding: var(--space-sm); }
    .monitor-wall { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .xyvora-topbar .topbar-search { max-width: 300px; }
}

@media (max-width: 768px) {
    .xyvora-sidebar { transform: translateX(-100%); }
    .xyvora-sidebar.open { transform: translateX(0); }
    .xyvora-topbar { left: 0; }
    .xyvora-topbar .topbar-toggle { display: flex; }
    .xyvora-main { margin-left: 0; }
    .xyvora-topbar .topbar-center { display: none; }
    .xyvora-topbar .topbar-live { display: none; }
    .topbar-title { font-size: 16px; }
    .notification-sidebar { width: 100%; right: -100%; }
    .metric-card .metric-value { font-size: 24px; }
}

@media (max-width: 576px) {
    .monitor-wall { grid-template-columns: 1fr; }
    .xyvora-container { padding: var(--space-xs); }
}

/* ===== Stat Cards (legado) ===== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: var(--space-sm); }
.stat-card-primary .stat-icon { background: rgba(37,99,235,.15); color: var(--primary); }
.stat-card-success .stat-icon { background: rgba(34,197,94,.15); color: var(--success); }
.stat-card-danger .stat-icon { background: rgba(239,68,68,.15); color: var(--error); }
.stat-card-warning .stat-icon { background: rgba(245,158,11,.15); color: var(--warning); }
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); }

/* ===== Select2 ===== */
.select2-container--bootstrap-5 .select2-selection { background: #0F172A !important; border: 1px solid var(--border-input) !important; border-radius: var(--radius-md) !important; min-height: 46px !important; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--text-primary) !important; line-height: 46px !important; }
.select2-dropdown { background: #111827 !important; border: 1px solid var(--border-input) !important; border-radius: var(--radius-md) !important; }
.select2-results__option { color: var(--text-secondary) !important; }
.select2-results__option--highlighted { background: var(--bg-secondary) !important; color: var(--text-primary) !important; }

/* ===== Utilities ===== */
.text-muted { color: var(--text-secondary) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }

.bg-main { background: var(--bg-main); }
.bg-card { background: var(--bg-card); }
.cursor-pointer { cursor: pointer; }

.fade { transition: opacity 200ms ease; }