:root {
  --mil-navy-950: #0f172a;
  --mil-navy-900: #1b2a4c;
  --mil-navy-800: #23365e;
  --mil-slate-900: #0f172a;
  --mil-slate-800: #1e293b;
  --mil-slate-700: #334155;
  --mil-slate-600: #475569;
  --mil-slate-400: #94a3b8;
  --mil-slate-300: #cbd5e1;
  --mil-slate-200: #e2e8f0;
  --mil-slate-100: #f1f5f9;
  --mil-white: #ffffff;
  --mil-product-accent: #2b8cc4;
  --mil-product-accent-strong: #2475a4;
  --mil-product-accent-soft: rgba(43, 140, 196, 0.14);
  --mil-success: #16a34a;
  --mil-warning: #d97706;
  --mil-danger: #dc2626;
  --mil-shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.18);
  --mil-shadow-md: 0 8px 20px rgba(15, 23, 42, 0.12);
  --mil-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--mil-slate-800);
  background: linear-gradient(145deg, #f8fbff 0%, #f3f7fc 55%, #eef4fa 100%);
}

a {
  color: var(--mil-product-accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.ci-auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.ci-auth-card {
  width: min(540px, 100%);
  background: var(--mil-white);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 20px;
  box-shadow: var(--mil-shadow-lg);
  padding: 32px;
}

.ci-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.ci-brand-row img {
  width: 40px;
  height: 40px;
}

.ci-brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mil-navy-900);
  margin: 0;
}

.ci-brand-subtitle {
  margin: 2px 0 0;
  color: var(--mil-slate-600);
  font-size: 0.92rem;
}

.ci-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 120ms ease;
}

.ci-btn-primary {
  color: var(--mil-white);
  background: linear-gradient(135deg, var(--mil-product-accent) 0%, var(--mil-product-accent-strong) 100%);
  box-shadow: var(--mil-shadow-sm);
}

.ci-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--mil-shadow-md);
}

.ci-btn-secondary {
  border-color: rgba(148, 163, 184, 0.5);
  background: var(--mil-white);
  color: var(--mil-slate-700);
}

.ci-btn-secondary:hover {
  background: var(--mil-slate-100);
}

.ci-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.ci-sidebar {
  background: linear-gradient(180deg, var(--mil-navy-950) 0%, #13213d 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  color: #dbe7f6;
  padding: 20px 16px;
}

.ci-sidebar .ci-brand-row {
  margin-bottom: 18px;
}

.ci-sidebar .ci-brand-title {
  color: #f8fafc;
  font-size: 1rem;
}

.ci-sidebar .ci-brand-subtitle {
  color: #a4b7cf;
  white-space: nowrap;
  font-size: 0.84rem;
}

.ci-nav-group {
  margin-bottom: 16px;
}

.ci-nav-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #91a5c2;
  margin-bottom: 8px;
}

.ci-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d4e2f4;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: all 100ms ease;
}

.ci-nav-link:hover {
  background: rgba(43, 140, 196, 0.2);
  text-decoration: none;
}

.ci-nav-link.is-active {
  background: rgba(43, 140, 196, 0.32);
  color: var(--mil-white);
}

.ci-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ci-topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}

.ci-top-meta {
  font-size: 0.86rem;
  color: var(--mil-slate-600);
}

.ci-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mil-slate-600);
  font-size: 0.84rem;
}

.ci-content {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.ci-section-title {
  margin: 0;
  font-size: 1.8rem;
  color: var(--mil-slate-900);
}

.ci-muted {
  margin: 6px 0 0;
  color: var(--mil-slate-600);
}

.ci-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ci-kpi-card,
.ci-card,
.ci-panel {
  background: var(--mil-white);
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 14px;
  box-shadow: var(--mil-shadow-sm);
}

.ci-kpi-card {
  padding: 14px;
}

.ci-kpi-label {
  color: var(--mil-slate-600);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ci-kpi-value {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mil-slate-900);
}

.ci-kpi-footnote {
  margin-top: 4px;
  color: var(--mil-slate-600);
  font-size: 0.82rem;
}

.ci-card {
  padding: 16px;
}

.ci-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.ci-card-title {
  margin: 0;
  font-size: 1.04rem;
}

.ci-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ci-chip {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--mil-slate-700);
  background: var(--mil-white);
}

.ci-chip.is-active {
  border-color: rgba(43, 140, 196, 0.6);
  color: var(--mil-product-accent-strong);
  background: var(--mil-product-accent-soft);
}

