/* ShreeNMS — ISP operations portal theme (fiber NOC + subscriber ops) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --isp-navy: #0a1726;
  --isp-navy-mid: #112337;
  --isp-sidebar-border: #1a334c;
  --isp-canvas: #eef1f5;
  --isp-surface: #ffffff;
  --isp-line: #d0d8e2;
  --isp-text: #152231;
  --isp-muted: #566578;
  --isp-accent: #0b87a3;
  --isp-accent-hover: #096e86;
  --isp-accent-soft: #e8f4f7;
  --isp-signal: #16925c;
  --isp-warn: #b0720c;
  --isp-danger: #b8323f;
  --isp-header-h: 58px;
  --isp-radius: 8px;
  --isp-radius-lg: 10px;
  --isp-shadow-sm: 0 1px 2px rgba(10, 23, 38, 0.06);
  --isp-shadow-md: 0 8px 24px rgba(10, 23, 38, 0.08);
  --bs-primary: #0b87a3;
  --bs-primary-rgb: 11, 135, 163;
  --bs-border-radius: var(--isp-radius);
  --bs-border-radius-lg: var(--isp-radius-lg);
  --bs-body-font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-bg: var(--isp-canvas);
  --bs-body-color: var(--isp-text);
  --bs-border-color: var(--isp-line);
  --bs-secondary-color: var(--isp-muted);
  --bs-tertiary-bg: #f2f5f8;
  --bs-link-color: #0a6e87;
  --bs-link-hover-color: #085a6e;
  color-scheme: light;
}

body {
  font-family: var(--bs-body-font-family);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--bs-link-color);
  text-decoration: none;
}

a:hover {
  color: var(--bs-link-hover-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Top bar —— */
.app-header.navbar {
  min-height: var(--isp-header-h);
  border-bottom: 1px solid var(--isp-line);
  background: var(--isp-surface) !important;
  box-shadow: 0 1px 0 rgba(12, 30, 50, 0.04);
}

.nms-breadcrumb {
  font-size: 13px;
  font-weight: 500;
  color: var(--isp-muted);
}

#global-search input {
  border-color: var(--isp-line);
  background: var(--isp-tertiary-bg, #f2f5f8);
  font-size: 13px;
}

#global-search input:focus {
  border-color: var(--isp-accent);
  box-shadow: 0 0 0 3px rgba(13, 154, 184, 0.15);
}

.avatar {
  background: var(--isp-accent-soft);
  color: var(--isp-accent-hover);
  font-weight: 600;
  font-size: 13px;
}

.app-header .btn-light {
  border: 1px solid var(--isp-line);
  background: var(--isp-surface);
  font-size: 13px;
  font-weight: 500;
}

/* —— Sidebar —— */
.app-sidebar.bg-body-secondary {
  background: linear-gradient(180deg, var(--isp-navy) 0%, #0a1828 100%) !important;
  border-right: 1px solid var(--isp-sidebar-border);
}

.sidebar-brand {
  border-bottom: 1px solid var(--isp-sidebar-border);
  padding: 14px 12px;
}

.sidebar-brand .brand-link {
  color: #e8f0f7;
}

.sidebar-brand .brand-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.sidebar-brand .brand-text b {
  font-weight: 700;
  color: #fff;
}

.nms-company {
  border-bottom: 1px solid var(--isp-sidebar-border);
  padding: 14px 12px 18px;
  margin-bottom: 4px;
}

.nms-company label {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #8fa8be;
  margin-bottom: 6px;
}

#company-switch {
  background: var(--isp-navy-mid);
  border: 1px solid var(--isp-sidebar-border);
  color: #e8f0f7;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  min-height: 38px;
}

#company-switch:focus {
  border-color: var(--isp-accent);
  box-shadow: 0 0 0 2px rgba(13, 154, 184, 0.35);
}

.sidebar-menu .nav-group-toggle {
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: #7d94a8;
  margin-top: 10px;
  padding: 6px 12px;
}

