/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================================================== */
:root {
  /* Color Palette (Deep Tech Dark theme with Cyan/Purple accents) */
  --bg-base: #070a13;
  --bg-surface: rgba(17, 24, 39, 0.55);
  --bg-surface-solid: #111827;
  --bg-card: rgba(30, 41, 59, 0.45);
  --bg-card-hover: rgba(30, 41, 59, 0.65);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.15);
  
  --primary: #00f0ff;
  --primary-glow: rgba(0, 240, 255, 0.35);
  --primary-hover: #00b8cc;
  --primary-dark: #008fa3;
  
  --secondary: #bd5cff;
  --secondary-glow: rgba(189, 92, 255, 0.3);
  --secondary-hover: #a63df2;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --muted: #64748b;
  
  --text-main: #f3f4f6;
  --text-title: #ffffff;
  --text-muted: #9ca3af;
  
  --font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --glass-blur: blur(12px);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* ==========================================================================
   GLOBAL RESETS
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 10% 20%, rgba(189, 92, 255, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 240, 255, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-title);
  font-weight: 600;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

textarea {
  resize: vertical;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.glass {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-premium);
}

.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.success { color: var(--success); }
.warning { color: var(--warning); }
.danger { color: var(--danger); }
.font-lg { font-size: 1.25rem; font-weight: 700; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.p-0 { padding: 0 !important; }
.animate-spin {
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   APP CONTAINER LAYOUT
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.sidebar {
  width: 280px;
  background: rgba(8, 12, 23, 0.8);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: var(--glass-blur);
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo-container {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  transition: var(--transition-smooth);
}

.sidebar-brand:hover .brand-logo-container {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  transform: scale(1.05);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text h1 span {
  color: var(--primary);
}

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

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.nav-item i {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-glow), transparent);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  box-shadow: -5px 0 15px -5px var(--primary-glow);
}

.badge {
  margin-left: auto;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-main);
}

.badge-alert {
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Connection status indicator */
.mt-connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.mt-connection-status.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.mt-connection-status.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.mt-connection-status.online {
  border-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.mt-connection-status.offline {
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Topbar Header */
.topbar {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
  background: rgba(7, 10, 19, 0.5);
  flex-shrink: 0;
}

.topbar-left h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.topbar-left .current-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.router-quick-stats {
  display: flex;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

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

.stat-group .label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.stat-group .val {
  font-weight: 600;
  color: var(--primary);
}

.profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-widget .avatar {
  width: 38px;
  height: 38px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--primary-glow);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.profile-info .name {
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-info .role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Alert Banner */
.alert-banner {
  margin: 20px 40px 0 40px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideDown 0.3s ease;
}

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

.alert-banner.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.alert-banner.warning i {
  width: 24px;
  height: 24px;
}

.banner-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.banner-content p {
  font-size: 0.8rem;
  color: var(--text-main);
  opacity: 0.9;
}

.btn-close {
  margin-left: auto;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.btn-close:hover {
  opacity: 1;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-1px);
}

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

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

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-text {
  padding: 4px 8px;
  color: var(--primary);
  font-size: 0.8rem;
}

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

.btn-xs {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   ROUTING VIEW CONTAINER
   ========================================================================== */
.content-view {
  display: none;
  padding: 30px 40px;
  flex-grow: 1;
}

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

/* ==========================================================================
   VIEW: DASHBOARD MODULE
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

.card-icon.income { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.card-icon.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.card-icon.users { background: rgba(0, 240, 255, 0.1); color: var(--primary); }
.card-icon.ppp { background: rgba(189, 92, 255, 0.15); color: var(--secondary); }

.card-data .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.card-data h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0;
  letter-spacing: -0.5px;
}

.card-data .sub-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.panel-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h3 i {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

.panel-body {
  padding: 24px;
}

/* Real-Time Chart area */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.traffic-metrics-row {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.traffic-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traffic-box .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.traffic-box.rx .dot { background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }
.traffic-box.tx .dot { background: var(--secondary); box-shadow: 0 0 8px var(--secondary-glow); }

.traffic-box .lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.traffic-box .speed {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Hardware / Router status displaying */
.router-card {
  height: max-content;
}

.router-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.progress-ring-container {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(#0c1122, #18223f);
  border: 4px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  position: relative;
}

/* Glow bar on high CPU */
.progress-ring-container::before {
  content: '';
  position: absolute;
  top: -6px; left: -6px; right: -6px; bottom: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-bottom-color: var(--secondary);
  animation: spin 3s linear infinite;
  opacity: 0.4;
}

.progress-ring-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-title);
}

.progress-ring-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hardware-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

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

.detail-item .value {
  font-weight: 600;
}

/* Alert list */
.alert-list {
  display: flex;
  flex-direction: column;
}

.alert-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}

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

.alert-item i {
  flex-shrink: 0;
}

.alert-item.danger-alert { background: rgba(239, 68, 68, 0.03); color: #fca5a5; }
.alert-item.warning-alert { background: rgba(245, 158, 11, 0.03); color: #fde047; }
.alert-item.success-alert { background: rgba(16, 185, 129, 0.03); color: #a7f3d0; }

/* ==========================================================================
   TABLE COMPONENT
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.table th {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition-smooth);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges inside tables */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.active { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.status-badge.suspended { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.status-badge.online { background: rgba(16, 185, 129, 0.2); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge.offline { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.status-badge.paid { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.status-badge.pending { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.status-badge.expired { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

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

.btn-table {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-table:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-table.primary:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 10px var(--primary-glow);
}

.btn-table.success:hover {
  background: var(--success);
  color: #fff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.btn-table.warning:hover {
  background: var(--warning);
  color: #000;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.btn-table.danger:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-table i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   ACTIONS BAR COMPONENT
   ========================================================================== */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.search-box {
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box i {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

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

.action-buttons {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   VIEW: BILLING & COLLECTIONS (COBROS)
   ========================================================================== */
.billing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.billing-filters {
  display: flex;
  gap: 24px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.filter-group select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.btn-group {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-tab {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 4px;
  color: var(--text-muted);
}

.btn-tab.active {
  background: var(--primary-glow);
  color: var(--primary);
}

/* ==========================================================================
   VIEW: INTERNET PLANS (PLANES)
   ========================================================================== */
.planes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.plan-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-glow);
  box-shadow: 0 15px 30px rgba(0, 240, 255, 0.1);
}

.plan-header-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.plan-header-title h4 {
  font-size: 1.15rem;
  font-weight: 700;
}

.plan-speed-badge {
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.plan-price-box {
  margin-bottom: 24px;
}

.plan-price-box .price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-title);
}

.plan-price-box .period {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.plan-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.plan-features-list li {
  list-style: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features-list li i {
  color: var(--success);
  width: 16px;
  height: 16px;
}

.plan-actions {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

/* ==========================================================================
   VIEW: SUPPORT DESK (SOPORTE)
   ========================================================================== */
.tickets-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  height: calc(100vh - 220px);
}

.ticket-panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.2);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.ticket-list {
  flex-grow: 1;
  overflow-y: auto;
}

.ticket-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ticket-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ticket-item.active {
  background: rgba(0, 240, 255, 0.04);
  border-left: 4px solid var(--primary);
}

.ticket-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ticket-item-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.ticket-priority {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.ticket-priority.alta { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.ticket-priority.media { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.ticket-priority.baja { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.ticket-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.ticket-item-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Ticket Details sidebar displaying */
.ticket-detail-panel {
  border-radius: var(--radius-lg);
  padding: 30px;
  overflow-y: auto;
}

.detail-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.detail-empty i {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.detail-empty h4 {
  font-size: 1.1rem;
}

.ticket-detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.ticket-detail-header .ticket-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.8rem;
}

.ticket-detail-desc {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.ticket-actions-box {
  margin-bottom: 24px;
}

.ticket-actions-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   VIEW: MIKROTIK ROUTER & TERMINAL (SSH)
   ========================================================================== */
.router-config-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .router-config-layout {
    grid-template-columns: 1fr;
  }
}

.config-form-panel {
  padding: 24px;
}

/* SSH terminal emulator */
.terminal-panel {
  overflow: hidden;
}

.terminal-box {
  background: #03050a;
  border: 1px solid #1e293b;
  height: 380px;
  overflow-y: auto;
  font-family: "Courier New", Courier, monospace;
  padding: 16px;
  font-size: 0.78rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.terminal-line {
  display: flex;
  gap: 8px;
  line-height: 1.4;
  word-break: break-all;
}

.terminal-line .time {
  color: var(--muted);
  flex-shrink: 0;
}

.terminal-line .cmd {
  color: var(--primary);
  font-weight: bold;
}

.terminal-line .res {
  color: #e2e8f0;
  white-space: pre-wrap;
}

.terminal-line.error .res {
  color: var(--danger);
}

.terminal-line.system .msg {
  color: var(--secondary);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-main);
  transition: var(--transition-smooth);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(0, 0, 0, 0.3);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   MODAL WINDOWS COMPONENT
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 5, 10, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-box {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 550px; }

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

/* Payment quick details */
.payment-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.summary-item .lbl { color: var(--text-muted); }
.summary-item .val { font-weight: 600; }
.summary-item.highlight {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: 5px;
}
.summary-item.highlight .val {
  color: var(--success);
}

.modal-divider {
  border: 0;
  border-top: 1px dashed var(--border-color);
  margin: 20px 0;
}

.alert-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.15);
  color: var(--primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
}

.alert-info-box i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Ping tools console display */
.ping-details-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.ping-meta {
  font-size: 0.82rem;
}

.ping-console {
  background: #020408;
  border: 1px solid #1e293b;
  height: 180px;
  font-family: monospace;
  padding: 12px;
  font-size: 0.75rem;
  overflow-y: auto;
  border-radius: var(--radius-md);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.ping-console .placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.ping-summary-stats {
  display: flex;
  gap: 20px;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-md);
}

.ping-summary-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ping-summary-stats .stat .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ping-summary-stats .stat .val {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ==========================================================================
   THERMAL RECEIPT TICKET (IMPRESION)
   ========================================================================== */
.modal-ticket {
  max-width: 360px;
}

.ticket-scroll {
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px !important;
}

.thermal-ticket {
  width: 100%;
  background: #fff;
  color: #000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 10px 5px;
}

.ticket-header {
  text-align: center;
  margin-bottom: 12px;
}

.ticket-header h2 {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 800;
  color: #000;
}

.ticket-header .company-subtitle {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
}

.ticket-header p {
  font-size: 10px;
  margin: 1px 0;
}

.ticket-divider {
  text-align: center;
  font-size: 10px;
  margin: 6px 0;
}

.ticket-details p {
  margin: 3px 0;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 10px 0;
}

.ticket-table th {
  border-bottom: 1px dashed #000;
  padding: 4px 0;
  background: transparent;
  color: #000;
  font-size: 10px;
}

.ticket-table td {
  padding: 6px 0;
  border-bottom: none;
}

.ticket-subtext {
  font-size: 9px;
  color: #333;
}

.ticket-totals p {
  margin: 4px 0;
  text-align: right;
}

.ticket-totals .total-row {
  font-size: 13px;
  border-top: 1px dashed #000;
  padding-top: 6px;
}

.ticket-footer {
  text-align: center;
  margin-top: 15px;
  font-size: 10px;
}

.ticket-footer p {
  margin: 3px 0;
}

.ticket-barcode {
  font-size: 16px;
  letter-spacing: 1px;
  margin-top: 10px;
}

.ticket-generation {
  font-size: 8px;
  color: #555;
  margin-top: 5px !important;
}

/* ==========================================================================
   PRINT HOJA DE ESTILOS (@media print)
   ========================================================================== */
@media print {
  /* Ocultar todo lo demás de la página */
  body * {
    visibility: hidden;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  /* Hacer visible únicamente la caja del ticket térmico */
  #thermal-ticket-print, #thermal-ticket-print * {
    visibility: visible;
  }
  
  #thermal-ticket-print {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm; /* Sized for standard thermal ticket width */
    padding: 0;
    margin: 0;
    background: #fff !important;
    color: #000 !important;
  }
  
  /* Desactivar márgenes del navegador */
  @page {
    margin: 0;
    size: auto;
  }
}

/* Sidebar toggle button style (hidden on desktop) */
.sidebar-toggle-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}
.sidebar-toggle-btn i {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN PATTERNS
   ========================================================================== */
@media (max-width: 991px) {
  /* Metrics Grid adjusting */
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  /* Overlay Backdrop for Mobile Sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 12, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hamburger Menu Button display */
  .sidebar-toggle-btn {
    display: flex !important;
  }
  
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* Sidebar positioning for mobile (off-screen by default) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Topbar Header adjustment */
  .topbar {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  
  .router-quick-stats {
    padding: 4px 10px;
  }

  .content-view {
    padding: 20px;
  }

  /* Dashboard cols */
  .dash-layout {
    grid-template-columns: 1fr;
  }

  /* Adjust actions bar */
  .actions-bar {
    flex-direction: column;
    gap: 14px;
    align-items: stretch !important;
  }
  
  .actions-bar .search-box {
    width: 100% !important;
  }
  
  .actions-bar .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  /* Table responses spacing */
  .table th, .table td {
    padding: 12px 14px;
  }
  
  /* Ticket layout for support technical mesa */
  .tickets-layout {
    grid-template-columns: 1fr !important;
  }
  
  /* Router Config view */
  .router-config-layout {
    grid-template-columns: 1fr !important;
  }
}

