/* ElsiaScreen — Clean light professional theme */
:root {
  /* Surfaces */
  --bg-deep: #F2F3F5;
  --bg-app: #FAFBFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F5F6F8;
  --bg-row-hover: #FAFBFC;
  --bg-subtle: #F7F8FA;

  /* Borders — hairline */
  --border-faint: #F0F1F4;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-accent: #2A3142;

  /* Text */
  --text-primary: #0F1419;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;

  /* Brand (logo-derived) */
  --elsia-navy: #2A3142;
  --elsia-navy-dark: #1F2533;
  --elsia-navy-soft: rgba(42, 49, 66, 0.06);
  --elsia-orange: #E8941A;
  --elsia-yellow: #F5B842;
  --elsia-amber-soft: #FFF6E5;

  /* Semantic */
  --success: #16A34A;
  --success-soft: #ECFDF5;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --live: #DC2626;
  --info: #2563EB;
  --info-soft: #EFF6FF;

  /* Radii */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* Shadows */
  --shadow-xs: 0 1px 0 rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 2px rgba(15,20,25,0.04), 0 0 0 1px rgba(15,20,25,0.04);
  --shadow-md: 0 4px 8px rgba(15,20,25,0.06), 0 0 0 1px rgba(15,20,25,0.05);
  --shadow-lg: 0 12px 28px rgba(15,20,25,0.1), 0 0 0 1px rgba(15,20,25,0.05);

  /* Type — Geist, sober & professional, not Inter/Roboto */
  --font-ui: "Geist", "Söhne", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Geist", "Söhne", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  font-feature-settings: "ss01", "cv11";
}

#root { height: 100vh; }

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  border: 2px solid var(--bg-app);
}
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

/* ============================================ */
/* App shell                                    */
/* ============================================ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-app);
}

.mode-bar {
  height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
}

.mode-bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.mode-bar__brand-mark {
  height: 22px;
  width: auto;
  display: block;
}
.mode-bar__brand-divider {
  width: 1px; height: 16px; background: var(--border-strong);
}
.mode-bar__brand-name { color: var(--text-primary); font-weight: 600; }
.mode-bar__brand-product { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.mode-bar__switcher {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  padding: 2px;
  border: 1px solid var(--border);
  margin-left: auto;
}
.mode-bar__tab {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}
.mode-bar__tab:hover { color: var(--text-primary); }
.mode-bar__tab--active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
  font-weight: 600;
}
.mode-bar__tab svg { width: 13px; height: 13px; }

.mode-bar__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.mode-bar__status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.mode-bar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.mode-bar__user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--elsia-navy);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.app__body { flex: 1; display: flex; min-height: 0; }

/* ============================================ */
/* Controller — Sidebar                         */
/* ============================================ */
.sidebar {
  width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar__section {
  padding: 16px 16px 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar__nav { display: flex; flex-direction: column; padding: 0 8px; gap: 1px; }
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 5px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.1s ease;
  width: 100%;
  text-align: left;
}
.sidebar__item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.sidebar__item--active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
}
.sidebar__item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
.sidebar__item--active svg { color: var(--elsia-navy); }
.sidebar__item-badge {
  margin-left: auto;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.sidebar__item-dot {
  margin-left: auto;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.sidebar__footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar__credit {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.45;
  text-align: center;
}
.sidebar__credit strong {
  color: var(--text-muted);
  font-weight: 600;
}
.sidebar__credit-heart {
  display: inline-block;
  font-size: 11px;
  vertical-align: -1px;
  animation: heart-beat 1.6s ease-in-out infinite;
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.2); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}
.sidebar__broadcast-card {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
}
.sidebar__broadcast-label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.sidebar__broadcast-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
  animation: pulse-soft 2s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.sidebar__broadcast-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.sidebar__broadcast-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.sidebar__broadcast-actions {
  display: flex; gap: 4px; margin-top: 10px;
}

/* ============================================ */
/* Pane                                         */
/* ============================================ */
.pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-app);
}
.pane__header {
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
  flex-wrap: wrap;
}
.pane__title-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pane__crumb {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.pane__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0;
}
.pane__actions { display: flex; gap: 8px; align-items: center; }

.pane__body {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 32px;
}