.sidebar-menu .nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #a8bccf;
}

.sidebar-menu .nav-link {
  font-size: 13px;
  font-weight: 500;
  color: #c5d4e0;
  border-radius: 6px;
  margin: 1px 6px;
  padding: 8px 12px;
}

.sidebar-menu .nav-link .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a6278;
  flex-shrink: 0;
}

.sidebar-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #eef4f9;
}

.sidebar-menu .nav-link.active {
  background: rgba(13, 154, 184, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--isp-accent);
}

.sidebar-menu .nav-link.active .nav-dot {
  background: #7ecce0;
  box-shadow: none;
}

.sidebar-menu .nav-link.active:hover {
  background: rgba(13, 154, 184, 0.28);
}

/* —— Main workspace —— */
.app-content {
  background: var(--isp-canvas);
  padding: 20px 24px 32px;
}

.page-heading {
  padding: 20px 22px;
  margin: 0 0 20px;
  border: 1px solid var(--isp-line);
  border-radius: var(--isp-radius-lg);
  background: var(--isp-surface);
  box-shadow: var(--isp-shadow-sm);
  align-items: flex-end;
  gap: 20px;
}

.page-heading h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--isp-text);
  line-height: 1.25;
  max-width: 42ch;
}

.page-heading .eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--isp-accent-hover);
  margin-bottom: 4px;
}

.page-heading .subtitle {
  font-size: 14px;
  line-height: 1.55;
  max-width: 62ch;
  color: var(--isp-muted);
}

.heading-status {
  font-size: 12px;
  color: var(--isp-muted);
  padding: 8px 12px;
  border: 1px solid var(--isp-line);
  border-radius: 8px;
  background: var(--isp-surface);
}

.heading-status .live-dot {
  background: var(--isp-signal);
  box-shadow: 0 0 0 3px rgba(29, 191, 115, 0.2);
}

/* —— Panels & data —— */
.panel,
.card {
  background: var(--isp-surface);
  border: 1px solid var(--isp-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(12, 30, 50, 0.04);
}

.panel-heading h2,
.panel h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--isp-text);
}

.hint,
.muted {
  color: var(--isp-muted);
}

/* KPI / overview strips */
.kpi-grid .kpi,
.ticket-overview-card,
.ticket-overview article {
  border: 1px solid var(--isp-line);
  border-radius: 10px;
  border-top: 3px solid var(--isp-accent);
  box-shadow: none;
}

.kpi .value,
.ticket-overview strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--isp-text);
}

/* Tables — operations grid */
.table th {
  background: #f0f4f8;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--isp-muted);
  border-bottom: 1px solid var(--isp-line);
}

.table td {
  font-size: 13px;
  vertical-align: middle;
}

.records-panel {
  border-radius: 10px;
  border: 1px solid var(--isp-line);
}

.records-panel > .toolbar {
  background: #fafbfc;
  border-bottom: 1px solid var(--isp-line);
}

/* Buttons */
.btn-primary,
button.btn-primary,
.button.btn-primary,
.sidebar-menu .nav-link.active.btn-primary {
  background: var(--isp-accent);
  border-color: var(--isp-accent);
}

.btn-primary:hover,
button.btn-primary:hover {
  background: var(--isp-accent-hover);
  border-color: var(--isp-accent-hover);
}

.btn-secondary,
.button.secondary {
  border-color: var(--isp-line);
  background: var(--isp-surface);
  color: var(--isp-text);
  font-weight: 500;
}

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: var(--isp-accent);
  box-shadow: 0 0 0 3px rgba(13, 154, 184, 0.15);
}

input[type='checkbox'].form-check-input:checked,
input[type='radio'].form-check-input:checked {
  background-color: var(--isp-accent);
  border-color: var(--isp-accent);
}

/* Status semantics */
.badge.online,
.badge.text-bg-success,
.online {
  color: #0d6b42;
}

