/* ==========================================================================
   Dragon Control Center (DragonCC) — Design System
   Visual target: dragoncc_dragon_control_center.html
   Presentation layer ONLY — no logic, services, or data are touched.
   RTL-first. Cairo for UI, JetBrains Mono for identifiers/keys.
   Light theme default; html[data-theme="dark"] switches tokens.
   Prefix: cc-
   ========================================================================== */

/* ── 1. Fonts ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── 2. Tokens — Light (default) ──────────────────────────────────────────── */
:root {
  --cc-charcoal: #0A0F1D;
  --cc-navy: #0F172A;
  --cc-card: #1E293B;
  --cc-surface: #182234;
  --cc-indigo: #6366F1;
  --cc-indigo-hover: #4F46E5;
  --cc-indigo-soft: rgba(99, 102, 241, 0.10);
  --cc-indigo-glow: 0 0 18px -3px rgba(99, 102, 241, 0.35);
  --cc-teal: #0F5F61;

  --cc-active: #10B981;
  --cc-active-bg: rgba(16, 185, 129, 0.12);
  --cc-trial: #3B82F6;
  --cc-trial-bg: rgba(59, 130, 246, 0.12);
  --cc-suspended: #F59E0B;
  --cc-suspended-bg: rgba(245, 158, 11, 0.12);
  --cc-expired: #EF4444;
  --cc-expired-bg: rgba(239, 68, 68, 0.12);
  --cc-info: #0EA5E9;
  --cc-info-bg: rgba(14, 165, 233, 0.12);

  --cc-bg-page: #F8FAFC;
  --cc-bg-surface: #FFFFFF;
  --cc-bg-subtle: #F1F5F9;
  --cc-bg-input: #F1F5F9;
  --cc-border: #E2E8F0;
  --cc-border-soft: #F1F5F9;
  --cc-border-strong: #CBD5E1;

  --cc-text-primary: #0F172A;
  --cc-text-secondary: #475569;
  --cc-text-muted: #64748B;
  --cc-text-faint: #94A3B8;
  --cc-text-on-accent: #FFFFFF;

  /* Bootstrap 5 semantic tokens → CC tokens (light) so cards/modals/disabled
     inputs and utility classes follow the theme instead of fixed BS colors. */
  --bs-body-color: var(--cc-text-primary);
  --bs-body-bg: var(--cc-bg-page);
  --bs-secondary-color: var(--cc-text-muted);
  --bs-secondary-bg: var(--cc-bg-subtle);
  --bs-tertiary-color: var(--cc-text-faint);
  --bs-tertiary-bg: var(--cc-bg-subtle);
  --bs-emphasis-color: var(--cc-text-primary);
  --bs-card-color: var(--cc-text-primary);
  --bs-card-bg: var(--cc-bg-surface);
  --bs-card-cap-bg: var(--cc-bg-surface);
  --bs-modal-color: var(--cc-text-primary);
  --bs-modal-bg: var(--cc-bg-surface);

  --cc-shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --cc-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --cc-shadow-modal: 0 25px 50px -12px rgba(2, 6, 23, 0.4);

  --cc-radius-sm: 8px;
  --cc-radius-md: 12px;
  --cc-radius-lg: 16px;
  --cc-radius-pill: 999px;

  --cc-sidebar-w: 264px;
  --cc-topbar-h: 64px;
  --cc-font-sans: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --cc-font-mono: 'JetBrains Mono', Consolas, monospace;
}

html[data-theme="dark"] {
  --cc-bg-page: #0A0F1D;
  --cc-bg-surface: #0F172A;
  --cc-bg-subtle: #182234;
  --cc-bg-input: #182234;
  --cc-border: #334155;
  --cc-border-soft: #1E293B;
  --cc-border-strong: #475569;
  --cc-text-primary: #F8FAFC;
  --cc-text-secondary: #CBD5E1;
  --cc-text-muted: #94A3B8;
  --cc-text-faint: #64748B;
  --cc-indigo-soft: rgba(99, 102, 241, 0.16);
  --cc-shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --cc-shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --cc-shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.7);

  /* Bootstrap 5 semantic tokens → CC dark tokens. This is what keeps cards,
     modals, .text-muted/.text-secondary, disabled inputs and table headers
     readable on dark surfaces instead of Bootstrap's fixed light-theme colors. */
  --bs-body-color: var(--cc-text-primary);
  --bs-body-bg: var(--cc-bg-page);
  --bs-secondary-color: var(--cc-text-muted);
  --bs-secondary-bg: var(--cc-bg-input);
  --bs-tertiary-color: var(--cc-text-faint);
  --bs-tertiary-bg: var(--cc-bg-subtle);
  --bs-emphasis-color: #FFFFFF;
  --bs-card-color: var(--cc-text-primary);
  --bs-card-bg: var(--cc-bg-surface);
  --bs-card-cap-bg: var(--cc-bg-surface);
  --bs-modal-color: var(--cc-text-primary);
  --bs-modal-bg: var(--cc-bg-surface);
}

