:root {
  --ui-bg: #f6f7fb;
  --ui-surface: #ffffff;
  --ui-border: #d9dee8;
  --ui-border-soft: #edf0f5;
  --ui-text: #101828;
  --ui-muted: #667085;
  --ui-primary: #2563eb;
  --ui-primary-strong: #1d4ed8;
  --ui-success: #16a34a;
  --ui-warning: #d97706;
  --ui-danger: #dc2626;
  --ui-info: #0891b2;
}

/* Teal-white product theme */
:root {
  --ui-bg: #f3faf9;
  --ui-border-soft: #dbe7e5;
  --ui-primary: #0f766e;
  --ui-primary-strong: #115e59;
  --ui-primary-soft: #ccfbf1;
}

body,
.main-panel {
  background: #f3faf9;
}

.modern-sidebar,
.sidebar {
  background: #0f3f3b !important;
}

.brand-mark,
.sidebar .nav li.active > a,
.sidebar .nav li.active > a i,
.sidebar .nav li > a:hover,
.sidebar .nav li > a:hover i {
  background: #115e59 !important;
}

.brand-mark .material-icons {
  color: #ccfbf1;
}

.navbar.navbar-transparent {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom-color: #dbe7e5;
}

.navbar-clock {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-top: 2px;
}

.navbar-clock span {
  color: var(--ui-primary);
}

.card,
.modern-card,
.modern-stat,
.auth-card,
.auth-clock {
  border-color: #dbe7e5;
}

.card-stats .card-header.card-header-icon .card-icon,
.stat-icon.neutral {
  background: #ecfdf5 !important;
  border-color: #bce7df;
  color: var(--ui-primary);
}

.btn-outline-primary {
  border-color: #99d8d0;
  color: var(--ui-primary);
}

.btn-outline-primary:hover {
  background: #ecfdf5;
  border-color: #5ebbb0;
  color: var(--ui-primary-strong);
}

