/* FireGrid — design tokens + base
   TeleOne palette (#244183 primary, Arimo, blue borders) with denser, smaller component sizing. */

@import url('https://fonts.googleapis.com/css2?family=Arimo:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

.fg-tip { position: relative; }
.fg-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  background: var(--ink);
  color: white;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms, transform 140ms;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.35);
  z-index: 50;
}
.fg-tip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  border: 4px solid transparent;
  border-bottom-color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms, transform 140ms;
  z-index: 50;
}
.fg-tip:hover::after, .fg-tip:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }

:root {
  /* surfaces */
  --bg:        #ffffff;
  --bg-2:      rgba(36, 65, 131, 0.03);
  --surface:   #ffffff;
  --surface-2: #fafbfc;
  --overlay:   rgba(21, 38, 77, 0.55);

  /* text — TeleOne: text is brand blue */
  --ink:       #244183;
  --ink-2:     #244183;
  --muted:     #50679c;
  --faint:     #8696b8;
  --disabled:  #b5b5b9;

  /* lines — TeleOne: borders are brand blue */
  --line:      #244183;
  --line-2:    #244183;
  --line-strong: #244183;

  /* accent — TeleOne primary blue */
  --accent:        #244183;
  --accent-ink:    #15264d;
  --accent-light:  #4072e2;
  --accent-soft:   rgba(36, 65, 131, 0.08);
  --accent-line:   rgba(36, 65, 131, 0.22);

  /* status — TeleOne palette */
  --ok:        #52c41a;
  --ok-soft:   #f6ffed;
  --warn:      #faad14;
  --warn-soft: #fff7e6;
  --danger:    #cc2c32;
  --danger-soft: #fff1f0;
  --info:      #4072e2;
  --info-soft: #e6f0ff;

  /* type */
  --font-sans: 'Arimo', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-he:   'Arimo', sans-serif;

  /* radii */
  --r-sm: 4px;
  --r:    4px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* shadows */
  --sh-sm: 0 1px 2px rgba(24, 39, 75, 0.06);
  --sh:    0 1px 3px rgba(24, 39, 75, 0.08), 0 4px 12px rgba(24, 39, 75, 0.06);
  --sh-btn: 0 4px 14px -4px rgba(24, 39, 75, 0.12), 0 8px 28px -6px rgba(24, 39, 75, 0.10);
  --sh-lg: 0 10px 40px rgba(24, 39, 75, 0.10), 0 4px 14px rgba(24, 39, 75, 0.06);

  --colorInputBorder: #4f669a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { font-family: var(--font-he); }

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

/* ——— shell ——— */
.app {
  display: grid;
  height: 100vh;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}
.app.has-sidebar { grid-template-columns: 248px 1fr; }
.app.has-topnav { grid-template-rows: 56px 1fr; }

/* sidebar */
.sidebar {
  border-inline-end: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 4px;
}
.sidebar .telefire-logo {
  padding: 2px 8px 10px;
}
.sidebar .telefire-logo img {
  display: block;
  height: 30px;
  width: auto;
  border-radius: 6px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 16px;
}
.sidebar .brand .mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.sidebar .brand .mark svg { display: block; }
.sidebar .brand .name {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sidebar .brand .name small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 1px;
}
.sidebar .section-label {
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 10px 6px;
  font-weight: 500;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  width: 100%;
  text-align: start;
}
.nav-item:hover { background: rgba(36, 65, 131, 0.05); color: var(--accent); }
.nav-item.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 500;
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--accent); }
.nav-item.active svg { color: #ffffff; }
.nav-item:hover svg { color: var(--accent); }
.nav-item .count {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.nav-item.active .count { color: rgba(255,255,255,0.85); }

/* topnav (alt layout) */
.topnav {
  display: flex; align-items: center;
  background: var(--accent);
  color: #ffffff;
  padding: 0 24px;
  gap: 18px;
}
.topnav .brand { display: flex; align-items: center; gap: 10px; margin-inline-end: 6px; }
.topnav .brand .mark {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
}
.topnav .brand .name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; color: #fff; }
.topnav .tabs { display: flex; gap: 2px; height: 100%; }
.topnav .tab {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  height: 100%;
  cursor: pointer;
}
.topnav .tab.active { color: #fff; font-weight: 500; border-bottom-color: #fff; }
.topnav .right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

/* main */
.main { overflow: auto; min-width: 0; min-height: 0; }
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px 80px;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.crumbs { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.crumbs .sep { opacity: 0.5; height: auto; background: none; margin: 0; }
.crumb-link {
  font: inherit; color: var(--muted); background: none; border: none;
  padding: 0; cursor: pointer; border-radius: 3px;
}
.crumb-link:hover { color: var(--accent); text-decoration: underline; }

/* buttons — TeleOne palette, denser sizing */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
  white-space: nowrap;
}
.btn:hover { background: rgba(36, 65, 131, 0.05); }
.btn:active { background: rgba(36, 65, 131, 0.1); }
.btn svg { width: 14px; height: 14px; }
.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: var(--sh-sm);
}
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.accent {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn.accent:hover { background: var(--accent-ink); }
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(36, 65, 131, 0.05); color: var(--accent); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.lg { padding: 9px 16px; font-size: 14px; }
.btn.icon { padding: 7px; }

/* inputs */
.input, .textarea, .select {
  width: 100%;
  padding: 8px 11px;
  border-radius: 4px;
  border: 1px solid var(--colorInputBorder);
  background: var(--surface);
  font-size: 13.5px;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.textarea { min-height: 76px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field-hint { font-size: 11.5px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* card */
.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
.card-h {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card-h h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-b { padding: 16px; }

/* badge / pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--muted); }
.pill.ok      { background: var(--ok-soft);      border-color: #b7eb8f; color: #36721a; }
.pill.ok.dot::before { background: var(--ok); }
.pill.warn    { background: var(--warn-soft);    border-color: #ffd591; color: #ad6800; }
.pill.warn.dot::before { background: var(--warn); }
.pill.info    { background: var(--info-soft);    border-color: #adc6ff; color: var(--accent); }
.pill.info.dot::before { background: var(--info); }
.pill.accent  { background: var(--accent-soft);  border-color: var(--accent-line); color: var(--accent); }
.pill.accent.dot::before { background: var(--accent); }
.pill.danger  { background: var(--danger-soft);  border-color: #ffa39e; color: var(--danger); }
.pill.danger.dot::before { background: var(--danger); }

/* table — gentler header */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl thead th {
  text-align: start;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg-2);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tbl tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
}
.tbl tbody tr:hover td { background: rgba(36, 65, 131, 0.04); }
.tbl .num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.tbl .mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.tbl .right { text-align: end; }

/* utility */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-2);
}
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.tab-nums { font-variant-numeric: tabular-nums; }

/* search */
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--colorInputBorder);
  border-radius: 4px;
  width: 280px;
}
.search input {
  border: 0; outline: 0; background: transparent;
  flex: 1; font-size: 13px;
  font-family: var(--font-sans);
  color: var(--ink);
}
.search input::placeholder { color: var(--faint); }
.search svg { width: 14px; height: 14px; color: var(--muted); }
.topnav .search {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.topnav .search input { color: #fff; }
.topnav .search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.topnav .search svg { color: rgba(255, 255, 255, 0.7); }

/* avatar */
.avatar {
  width: 26px; height: 26px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

/* progress */
.progress {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 240ms;
}

/* fade-in */
@keyframes fadein { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.fadein { animation: fadein 240ms ease both; }

/* RTL flip helpers */
[dir="rtl"] .flip { transform: scaleX(-1); }

/* canvas / artboard chrome */
.artboard {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  overflow: hidden;
}

/* scrollbar — thin, brand blue */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
::-webkit-scrollbar { width: 2px; height: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-ink); }
::-webkit-scrollbar-corner { background: transparent; }

/* live monitoring — pulsing status dot */
.lm-live-dot {
  width: 9px; height: 9px; border-radius: 999px;
  background: oklch(0.62 0.16 155);
  box-shadow: 0 0 0 0 oklch(0.62 0.16 155 / 0.5);
  animation: lm-pulse 1.8s ease-out infinite;
  flex-shrink: 0;
}
@keyframes lm-pulse {
  0%   { box-shadow: 0 0 0 0 oklch(0.62 0.16 155 / 0.5); }
  70%  { box-shadow: 0 0 0 7px oklch(0.62 0.16 155 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.62 0.16 155 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  .lm-live-dot { animation: none; }
}

/* AI planning analyzer */
@keyframes az-spin { to { transform: rotate(360deg); } }
@keyframes az-scan { 0% { transform: translateX(-6%); } 50% { transform: translateX(106%); } 100% { transform: translateX(-6%); } }
@keyframes az-pop { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes az-region { from { opacity: 0; } to { opacity: 1; } }
@keyframes az-dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.az-spinner {
  width: 18px; height: 18px; border-radius: 999px;
  border: 2px solid var(--accent-line); border-top-color: var(--accent);
  animation: az-spin 0.7s linear infinite; flex-shrink: 0;
}
.az-pop { animation: az-pop 320ms cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.az-scanline { animation: az-scan 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .az-spinner { animation: none; }
  .az-scanline { animation: none; display: none; }
}

