html {
  font-size: 14px;
}

:root {
  --app-bg: #f8fafc;
  --app-surface: #ffffff;
  --app-surface-muted: #f1f5f9;
  --app-text: #0f172a;
  --app-muted: #64748b;
  --app-border: #e2e8f0;
  --app-input-bg: #ffffff;
  --app-input-text: #0f172a;
  --app-table-hover: #f8fafc;
  --app-shadow: 0 0.125rem 0.25rem rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
  --app-bg: #0f172a;
  --app-surface: #172033;
  --app-surface-muted: #111827;
  --app-text: #e5e7eb;
  --app-muted: #94a3b8;
  --app-border: #334155;
  --app-input-bg: #0b1220;
  --app-input-text: #e5e7eb;
  --app-table-hover: #1e293b;
  --app-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: var(--app-bg);
  color: var(--app-text);
}

.app-navbar,
.card,
.dropdown-menu {
  background-color: var(--app-surface) !important;
  color: var(--app-text);
}

.navbar-brand,
.nav-link,
.card,
.table,
label,
.form-label,
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--app-text) !important;
}

.text-muted,
.form-text,
.footer {
  color: var(--app-muted) !important;
}

.border,
.border-top,
.border-bottom,
.card,
.table,
.form-control,
.form-select {
  border-color: var(--app-border) !important;
}

.box-shadow,
.shadow-sm {
  box-shadow: var(--app-shadow) !important;
}

.form-control,
.form-select,
.form-check-input,
textarea {
  background-color: var(--app-input-bg) !important;
  color: var(--app-input-text) !important;
}

.form-control::placeholder {
  color: var(--app-muted);
}

.form-control:disabled,
.form-select:disabled {
  background-color: var(--app-surface-muted) !important;
  color: var(--app-muted) !important;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--app-text);
  --bs-table-border-color: var(--app-border);
  color: var(--app-text);
}

.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: var(--app-table-hover);
  color: var(--app-text);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: var(--app-surface-muted);
  color: var(--app-text);
}

.modal-content,
.alert-light {
  background-color: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-border);
}

html[data-theme="dark"] .btn-outline-secondary {
  color: #cbd5e1;
  border-color: #64748b;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
  color: #0f172a;
  background-color: #cbd5e1;
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-success,
html[data-theme="dark"] .btn-outline-danger {
  background-color: transparent;
}

html[data-theme="dark"] .navbar-toggler {
  border-color: var(--app-border);
  filter: invert(1);
}

.badge-service-internet {
  color: #064e3b;
  background-color: #a7f3d0;
  border: 1px solid #34d399;
}

.badge-service-cable {
  color: #713f12;
  background-color: #fde68a;
  border: 1px solid #f59e0b;
}

.badge-status-active {
  color: #14532d;
  background-color: #bbf7d0;
  border: 1px solid #22c55e;
}

.badge-status-inactive {
  color: #374151;
  background-color: #e5e7eb;
  border: 1px solid #9ca3af;
}

.badge-status-warning {
  color: #713f12;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
}

.badge-status-danger {
  color: #7f1d1d;
  background-color: #fecaca;
  border: 1px solid #ef4444;
}

.badge-status-service {
  color: #1e3a8a;
  background-color: #dbeafe;
  border: 1px solid #60a5fa;
}

.badge-status-billing {
  color: #581c87;
  background-color: #f3e8ff;
  border: 1px solid #c084fc;
}

.badge-role {
  color: #111827;
  background-color: #e0e7ff;
  border: 1px solid #818cf8;
}

.sortable-column {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-column::after {
  color: #9ca3af;
  content: " ↕";
  font-size: 0.75rem;
}

.sortable-column.sort-asc::after {
  color: #2563eb;
  content: " ↑";
}

.sortable-column.sort-desc::after {
  color: #2563eb;
  content: " ↓";
}

.table-page-size {
  width: auto;
}

.traffic-chart-wrap {
  min-height: 280px;
  position: relative;
}

.nav-tabs {
  border-color: var(--app-border);
}

.nav-tabs .nav-link {
  color: var(--app-muted) !important;
}

.nav-tabs .nav-link:hover {
  border-color: var(--app-border);
}

.nav-tabs .nav-link.active {
  background-color: var(--app-surface);
  color: var(--app-text) !important;
  border-color: var(--app-border) var(--app-border) var(--app-surface);
}