.ci-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.8);
}

.ci-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--mil-white);
  min-width: 1600px;
}

.ci-table th,
.ci-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 0.88rem;
}

.ci-table th {
  background: var(--mil-slate-100);
  color: var(--mil-slate-700);
  font-weight: 700;
}

.ci-table tr:hover td {
  background: rgba(43, 140, 196, 0.045);
}

.ci-table .ci-table-detail td {
  background: #f8fafc;
  padding-top: 6px;
  padding-bottom: 8px;
}

.ci-table .ci-table-detail details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--mil-slate-600);
}

.ci-license-table th,
.ci-license-table td {
  white-space: nowrap;
}

.ci-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ci-status.ok {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.16);
}

.ci-status.warn {
  color: #92400e;
  background: rgba(245, 158, 11, 0.2);
}

.ci-status.bad {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.16);
}

.ci-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ci-field {
  display: grid;
  gap: 6px;
}

.ci-field label {
  font-size: 0.8rem;
  color: var(--mil-slate-600);
}

.ci-field input,
.ci-field select {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.9rem;
  background: var(--mil-white);
}

.ci-field input:focus,
.ci-field select:focus {
  outline: 2px solid rgba(43, 140, 196, 0.25);
  border-color: var(--mil-product-accent);
}

#provider-connect-form {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  align-items: start;
}

#provider-connect-form .ci-field {
  align-content: start;
}

#provider-connect-form .ci-field input,
#provider-connect-form .ci-field select {
  min-height: 40px;
}

#provider-details-anchor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px;
  align-items: start;
}

#provider-details-anchor > label {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--mil-slate-600);
}

.ci-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ci-empty {
  border: 1px dashed rgba(148, 163, 184, 0.55);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--mil-slate-600);
  background: rgba(255, 255, 255, 0.8);
}

.ci-panel {
  padding: 14px;
}

.ci-panel details > summary {
  cursor: pointer;
  font-weight: 700;
}

.ci-panel details[open] {
  background: rgba(43, 140, 196, 0.04);
}

.ci-license-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  gap: 12px;
  align-items: start;
}

.ci-client-browser {
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(43, 140, 196, 0.08), transparent 52%),
    var(--mil-white);
}

.ci-client-browser .ci-card-header {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.ci-client-browser-body {
  display: grid;
  gap: 6px;
}

.ci-client-group {
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ci-client-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mil-slate-700);
  padding: 9px 11px;
  background: #f8fafc;
  transition: background-color 120ms ease;
}

.ci-client-group > summary::-webkit-details-marker {
  display: none;
}

.ci-client-group > summary::after {
  content: ">";
  font-size: 0.75rem;
  color: var(--mil-slate-500);
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.ci-client-group[open] > summary::after {
  transform: rotate(90deg);
}

.ci-client-group > summary:hover {
  background: #f1f5f9;
}

.ci-group-label {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ci-group-count,
.ci-client-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(43, 140, 196, 0.24);
  color: var(--mil-product-accent-strong);
  background: rgba(43, 140, 196, 0.1);
  font-size: 0.75rem;
  font-weight: 700;
}

.ci-client-group[open] > summary {
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.ci-client-group-items {
  display: grid;
  gap: 2px;
  padding: 5px;
}

.ci-client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--mil-slate-700);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  transition: all 120ms ease;
}

.ci-client-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ci-client-row:hover {
  text-decoration: none;
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.2);
  color: #0f766e;
}

.ci-client-row.is-active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.13), rgba(15, 118, 110, 0.07));
  border-color: rgba(15, 118, 110, 0.32);
  color: #0f766e;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.06);
}

@media (max-width: 1100px) {
  .ci-layout {
    grid-template-columns: 1fr;
  }

  .ci-sidebar {
    padding-bottom: 8px;
  }

  .ci-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ci-license-layout {
    grid-template-columns: 1fr;
  }

  .ci-client-browser {
    position: static;
    max-height: 360px;
  }
}

@media (max-width: 720px) {
  .ci-content {
    padding: 14px;
  }

  .ci-kpi-grid {
    grid-template-columns: 1fr;
  }

  .ci-form-grid {
    grid-template-columns: 1fr;
  }

  #provider-connect-form,
  #provider-details-anchor {
    grid-template-columns: 1fr;
  }

  .ci-topbar {
    height: auto;
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