/* ── 3. Base ──────────────────────────────────────────────────────────────── */
html, body { height: 100%; }
body {
  font-family: var(--cc-font-sans);
  background: var(--cc-bg-page);
  color: var(--cc-text-primary);
  -webkit-font-smoothing: antialiased;
  font-size: 0.875rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cc-num { font-family: var(--cc-font-mono); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--cc-navy); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── 4. Shell ─────────────────────────────────────────────────────────────── */
.cc-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── 5. Sidebar ───────────────────────────────────────────────────────────── */
.cc-sidebar {
  width: var(--cc-sidebar-w); min-width: var(--cc-sidebar-w);
  background: var(--cc-bg-surface);
  border-inline-end: 1px solid var(--cc-border);
  display: flex; flex-direction: column; flex-shrink: 0; z-index: 30;
  transition: transform 0.3s ease;
}
.cc-brand {
  height: var(--cc-topbar-h); padding: 0 1rem;
  border-bottom: 1px solid var(--cc-border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.cc-brand__group { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.cc-brand__logo {
  width: 36px; height: 36px; border-radius: var(--cc-radius-md);
  background: linear-gradient(135deg, var(--cc-indigo), #4F46E5, #3730A3);
  box-shadow: var(--cc-indigo-glow); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.cc-brand__logo img, .cc-brand__logo svg { width: 22px; height: 22px; }
.cc-brand__name { font-weight: 900; font-size: 0.9rem; color: var(--cc-text-primary); white-space: nowrap; }
.cc-brand__name b { color: var(--cc-indigo); }
.cc-brand__ver {
  font-family: var(--cc-font-mono); font-size: 0.55rem; font-weight: 700;
  color: var(--cc-indigo); background: var(--cc-indigo-soft);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.1rem 0.4rem; border-radius: 0.35rem; white-space: nowrap;
}
.cc-brand__url { font-family: var(--cc-font-mono); font-size: 0.6rem; color: var(--cc-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.1rem; }
.cc-brand__collapse {
  width: 28px; height: 28px; border: none; background: transparent;
  color: var(--cc-text-faint); border-radius: var(--cc-radius-sm);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.cc-brand__collapse:hover { color: var(--cc-text-primary); background: var(--cc-bg-subtle); }

.cc-cluster {
  margin: 0.75rem 0.75rem 0; padding: 0.6rem 0.75rem;
  border-radius: var(--cc-radius-md);
  background: var(--cc-bg-subtle);
  border: 1px solid var(--cc-border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.cc-cluster__label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; font-weight: 700; color: var(--cc-text-secondary); }
.cc-cluster__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cc-active); animation: ccPulse 1.8s infinite; }
.cc-cluster__code { font-family: var(--cc-font-mono); font-weight: 700; font-size: 0.55rem; color: var(--cc-text-faint); white-space: nowrap; }
@keyframes ccPulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); } 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.cc-nav { flex: 1; overflow-y: auto; padding: 0.75rem; }
.cc-nav-label {
  font-size: 0.62rem; font-weight: 800; color: var(--cc-text-faint);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.7rem 0.75rem 0.35rem;
}
.cc-nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; margin-bottom: 0.1rem; border-radius: var(--cc-radius-md);
  font-size: 0.78rem; font-weight: 600; color: var(--cc-text-secondary); text-decoration: none;
  transition: background 0.14s, color 0.14s; cursor: pointer;
}
.cc-nav-item i { width: 1rem; text-align: center; font-size: 0.82rem; color: var(--cc-text-faint); flex-shrink: 0; }
.cc-nav-item span { flex: 1; }
.cc-nav-item:hover { background: var(--cc-bg-subtle); color: var(--cc-text-primary); text-decoration: none; }
.cc-nav-item:hover i { color: var(--cc-indigo); }
.cc-nav-item.active, .cc-nav-item--active {
  background: var(--cc-indigo); color: #fff; box-shadow: var(--cc-shadow-subtle); font-weight: 700;
}
.cc-nav-item.active i, .cc-nav-item--active i { color: #fff; }

.cc-sidebar-foot {
  padding: 0.75rem; border-top: 1px solid var(--cc-border-soft);
  background: var(--cc-bg-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.cc-userchip { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.cc-userchip__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cc-indigo-soft); color: var(--cc-indigo);
  border: 1px solid rgba(99, 102, 241, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.68rem; font-family: var(--cc-font-mono); flex-shrink: 0;
}
.cc-userchip__name { font-weight: 700; font-size: 0.74rem; color: var(--cc-text-primary); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-userchip__role { font-family: var(--cc-font-mono); font-size: 0.6rem; color: var(--cc-text-faint); }

/* ── 6. Main column & topbar ──────────────────────────────────────────────── */
.cc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.cc-topbar {
  height: var(--cc-topbar-h); flex-shrink: 0;
  background: var(--cc-bg-surface); border-bottom: 1px solid var(--cc-border-soft);
  padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; z-index: 20;
}
.cc-topbar__right { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.cc-topbar__left { display: flex; align-items: center; gap: 0.6rem; }
.cc-burger {
  display: none; width: 36px; height: 36px; border: 1px solid var(--cc-border);
  background: var(--cc-bg-surface); color: var(--cc-text-secondary);
  border-radius: var(--cc-radius-md); align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.cc-search { position: relative; width: 100%; max-width: 420px; }
.cc-search i { position: absolute; inset-inline-start: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--cc-text-faint); font-size: 0.78rem; pointer-events: none; }
.cc-search__fake {
  display: flex; align-items: center; width: 100%; height: 38px;
  padding-inline: 2.2rem 3.2rem;
  background: var(--cc-bg-input); border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-md); color: var(--cc-text-muted); text-decoration: none;
  font-size: 0.74rem; transition: border 0.15s, box-shadow 0.15s, color 0.15s;
}
.cc-search__fake:hover { border-color: var(--cc-indigo); color: var(--cc-text-primary); text-decoration: none; box-shadow: 0 0 0 2px var(--cc-indigo-soft); }
.cc-search kbd {
  position: absolute; inset-inline-end: 0.7rem; top: 50%; transform: translateY(-50%);
  font-family: var(--cc-font-mono); font-size: 0.6rem; color: var(--cc-text-faint);
  background: var(--cc-bg-surface); border: 1px solid var(--cc-border);
  padding: 0.15rem 0.45rem; border-radius: 0.35rem;
}
.cc-theme-switch {
  display: flex; align-items: center; gap: 0.1rem;
  background: var(--cc-bg-input); border: 1px solid var(--cc-border);
  padding: 0.2rem; border-radius: var(--cc-radius-md);
}
.cc-theme-switch button {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.6rem; border-radius: var(--cc-radius-sm); border: none; background: transparent; cursor: pointer;
  color: var(--cc-text-muted); font-weight: 700; font-size: 0.68rem; transition: background 0.15s, color 0.15s;
}
.cc-theme-switch button:hover { color: var(--cc-text-primary); }
html:not([data-theme="dark"]) .cc-theme-switch button[data-theme-btn="light"],
html[data-theme="dark"] .cc-theme-switch button[data-theme-btn="dark"] { background: var(--cc-bg-surface); color: var(--cc-indigo); box-shadow: var(--cc-shadow-subtle); }
html[data-theme="dark"] .cc-theme-switch button[data-theme-btn="dark"] { background: var(--cc-bg-subtle); color: #fff; }
.cc-topbar__divider { width: 1px; height: 24px; background: var(--cc-border); }
.cc-icon-btn {
  position: relative; width: 36px; height: 36px;
  border: 1px solid var(--cc-border); background: var(--cc-bg-surface);
  color: var(--cc-text-secondary); border-radius: var(--cc-radius-md);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border 0.15s, color 0.15s; text-decoration: none; font-size: 0.82rem;
}
.cc-icon-btn:hover { border-color: var(--cc-indigo); color: var(--cc-indigo); text-decoration: none; }
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 36px; padding: 0 0.9rem; border-radius: var(--cc-radius-md);
  font-weight: 700; font-size: 0.75rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s; white-space: nowrap;
}
.cc-btn--primary { background: var(--cc-indigo); color: #fff; box-shadow: var(--cc-indigo-glow); }
.cc-btn--primary:hover { background: var(--cc-indigo-hover); color: #fff; text-decoration: none; }
.cc-btn--outline { background: var(--cc-bg-surface); color: var(--cc-text-secondary); border-color: var(--cc-border); }
.cc-btn--outline:hover { border-color: var(--cc-indigo); color: var(--cc-indigo); text-decoration: none; }
.cc-btn--subtle { background: var(--cc-bg-input); color: var(--cc-text-secondary); border-color: var(--cc-border); }
.cc-btn--subtle:hover { background: var(--cc-indigo); color: #fff; text-decoration: none; }
.cc-btn--sm { height: 30px; padding: 0 0.7rem; font-size: 0.7rem; border-radius: var(--cc-radius-sm); }
.cc-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── 7. Page & panels ─────────────────────────────────────────────────────── */
.cc-page { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; overflow-y: auto; }
.cc-page-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cc-page-title h1 { font-size: 1.15rem; font-weight: 800; color: var(--cc-text-primary); margin: 0; }
.cc-panel { background: var(--cc-bg-surface); border: 1px solid var(--cc-border); border-radius: var(--cc-radius-lg); box-shadow: var(--cc-shadow-subtle); padding: 1.25rem; }
.cc-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding-bottom: 0.75rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--cc-border-soft);
}
.cc-panel__title { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 0.85rem; color: var(--cc-text-primary); margin: 0; }
.cc-panel__title i { color: var(--cc-indigo); font-size: 0.9rem; }
.cc-panel__icon {
  width: 32px; height: 32px; border-radius: var(--cc-radius-md);
  background: var(--cc-indigo-soft); color: var(--cc-indigo);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cc-panel__icon--green { background: var(--cc-active-bg); color: var(--cc-active); }
.cc-panel__icon--amber { background: var(--cc-suspended-bg); color: var(--cc-suspended); }
.cc-panel__icon--rose { background: var(--cc-expired-bg); color: var(--cc-expired); }
.cc-panel__icon--blue { background: var(--cc-trial-bg); color: var(--cc-trial); }
.cc-panel__subtitle { font-size: 0.72rem; color: var(--cc-text-muted); margin-top: 0.15rem; }

/* ── 8. KPI cards ─────────────────────────────────────────────────────────── */
.cc-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.9rem; }
.cc-kpi {
  background: var(--cc-bg-surface); border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-lg); box-shadow: var(--cc-shadow-subtle);
  padding: 0.9rem; display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem;
  transition: border 0.15s, box-shadow 0.15s; text-decoration: none;
}
.cc-kpi:hover { box-shadow: var(--cc-shadow-card); text-decoration: none; }
.cc-kpi--indigo:hover { border-color: rgba(99, 102, 241, 0.5); }
.cc-kpi--blue:hover { border-color: rgba(59, 130, 246, 0.5); }
.cc-kpi--green:hover { border-color: rgba(16, 185, 129, 0.5); }
.cc-kpi--amber:hover { border-color: rgba(245, 158, 11, 0.5); }
.cc-kpi--rose:hover { border-color: rgba(239, 68, 68, 0.5); }
.cc-kpi__head { display: flex; align-items: center; justify-content: space-between; }
.cc-kpi__label { font-size: 0.64rem; font-weight: 700; color: var(--cc-text-secondary); }
.cc-kpi__icon {
  width: 28px; height: 28px; border-radius: var(--cc-radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.cc-kpi__icon--indigo { background: var(--cc-indigo-soft); color: var(--cc-indigo); }
.cc-kpi__icon--blue { background: var(--cc-trial-bg); color: var(--cc-trial); }
.cc-kpi__icon--green { background: var(--cc-active-bg); color: var(--cc-active); }
.cc-kpi__icon--amber { background: var(--cc-suspended-bg); color: var(--cc-suspended); }
.cc-kpi__icon--rose { background: var(--cc-expired-bg); color: var(--cc-expired); }
.cc-kpi__num { font-family: var(--cc-font-mono); font-size: 1.35rem; font-weight: 800; color: var(--cc-text-primary); line-height: 1.1; }
.cc-kpi__num--green { color: var(--cc-active); }
.cc-kpi__num--amber { color: var(--cc-suspended); }
.cc-kpi__num--rose { color: var(--cc-expired); }
.cc-kpi__note { font-family: var(--cc-font-mono); font-size: 0.64rem; color: var(--cc-text-muted); margin-top: 0.1rem; }

/* ── 9. Tables ────────────────────────────────────────────────────────────── */
.cc-table-wrap { overflow-x: auto; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.cc-table thead th {
  background: var(--cc-bg-subtle); border-bottom: 1px solid var(--cc-border);
  color: var(--cc-text-muted); font-weight: 700; font-size: 0.64rem;
  padding: 0.65rem 0.75rem; white-space: nowrap;
}
.cc-table tbody td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--cc-border-soft); color: var(--cc-text-secondary); vertical-align: middle; }
.cc-table tbody tr:last-child td { border-bottom: none; }
.cc-table tbody tr:hover td { background: var(--cc-bg-subtle); }
.cc-table .cc-cell-strong { color: var(--cc-text-primary); font-weight: 700; }
.cc-table .cc-cell-muted { color: var(--cc-text-muted); }

/* ── 10. Badges / status ──────────────────────────────────────────────────── */
.cc-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--cc-font-mono); font-weight: 700; font-size: 0.62rem;
  padding: 0.2rem 0.55rem; border-radius: var(--cc-radius-pill); white-space: nowrap;
}
.cc-badge--active { background: var(--cc-active-bg); color: var(--cc-active); border: 1px solid rgba(16, 185, 129, 0.35); }
.cc-badge--trial { background: var(--cc-trial-bg); color: var(--cc-trial); border: 1px solid rgba(59, 130, 246, 0.35); }
.cc-badge--suspended { background: var(--cc-suspended-bg); color: var(--cc-suspended); border: 1px solid rgba(245, 158, 11, 0.35); }
.cc-badge--expired { background: var(--cc-expired-bg); color: var(--cc-expired); border: 1px solid rgba(239, 68, 68, 0.35); }
.cc-badge--info { background: var(--cc-info-bg); color: var(--cc-info); border: 1px solid rgba(14, 165, 233, 0.35); }
.cc-badge--gray { background: var(--cc-bg-subtle); color: var(--cc-text-secondary); border: 1px solid var(--cc-border); }
.cc-badge--indigo { background: var(--cc-indigo-soft); color: var(--cc-indigo); border: 1px solid rgba(99, 102, 241, 0.35); }

/* ── 11. Actionable alert / urgent list ───────────────────────────────────── */
.cc-alert {
  border-radius: var(--cc-radius-md);
  border: 1px solid var(--cc-border); background: var(--cc-bg-surface);
  padding: 0.85rem 1rem; display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.76rem;
}
.cc-alert--widgets { border-color: var(--cc-border-strong); }
.cc-alert__line { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--cc-border); font-size: 0.74rem; }
.cc-alert__line:last-child { border-bottom: none; }
.cc-alert__line a { color: var(--cc-text-primary); font-weight: 700; text-decoration: none; }
.cc-alert__line a:hover { color: var(--cc-indigo); text-decoration: none; }
.cc-alert__meta { font-family: var(--cc-font-mono); font-size: 0.64rem; color: var(--cc-text-muted); }

/* ── 12. CSS bar chart (real data, last 6 months) ─────────────────────────── */
.cc-chart { position: relative; width: 100%; height: 220px; display: flex; align-items: flex-end; gap: 0.8rem; padding: 0.5rem 0 1.6rem; }
.cc-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.45rem; height: 100%; min-width: 0; }
.cc-chart__value { font-family: var(--cc-font-mono); font-size: 0.6rem; font-weight: 700; color: var(--cc-text-muted); white-space: nowrap; }
.cc-chart__bar { width: 100%; max-width: 40px; background: linear-gradient(180deg, var(--cc-indigo), #4F46E5); border-radius: 6px 6px 0 0; min-height: 4px; transition: height 0.4s ease; }
.cc-chart__month { font-family: var(--cc-font-mono); font-size: 0.6rem; font-weight: 700; color: var(--cc-text-faint); }

/* ── 13. License detail — hero + timeline ─────────────────────────────────── */
.cc-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; background: var(--cc-bg-surface);
  border: 1px solid var(--cc-border); border-radius: var(--cc-radius-lg);
  box-shadow: var(--cc-shadow-subtle); padding: 1.1rem 1.25rem;
}
.cc-hero__title { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.cc-timeline { list-style: none; margin: 0; padding: 0; }
.cc-timeline li {
  position: relative; padding: 0 1.5rem 1.1rem 0;
  border-inline-start: 2px solid var(--cc-border);
  margin-inline-start: 0.4rem;
}
.cc-timeline li:last-child { border-inline-start-color: transparent; padding-bottom: 0; }
.cc-timeline li::before {
  content: ""; position: absolute; inset-inline-start: -0.44rem; top: 0.15rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--cc-indigo);
  border: 2px solid var(--cc-bg-surface);
}
.cc-timeline li.cc-timeline--state::before { background: var(--cc-active); }
.cc-timeline__meta { font-family: var(--cc-font-mono); font-size: 0.6rem; color: var(--cc-text-faint); }
.cc-timeline__body { font-size: 0.74rem; color: var(--cc-text-secondary); margin-top: 0.15rem; }

.cc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cc-kv__cell { background: var(--cc-bg-subtle); border: 1px solid var(--cc-border); border-radius: var(--cc-radius-sm); padding: 0.55rem 0.7rem; }
.cc-kv__cell span { display: block; font-size: 0.6rem; color: var(--cc-text-muted); }
.cc-kv__cell b { font-size: 0.74rem; font-weight: 700; color: var(--cc-text-primary); word-break: break-all; }

/* ── 14. Bootstrap harmony (surface only) ─────────────────────────────────── */
.card { border-radius: var(--cc-radius-lg); border: 1px solid var(--cc-border); background: var(--cc-bg-surface); box-shadow: var(--cc-shadow-subtle); }
.card-header { background: transparent; border-bottom: 1px solid var(--cc-border-soft); font-weight: 700; color: var(--cc-text-secondary); }
.card-body { color: var(--cc-text-secondary); }
.btn { border-radius: var(--cc-radius-md); font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--cc-indigo); --bs-btn-border-color: var(--cc-indigo); --bs-btn-hover-bg: var(--cc-indigo-hover); --bs-btn-hover-border-color: var(--cc-indigo-hover); }
.btn-outline-secondary { color: var(--cc-text-secondary); border-color: var(--cc-border-strong); }
.btn-outline-secondary:hover { background: var(--cc-bg-subtle); color: var(--cc-text-primary); }
.table { color: var(--cc-text-secondary); }
.table > thead { color: var(--cc-text-muted); font-size: 0.74rem; }
.table-hover > tbody > tr:hover > * { background: var(--cc-bg-subtle); }
.badge { font-weight: 700; border-radius: var(--cc-radius-pill); }
.form-control, .form-select { border-radius: var(--cc-radius-md); border-color: var(--cc-border); color: var(--cc-text-primary); background-color: var(--cc-bg-surface); }
.form-control:focus, .form-select:focus { border-color: var(--cc-indigo); box-shadow: 0 0 0 0.2rem var(--cc-indigo-soft); }
.modal-content { border-radius: var(--cc-radius-lg); border: 1px solid var(--cc-border); background: var(--cc-bg-surface); color: var(--cc-text-secondary); }
.alert { border-radius: var(--cc-radius-md); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: var(--cc-suspended); }
.progress { background: var(--cc-border-soft); border-radius: var(--cc-radius-pill); }
.progress-bar { background: var(--cc-indigo); border-radius: var(--cc-radius-pill); }
.list-group-item { background: var(--cc-bg-surface); border-color: var(--cc-border-soft); color: var(--cc-text-secondary); }

/* ── 14b. Dark-mode contrast fixes (cards, section headers, disabled inputs) ── */
.card { color: var(--cc-text-primary); }
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[disabled],
html[data-theme="dark"] .form-control:read-only,
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-select:disabled {
  background-color: var(--cc-bg-input);
  border-color: var(--cc-border);
  color: var(--cc-text-secondary);
  opacity: 1;
}
html[data-theme="dark"] .bg-white { background-color: var(--cc-bg-surface) !important; }
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-light th { background-color: var(--cc-bg-input); color: var(--cc-text-secondary); }
html[data-theme="dark"] h6.text-muted { color: var(--cc-text-secondary); }
html[data-theme="dark"] .text-muted { color: var(--cc-text-muted) !important; }
html[data-theme="light"] .text-muted { color: var(--cc-text-muted) !important; }

/* ── 15. Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1200px) { .cc-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 992px) {
  .cc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cc-sidebar { position: fixed; inset-block-start: 0; inset-inline-start: 0; height: 100vh; transform: translateX(-105%); }
  [dir="rtl"] .cc-sidebar { transform: translateX(105%); }
  body.cc-sidebar-open .cc-sidebar { transform: translateX(0); box-shadow: var(--cc-shadow-modal); }
  .cc-burger { display: flex; }
  .cc-kv { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cc-kpi-grid { grid-template-columns: 1fr; }
  .cc-page { padding: 1rem; }
  .cc-search { max-width: none; }
  .cc-btn--add-label { display: none; }
}