.form-control:focus,
.custom-select:focus {
  border-color: #5ebbb0;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.modern-footer {
  align-items: center;
  border-top: 1px solid #dbe7e5;
  color: var(--ui-muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  padding: 16px 0;
}

.modern-footer strong {
  color: var(--ui-primary);
}

.auth-shell {
  align-items: center;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(280px, 460px) minmax(340px, 520px);
  justify-content: center;
  min-height: 100vh;
  padding: 110px 28px 54px;
  position: relative;
}

.auth-copy h1 {
  color: #0f3f3b;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.04;
  margin: 12px 0 16px;
}

.auth-copy p {
  color: #526866;
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}

.auth-badge {
  background: #ffffff;
  border: 1px solid #bce7df;
  border-radius: 999px;
  color: var(--ui-primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 8px 12px;
  text-transform: uppercase;
}

.auth-clock {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe7e5;
  border-radius: 8px;
  display: inline-flex;
  gap: 12px;
  margin-top: 26px;
  padding: 12px 16px;
}

.auth-clock span {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-clock strong {
  color: var(--ui-primary);
  font-size: 22px;
  letter-spacing: 0;
}

.auth-panel {
  width: 100%;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #dbe7e5;
  border-radius: 12px;
  padding: 30px;
}

.auth-card-header {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 26px;
}

.auth-mark {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #bce7df;
  border-radius: 10px;
  color: var(--ui-primary);
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.auth-card h2 {
  color: var(--ui-text);
  font-size: 24px;
  font-weight: 900;
  margin: 0;
}

.auth-card p {
  color: var(--ui-muted);
  margin: 4px 0 0;
}

.auth-card .form-group {
  margin-bottom: 18px;
}

.auth-card label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.auth-card .btn {
  min-height: 46px;
}

.auth-footer {
  bottom: 22px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  left: 0;
  position: absolute;
  text-align: center;
  width: 100%;
}

.auth-nav .navbar-brand {
  color: #0f3f3b;
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 96px;
  }

  .auth-copy h1 {
    font-size: 34px;
  }
}

@media (max-width: 575px) {
  .auth-shell {
    gap: 22px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-copy h1 {
    font-size: 30px;
  }

  .auth-card {
    padding: 22px;
  }

  .modern-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.btn.btn-primary,
.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active,
.btn.btn-primary.active {
  background: #0f766e !important;
  border-color: #0f766e !important;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16) !important;
  color: #ffffff !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background: #115e59 !important;
  border-color: #115e59 !important;
}

.card [class*="card-header-"],
.card .card-header-primary,
.card .card-header-info,
.card .card-header-success,
.card .card-header-warning,
.card .card-header-danger,
.card .card-header-rose,
.card .card-icon,
.card .card-text,
[class*="card-header-"]:not(.card-header-icon):not(.card-header-text):not(.card-header-image) {
  background: #ffffff !important;
  border: 1px solid #dbe7e5;
  box-shadow: none !important;
  color: #0f3f3b !important;
}

.card [class*="card-header-"] .card-title,
.card [class*="card-header-"] .card-category,
.card [class*="card-header-"] i,
.card .card-icon i {
  color: inherit !important;
}

body {
  background: var(--ui-bg);
  color: var(--ui-text);
  letter-spacing: 0;
}

.main-panel {
  background: var(--ui-bg);
}

.content {
  padding-top: 88px;
}

.modern-sidebar,
.sidebar {
  background: #0f172a !important;
  box-shadow: none;
}

.sidebar::before,
.sidebar::after,
.sidebar .sidebar-background {
  display: none !important;
}

.sidebar .logo {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 18px;
}

.sidebar .logo .simple-text {
  color: #ffffff;
  text-align: left;
  line-height: 1.2;
}

.sidebar .logo small {
  color: #cbd5e1;
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 6px;
}

.brand-mark {
  align-items: center;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  margin-right: 10px;
  vertical-align: middle;
  width: 36px;
}

.brand-mark .material-icons {
  color: #93c5fd;
  font-size: 21px;
}

.sidebar .nav {
  margin-top: 12px;
  padding: 0 10px;
}

.sidebar .nav li > a,
.sidebar .nav li .dropdown-menu a {
  border-radius: 8px;
  color: #cbd5e1;
  margin: 4px 0;
}

.sidebar .nav li.active > a,
.sidebar .nav li.active > a i,
.sidebar .nav li > a:hover,
.sidebar .nav li > a:hover i {
  background: #1e293b !important;
  color: #ffffff !important;
}

.sidebar .nav i {
  color: #94a3b8;
}

.navbar.navbar-transparent {
  background: rgba(246, 247, 251, 0.94) !important;
  border-bottom: 1px solid var(--ui-border-soft);
  box-shadow: none;
}

.navbar .navbar-brand {
  color: var(--ui-text);
  font-size: 20px;
  letter-spacing: 0;
}

.navbar .nav-link,
.navbar .nav-link i {
  color: var(--ui-muted) !important;
}

.card,
.modern-card,
.modern-stat {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border-soft);
  border-radius: 8px;
  box-shadow: none;
}

.card .card-header,
.card [class*="card-header-"] {
  background: #ffffff !important;
  border-bottom: 1px solid var(--ui-border-soft);
  border-radius: 8px 8px 0 0;
  box-shadow: none;
  color: var(--ui-text) !important;
  margin: 0;
  padding: 18px 20px;
}

.card .card-header .card-title,
.card [class*="card-header-"] .card-title,
.card [class*="card-header-"] .card-category {
  color: var(--ui-text) !important;
}

.card .card-category,
.card .card-footer .stats,
.text-secondary {
  color: var(--ui-muted) !important;
}

.card-stats .card-header.card-header-icon .card-icon {
  background: #eff6ff !important;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  box-shadow: none;
  color: var(--ui-primary);
}

.card-stats .card-header.card-header-icon .card-icon i,
.card-stats .card-header.card-header-icon .card-icon a {
  color: var(--ui-primary) !important;
}

.btn {
  border-radius: 8px;
  box-shadow: none !important;
  letter-spacing: 0;
  text-transform: none;
}

.btn-primary,
.btn-info,
.btn-danger,
.btn-success {
  background: var(--ui-primary) !important;
  border-color: var(--ui-primary) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn-info:hover,
.btn-danger:hover,
.btn-success:hover {
  background: var(--ui-primary-strong) !important;
  border-color: var(--ui-primary-strong) !important;
}

.btn-outline-primary {
  border-color: #bfdbfe;
  color: var(--ui-primary);
}

.btn-outline-primary:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--ui-primary-strong);
}

.form-control,
.custom-select,
select.form-control {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  color: var(--ui-text);
  min-height: 42px;
  padding: 8px 12px;
}

.form-control:focus,
.custom-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.table > thead > tr > th {
  border-bottom: 1px solid var(--ui-border-soft);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table > tbody > tr > td {
  border-top: 1px solid var(--ui-border-soft);
  color: var(--ui-text);
  vertical-align: middle;
}

.page-heading {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-heading h1 {
  color: var(--ui-text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.eyebrow {
  color: var(--ui-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.page-subtitle,
.modern-card-header p,
.table-subtitle,
.modal-subtitle {
  color: var(--ui-muted);
  margin: 4px 0 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.page-actions .btn,
.action-cell .btn {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.modern-stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.modern-stat {
  align-items: center;
  display: flex;
  gap: 14px;
  padding: 18px;
}

.modern-stat p {
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.modern-stat strong {
  color: var(--ui-text);
  display: block;
  font-size: 28px;
  line-height: 1.1;
  margin-top: 4px;
}

.stat-icon {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.stat-icon.neutral {
  background: #f1f5f9;
  color: #475569;
}

.stat-icon.success {
  background: #dcfce7;
  color: var(--ui-success);
}

.stat-icon.danger {
  background: #fee2e2;
  color: var(--ui-danger);
}

.stat-icon.warning {
  background: #fef3c7;
  color: var(--ui-warning);
}

.modern-card {
  overflow: hidden;
}

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

.modern-card-header h2 {
  color: var(--ui-text);
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.modern-table {
  margin-bottom: 0;
}

.table-title {
  color: var(--ui-text);
  font-weight: 800;
}

.empty-state {
  color: var(--ui-muted);
  padding: 34px !important;
  text-align: center;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  text-transform: capitalize;
}

.status-pill.online {
  background: #dcfce7;
  color: #166534;
}

.status-pill.offline,
.status-pill.error {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.unknown {
  background: #f1f5f9;
  color: #475569;
}

.modern-modal {
  border: 1px solid var(--ui-border-soft);
  border-radius: 8px;
  box-shadow: none;
}

.modern-modal .modal-header,
.modern-modal .modal-footer {
  border-color: var(--ui-border-soft);
}

.modern-modal .modal-title {
  color: var(--ui-text);
  font-weight: 800;
}

.modern-check {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  margin-top: 8px;
}

.modern-check input {
  height: 18px;
  width: 18px;
}

.modern-inline-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.modern-inline-form .btn {
  min-height: 42px;
}

code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #334155;
  padding: 2px 5px;
}

.is-loading {
  cursor: wait;
  opacity: 0.72;
}

@media (max-width: 991px) {
  .page-heading {
    display: block;
  }

  .page-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .modern-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modern-inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .content {
    padding-top: 78px;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .modern-stat-grid {
    grid-template-columns: 1fr;
  }

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

  .modern-stat strong {
    font-size: 24px;
  }
}

/* Final teal theme overrides */
:root {
  --ui-bg: #f3faf9;
  --ui-border-soft: #dbe7e5;
  --ui-primary: #0f766e;
  --ui-primary-strong: #115e59;
}

body,
.main-panel {
  background: #f3faf9;
}

.modern-sidebar,
.sidebar {
  background: #0f3f3b !important;
}

.brand-mark,
.sidebar .nav li.active > a,
.sidebar .nav li > a:hover {
  background: #115e59 !important;
}

.brand-mark .material-icons {
  color: #ccfbf1;
}

.navbar.navbar-transparent {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom-color: #dbe7e5;
}

.navbar-clock {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-top: 2px;
}

.navbar-clock span,
.modern-footer strong,
.auth-clock strong {
  color: var(--ui-primary);
}

.card,
.modern-card,
.modern-stat {
  border-color: #dbe7e5;
}

.card-stats .card-header.card-header-icon .card-icon,
.stat-icon.neutral {
  background: #ecfdf5 !important;
  border-color: #bce7df;
  color: var(--ui-primary);
}

.btn-outline-primary {
  border-color: #99d8d0;
  color: var(--ui-primary);
}

.btn-outline-primary:hover {
  background: #ecfdf5;
  border-color: #5ebbb0;
  color: var(--ui-primary-strong);
}

.form-control:focus,
.custom-select:focus {
  border-color: #5ebbb0;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.modern-footer {
  align-items: center;
  border-top: 1px solid #dbe7e5;
  color: var(--ui-muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  padding: 16px 0;
}

.auth-shell {
  align-items: center;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(280px, 460px) minmax(340px, 520px);
  justify-content: center;
  min-height: 100vh;
  padding: 110px 28px 54px;
  position: relative;
}

.auth-copy h1 {
  color: #0f3f3b;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.04;
  margin: 12px 0 16px;
}

.auth-copy p {
  color: #526866;
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}

.auth-badge {
  background: #ffffff;
  border: 1px solid #bce7df;
  border-radius: 999px;
  color: var(--ui-primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 8px 12px;
  text-transform: uppercase;
}

.auth-clock {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe7e5;
  border-radius: 8px;
  display: inline-flex;
  gap: 12px;
  margin-top: 26px;
  padding: 12px 16px;
}

.auth-clock span {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 900;
}

.auth-clock strong {
  font-size: 22px;
  letter-spacing: 0;
}

.auth-panel {
  width: 100%;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #dbe7e5;
  border-radius: 12px;
  padding: 30px;
}

.auth-card-header {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 26px;
}

.auth-mark {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #bce7df;
  border-radius: 10px;
  color: var(--ui-primary);
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.auth-card h2 {
  color: var(--ui-text);
  font-size: 24px;
  font-weight: 900;
  margin: 0;
}

.auth-card p {
  color: var(--ui-muted);
  margin: 4px 0 0;
}

.auth-card .form-group {
  margin-bottom: 18px;
}

.auth-card label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.auth-card .btn {
  min-height: 46px;
}

.auth-footer {
  bottom: 22px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  left: 0;
  position: absolute;
  text-align: center;
  width: 100%;
}

.auth-nav .navbar-brand {
  color: #0f3f3b;
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 96px;
  }

  .auth-copy h1 {
    font-size: 34px;
  }
}

@media (max-width: 575px) {
  .auth-shell {
    gap: 22px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .auth-copy h1 {
    font-size: 30px;
  }

  .auth-card {
    padding: 22px;
  }

  .modern-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