/* ============================================ */
/* Buttons — flat, no gradients                 */
/* ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: all 0.1s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  height: 30px;
}
.btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.btn:active { background: var(--bg-hover); }
.btn svg { width: 13px; height: 13px; color: var(--text-secondary); }

.btn--primary {
  background: var(--elsia-navy);
  color: #FFFFFF;
  border-color: var(--elsia-navy);
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover {
  background: var(--elsia-navy-dark);
  border-color: var(--elsia-navy-dark);
}
.btn--primary svg { color: var(--elsia-yellow); }

.btn--accent {
  background: var(--elsia-yellow);
  color: var(--elsia-navy);
  border-color: #E5A82E;
}
.btn--accent:hover { background: var(--elsia-orange); }
.btn--accent svg { color: var(--elsia-navy); }

.btn--danger {
  background: var(--bg-surface);
  color: var(--danger);
  border-color: var(--border);
}
.btn--danger:hover {
  background: var(--danger-soft);
  border-color: #FCA5A5;
}
.btn--danger svg { color: var(--danger); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }

.btn--sm { padding: 3px 8px; font-size: 12px; height: 26px; }
.btn--icon { padding: 6px; }
.btn--sm.btn--icon { padding: 4px; }

/* ============================================ */
/* Inputs                                       */
/* ============================================ */
.input, .search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  min-width: 200px;
  height: 30px;
  transition: all 0.1s ease;
}
.input:hover, .search:hover { border-color: var(--border-strong); }
.input:focus-within, .search:focus-within {
  border-color: var(--elsia-navy);
  box-shadow: 0 0 0 3px rgba(42, 49, 66, 0.08);
}
.input input, .search input { flex: 1; }
.input svg, .search svg { width: 13px; height: 13px; color: var(--text-muted); }
.search input::placeholder { color: var(--text-faint); }

/* ============================================ */
/* Cards                                        */
/* ============================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}
.card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card__title-sub { font-size: 11.5px; font-weight: 400; color: var(--text-muted); }
.card__body { padding: 16px; }

/* ============================================ */
/* Tables                                       */
/* ============================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-faint);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.08s ease; }
.table tbody tr:hover { background: var(--bg-row-hover); }
.table tbody tr.is-selected { background: var(--elsia-amber-soft); }

/* ============================================ */
/* Badges                                       */
/* ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  line-height: 1.5;
}
.badge--success {
  background: var(--success-soft);
  color: #15803D;
  border-color: #BBF7D0;
}
.badge--warning {
  background: var(--warning-soft);
  color: #B45309;
  border-color: #FDE68A;
}
.badge--danger {
  background: var(--danger-soft);
  color: #B91C1C;
  border-color: #FECACA;
}
.badge--live {
  background: var(--danger-soft);
  color: var(--live);
  border-color: #FECACA;
  font-weight: 600;
}
.badge--live::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse-soft 2s ease-in-out infinite;
}
.badge--muted {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border);
}
.badge--accent {
  background: var(--elsia-amber-soft);
  color: #92510C;
  border-color: #FCD9A1;
}
.badge--neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border);
}

/* Content type tags */
.tag-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tag-type__sq {
  width: 16px; height: 16px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid;
}
.tag-type__sq--pdf { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.tag-type__sq--ppt { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }
.tag-type__sq--xls { background: #ECFDF5; color: #15803D; border-color: #BBF7D0; }
.tag-type__sq--vid { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.tag-type__sq--img { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.tag-type__sq--web { background: #FDF2F8; color: #BE185D; border-color: #FBCFE8; }
.tag-type__sq--kpi { background: #FFFBEB; color: #92510C; border-color: #FDE68A; }
.tag-type__sq--soc { background: #ECFEFF; color: #0E7490; border-color: #A5F3FC; }
.tag-type__sq--txt { background: #F8FAFC; color: #475569; border-color: #E2E8F0; }
.tag-type__sq--yt  { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.tag-type__sq--met { background: #ECFEFF; color: #0E7490; border-color: #A5F3FC; }

/* ============================================ */
/* Misc helpers                                 */
/* ============================================ */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--text-muted); }

.kbd {
  display: inline-flex;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.divider-v { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