.badge.offline,
.offline {
  color: var(--isp-danger);
}

.notice {
  border-left: 3px solid var(--isp-accent);
  background: var(--isp-accent-soft);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
}

/* Login */
body.login-page.nms-auth {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 70% 10%, rgba(13, 154, 184, 0.12), transparent),
    linear-gradient(165deg, var(--isp-navy) 0%, #0a1520 55%, var(--isp-navy-mid) 100%);
}

body.login-page .auth-card {
  border: 1px solid var(--isp-line);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

body.login-page .auth-card h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

body.login-page .auth-card .eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--isp-accent);
  font-weight: 600;
}

body.login-page .auth-card button {
  width: 100%;
  min-height: 42px;
  font-weight: 600;
  background: var(--isp-accent);
  border-color: var(--isp-accent);
}

body.login-page .auth-card footer {
  border-top: 1px solid var(--isp-line);
  padding-top: 16px;
}

/* Footer */
.page-footer {
  color: var(--isp-muted);
  font-size: 12px;
  border-top: 1px solid var(--isp-line);
  margin-top: 8px;
  padding-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-menu .nav-group-chevron {
    transition: none;
  }
}

@media (max-width: 760px) {
  .app-content {
    padding: 14px 12px 24px;
  }

  .page-heading {
    padding: 16px;
  }

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

/* —— Header chrome —— */
.nms-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  font-weight: 500;
  color: var(--isp-text);
}

.nms-menu-icon {
  display: block;
  width: 16px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  opacity: 0.85;
}

.nms-breadcrumb-root {
  color: var(--isp-muted);
  font-weight: 500;
}

.nms-breadcrumb-sep {
  margin: 0 8px;
  color: #a8b4c0;
  font-weight: 400;
}

.nms-breadcrumb-page {
  color: var(--isp-text);
  font-weight: 600;
}

.nms-global-search {
  max-width: 340px;
  margin-left: auto;
}

.nms-global-search .form-control {
  font-size: 13px;
  border-right: 0;
}

.nms-global-search .btn-secondary {
  font-size: 13px;
  font-weight: 600;
  padding-left: 14px;
  padding-right: 14px;
  background: var(--isp-tertiary-bg, #f2f5f8);
  border-color: var(--isp-line);
  color: var(--isp-text);
}

.nms-global-search .btn-secondary:hover {
  background: #e6ebf1;
  border-color: #bcc6d2;
}

.nms-alerts-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
}

.nms-alerts-btn .badge {
  font-size: 10px;
  font-weight: 600;
  min-width: 1.25rem;
}

.nms-signout {
  font-size: 13px;
  font-weight: 500;
  color: var(--isp-muted);
  text-decoration: none;
  padding: 6px 10px;
}

.nms-signout:hover {
  color: var(--isp-text);
  text-decoration: none;
}

/* Kill legacy AdminLTE nav noise */
.app-sidebar .sidebar-menu .nav-group-toggle {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
}

.app-sidebar .sidebar-menu > .nav-item > .nav-link.active,
.app-sidebar .sidebar-menu .nav-link.active {
  background: rgba(11, 135, 163, 0.2) !important;
  color: #fff !important;
}

.app-sidebar .sidebar-menu .nav-link.active:hover {
  background: rgba(11, 135, 163, 0.28) !important;
}

.app-sidebar .nms-company label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  opacity: 1 !important;
}

.sidebar-wrapper {
  scrollbar-color: #3a5570 transparent;
  scrollbar-width: thin;
}

/* —— Actions & controls —— */
button,
.button,
.btn {
  border-radius: var(--isp-radius);
  font-weight: 600;
  font-size: 13px;
  min-height: 36px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

button.quiet,
.button.quiet,
.btn-link {
  font-weight: 500;
}

#add-record,
.button:not(.secondary):not(.quiet),
button[type='submit']:not(.btn-secondary):not(.btn-link) {
  box-shadow: none;
}

.form-control,
.form-select {
  border-radius: var(--isp-radius);
  border-color: var(--isp-line);
  font-size: 13px;
}

.table {
  --bs-table-border-color: var(--isp-line);
}

.table tbody tr:hover {
  background: #f7f9fb;
}

.table th {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 12px !important;
  font-weight: 600;
  padding-top: 11px;
  padding-bottom: 11px;
}

.badge {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 6px;
  padding: 4px 8px;
}

.badge.online {
  background: #e5f3ec;
  color: #0f6b41;
}

.badge.offline {
  background: #fceced;
  color: #9b2c37;
}

.badge.warning {
  background: #f8f0e3;
  color: #8a5d0a;
}

.pagination {
  background: #fafbfc;
  font-size: 12px;
}

.pagination .btn,
.pagination button {
  min-height: 32px;
  font-weight: 500;
}

.dialog,
dialog {
  border-radius: var(--isp-radius-lg);
  border-color: var(--isp-line);
  box-shadow: var(--isp-shadow-md);
}

.kpi {
  border-top: none !important;
  border-left: 4px solid var(--isp-accent);
  border-radius: var(--isp-radius-lg);
  box-shadow: var(--isp-shadow-sm);
}

.kpi:nth-child(4n + 2) {
  border-left-color: var(--isp-signal);
}

.kpi:nth-child(4n + 3) {
  border-left-color: var(--isp-warn);
}

.kpi:nth-child(4n + 4) {
  border-left-color: #3d7ea6;
}

.kpi-grid .kpi,
.ticket-overview-card,
.ticket-overview article {
  border-top: 1px solid var(--isp-line) !important;
  border-left: 4px solid var(--isp-accent);
}

/* Users & admin lists — align with portal accent */
.users-kpi-strip article,
.user-card,
.user-role-card {
  border-radius: var(--isp-radius-lg);
  border-color: var(--isp-line);
  box-shadow: var(--isp-shadow-sm);
}

.user-card:hover {
  border-color: #9dc4d0;
  box-shadow: var(--isp-shadow-md);
}

.user-card-main a:hover h3 {
  color: var(--isp-accent-hover);
}

.user-pill.role {
  background: var(--isp-accent-soft);
  color: var(--isp-accent-hover);
}

.users-breadcrumb a {
  color: var(--isp-accent-hover);
}

/* Login — executive sign-in */
body.login-page.nms-auth {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

body.login-page .auth-card {
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  border-top: 4px solid var(--isp-accent);
}

body.login-page .shree-login-brand span {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--isp-text);
}

body.login-page .auth-card p {
  font-size: 14px;
  line-height: 1.55;
}

.app-footer.page-footer {
  margin-top: 24px;
  padding: 14px 24px;
  background: var(--isp-surface);
  border-top: 1px solid var(--isp-line);
  font-weight: 500;
}

.app-footer.page-footer span {
  font-weight: 400;
  color: var(--isp-muted);
}

*:focus-visible {
  outline: 2px solid rgba(11, 135, 163, 0.55);
  outline-offset: 2px;
}

input[type='checkbox'].form-check-input:focus,
input[type='radio'].form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(11, 135, 163, 0.2) !important;
  border-color: var(--isp-accent) !important;
}

.company-reset-scopes {
  display: grid;
  gap: 10px;
  margin: 14px 0 16px;
}

.company-reset-scope {
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--isp-line);
  border-radius: var(--isp-radius);
  background: #fafbfc;
}

.company-reset-scope-text {
  display: grid;
  gap: 4px;
}

.company-reset-scope-text strong {
  font-size: 14px;
  font-weight: 600;
}

.company-reset-scope-text .hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .nms-menu-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .nms-global-search {
    max-width: none;
    flex: 1;
  }

  .nms-alerts-btn span:not(.badge) {
    display: none;
  }
}