@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  /* Brand Color System (Hocmate DNA) + Midday Architectural Tokens */
  --hm-primary: #6B35E8;
  --hm-primary-dark: #5224B5;
  --hm-primary-light: #8B5CF6;
  --hm-primary-bg: #F3EEFF;
  --hm-accent: #F5B731;
  --hm-accent-hover: #E5A520;
  --hm-dark: #1A103C;
  --hm-text: #2D2250;
  --hm-text-secondary: #6B6490;
  --hm-light-bg: #FAFAFF;
  --hm-border: #EDE8F5;
  --hm-border-strong: #D6CBEB;
  --hm-emerald: #059669;

  /* Mapped Application Semantic Variables */
  --ink: #1A103C;
  --ink-soft: #2D2250;
  --muted: #6B6490;
  --soft: #948CB5;
  --bg: #FAFAFF;
  --panel: #FFFFFF;
  --panel-alt: #F6F3FC;
  --line: #EDE8F5;
  --line-strong: #D6CBEB;
  --nav: #130B2E;
  --nav-hover: #21144D;
  --primary: #6B35E8;
  --primary-hover: #5224B5;
  --purple-soft: #F3EEFF;
  --accent: #F5B731;
  --accent-hover: #E5A520;
  --accent-soft: #FEF9C3;
  --green: #059669;
  --green-bright: #10B981;
  --green-soft: #ECFDF5;
  --red: #E11D48;
  --red-soft: #FFE4E6;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --blue: #6B35E8;
  --blue-soft: #F3EEFF;

  /* Midday Precision Shadows & Hairline Radii */
  --shadow-xs: 0 1px 2px rgba(26, 16, 60, 0.03);
  --shadow-sm: 0 2px 10px rgba(107, 53, 232, 0.05);
  --shadow: 0 8px 28px -4px rgba(107, 53, 232, 0.08), 0 2px 8px -2px rgba(26, 16, 60, 0.04);
  --shadow-lg: 0 16px 44px -8px rgba(107, 53, 232, 0.14), 0 6px 16px -4px rgba(26, 16, 60, 0.05);
  --shadow-gold: 0 6px 22px rgba(245, 183, 49, 0.38);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 248px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body {
  margin: 0;
  background-color: var(--bg);
  /* Midday subtle architectural grid + Hocmate lavender aura */
  background-image:
    radial-gradient(circle at 85% 0%, rgba(107, 53, 232, 0.06) 0%, transparent 48%),
    radial-gradient(circle at 12% 100%, rgba(245, 183, 49, 0.05) 0%, transparent 42%),
    linear-gradient(to right, rgba(237, 232, 245, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(237, 232, 245, 0.45) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  background-attachment: fixed;
  color: var(--ink-soft);
  font: 13.5px/1.55 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

button, input, textarea, select {
  font: inherit;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* =========================================================
   MIDDAY APP SHELL & SIDEBAR (Collapsible Rail + Deep Night / Crisp Hybrid)
   ========================================================= */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 72px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background:
    radial-gradient(circle at 85% 8%, rgba(107, 53, 232, 0.26) 0%, transparent 48%),
    radial-gradient(circle at 15% 92%, rgba(245, 183, 49, 0.10) 0%, transparent 45%),
    linear-gradient(170deg, #0B0518 0%, #150A33 52%, #1A103C 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  color: #FAFAFF;
  padding: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease;
}

.app-shell.sidebar-collapsed .sidebar:hover {
  width: 248px;
  box-shadow: 20px 0 50px rgba(11, 5, 24, 0.42);
}

.brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFFFFF;
  text-decoration: none;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  position: relative;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #6B35E8 0%, #5224B5 100%);
  border: 1px solid rgba(245, 183, 49, 0.45);
  font-size: 17px;
  font-weight: 800;
  color: #F5B731;
  box-shadow: 0 6px 18px rgba(107, 53, 232, 0.45);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F5B731;
  border: 2px solid #150A33;
}

.brand b, .brand small {
  display: block;
  white-space: nowrap;
}

.brand b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.brand small {
  color: #F5B731;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-toggle-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #C4B5FD;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(107, 53, 232, 0.35);
  color: #F5B731;
  border-color: rgba(245, 183, 49, 0.4);
}

.app-shell.sidebar-collapsed .sidebar:not(:hover) .brand > span:not(.brand-mark),
.app-shell.sidebar-collapsed .sidebar:not(:hover) .sidebar-toggle-btn,
.app-shell.sidebar-collapsed .sidebar:not(:hover) .nav-label,
.app-shell.sidebar-collapsed .sidebar:not(:hover) .nav a span,
.app-shell.sidebar-collapsed .sidebar:not(:hover) .nav-button span,
.app-shell.sidebar-collapsed .sidebar:not(:hover) .system-live > div,
.app-shell.sidebar-collapsed .sidebar:not(:hover) .sidebar-foot > small {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 12px;
  flex: 1;
}

.nav-label {
  color: rgba(196, 181, 253, 0.55);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 10px 5px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.nav a, .nav-button {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(243, 238, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a i, .nav-button i {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-size: 14px;
  border-radius: 6px;
  color: rgba(196, 181, 253, 0.8);
  transition: all 0.16s ease;
}

.nav a:hover, .nav-button:hover {
  background: rgba(107, 53, 232, 0.22);
  border-color: rgba(139, 92, 246, 0.28);
  color: #FFFFFF;
}

.nav a:hover i, .nav-button:hover i {
  color: #F5B731;
}

.nav a.active {
  background: linear-gradient(90deg, rgba(107, 53, 232, 0.42) 0%, rgba(107, 53, 232, 0.18) 100%);
  border-color: rgba(245, 183, 49, 0.42);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #F5B731, 0 4px 14px rgba(107, 53, 232, 0.22);
}

.nav a.active i {
  color: #F5B731;
}

.sidebar .nav-button {
  background: transparent !important;
  color: rgba(243, 238, 255, 0.72) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  border: 1px solid transparent !important;
}

.sidebar .nav-button:hover {
  background: rgba(107, 53, 232, 0.22) !important;
  border-color: rgba(139, 92, 246, 0.28) !important;
  color: #FFFFFF !important;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(196, 181, 253, 0.65);
}

.system-live {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.system-live > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.system-live b, .system-live small {
  display: block;
  white-space: nowrap;
}

.system-live b {
  font-size: 11.5px;
  color: #FFFFFF;
  font-weight: 700;
}

.system-live small, .sidebar-foot > small {
  font-size: 10.5px;
  color: rgba(196, 181, 253, 0.65);
  font-family: 'JetBrains Mono', monospace;
}

/* =========================================================
   MIDDAY TOP HEADER & COMMAND SEARCH BAR
   ========================================================= */
.workspace {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 14px;
}

.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.breadcrumb b {
  color: var(--ink);
  font-weight: 800;
}

/* Midday OpenSearchButton trigger in header */
.midday-cmd-trigger {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.midday-cmd-trigger:hover {
  border-color: var(--primary);
  background: var(--purple-soft);
  color: var(--primary);
}

.midday-cmd-trigger kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(5, 150, 105, 0.25);
  padding: 0 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.connection:hover {
  filter: brightness(0.97);
}

.connection i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.connection.warn {
  background: var(--amber-soft);
  color: #92400E;
  border-color: rgba(217, 119, 6, 0.3);
}

.connection.warn i {
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.icon-button, .avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.icon-button {
  color: var(--ink-soft);
  background: #FFFFFF;
  font-size: 15px;
}

.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--purple-soft);
}

.avatar {
  border: 1px solid rgba(107, 53, 232, 0.25);
  background: var(--purple-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
}

.topbar-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 5px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-user-pill:hover {
  border-color: var(--primary);
  background: var(--purple-soft);
}

.topbar-user-pill .avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6B35E8, #1A103C);
  color: #F5B731;
  font-size: 10.5px;
  font-weight: 800;
}

.topbar-user-pill small {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--purple-soft);
  color: var(--primary);
}

.topbar-user-pill small.trial {
  background: #FEF9C3;
  color: #92400E;
  border: 1px solid rgba(245, 183, 49, 0.45);
}

.mobile-menu {
  display: none;
}

/* =========================================================
   MAIN CONTENT CANVAS & HOCMATE HERO BANNER
   ========================================================= */
main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

/* Hero Banner: Deep Night Violet (#0B0518 -> #1A0B3E -> #2D1566) + Gold (#F5B731) */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(139, 92, 246, 0.28);
  background:
    radial-gradient(circle at 88% 18%, rgba(107, 53, 232, 0.38) 0%, transparent 52%),
    radial-gradient(circle at 12% 88%, rgba(245, 183, 49, 0.16) 0%, transparent 48%),
    linear-gradient(160deg, #0B0518 0%, #1A0B3E 48%, #2D1566 100%);
  color: #FFFFFF;
  box-shadow: 0 14px 40px rgba(26, 16, 60, 0.18);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary);
  background: var(--purple-soft);
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid rgba(107, 53, 232, 0.18);
  font-family: 'JetBrains Mono', monospace;
}

.hero .eyebrow {
  background: rgba(139, 92, 246, 0.22);
  color: #F5B731;
  border-color: rgba(245, 183, 49, 0.35);
}

h1 {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin: 10px 0 8px;
  color: var(--ink);
}

.hero h1 {
  color: #FFFFFF;
}

h1 em {
  color: var(--primary);
  font-style: normal;
}

.hero h1 em {
  color: #F5B731;
  text-shadow: 0 2px 18px rgba(245, 183, 49, 0.25);
}

.hero p {
  color: rgba(243, 238, 255, 0.82);
  max-width: 680px;
  font-size: 13.5px;
}

h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   BUTTONS & INPUTS (Hocmate Gold CTA + Violet Primary + Midday Hairlines)
   ========================================================= */
input, select, button {
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--ink-soft);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all 0.16s ease;
}

input:hover, select:hover {
  border-color: var(--line-strong);
}

.source-box textarea:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107, 53, 232, 0.14);
  background: #FFFFFF;
}

select {
  min-width: 170px;
  cursor: pointer;
}

button {
  cursor: pointer;
  font-weight: 700;
}

/* Primary Buttons: Violet #6B35E8, while Hero CTA uses Hocmate Gold #F5B731 */
.channel-form button, .form-row button[type="submit"], .process, .approve, button.primary {
  border: 1px solid rgba(107, 53, 232, 0.9);
  background: var(--primary);
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(107, 53, 232, 0.26);
  transition: all 0.16s ease;
}

.channel-form button:hover, .form-row button[type="submit"]:hover, .process:hover, .approve:hover, button.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(107, 53, 232, 0.36);
}

/* Gold Hero Button (.primary-action) matching hocmate_edtech_design_preview.html */
.primary-action {
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #1A103C !important;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-gold);
  transition: all 0.18s ease;
}

.primary-action:hover {
  background: var(--accent-hover);
  color: #1A103C !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(245, 183, 49, 0.52);
}

.primary-action span {
  font-size: 16px;
  line-height: 1;
}

.secondary {
  background: #FFFFFF !important;
  color: var(--ink-soft) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-xs) !important;
  font-weight: 600 !important;
}

.secondary:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--purple-soft) !important;
}

.tertiary, .ghost {
  background: var(--panel-alt) !important;
  color: var(--muted) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.tertiary:hover, .ghost:hover {
  background: var(--purple-soft) !important;
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
}

.add-channel-link {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(107, 53, 232, 0.25);
  transition: all 0.16s ease;
}

.add-channel-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* =========================================================
   MIDDAY WIDGET CARDS (.stats)
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stats article {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 112px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.stats article > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 74px;
}

.stats article:hover {
  background: #FAFAFF;
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
}

.violet {
  background: var(--purple-soft);
  color: var(--primary);
  border-color: rgba(107, 53, 232, 0.16);
}

.blue {
  background: #F3EEFF;
  color: #6B35E8;
  border-color: rgba(107, 53, 232, 0.16);
}

.green {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(5, 150, 105, 0.18);
}

.amber {
  background: #FEF9C3;
  color: #B45309;
  border-color: rgba(245, 183, 49, 0.45);
}

.stats small, .stats strong, .stats em {
  display: block;
}

.stats small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stats strong {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  margin: 6px 0 2px;
}

.stats em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* =========================================================
   PANELS, COMMAND INPUT & DASHBOARD GRID
   ========================================================= */
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-bottom: 22px;
}

.create, .quick-start {
  padding: 22px 24px;
}

.panel-head, .section-heading, .job-top, .meta, .actions, .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-head p, .section-heading p {
  font-size: 12.5px;
  margin-top: 2px;
}

.panel-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  background: var(--purple-soft);
  color: var(--primary);
  border: 1px solid rgba(107, 53, 232, 0.18);
  border-radius: 10px;
  font-size: 16px;
}

.pill, .count-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--purple-soft);
  color: var(--primary);
  border: 1px solid rgba(107, 53, 232, 0.18);
  font-family: 'JetBrains Mono', monospace;
}

.field-label {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}

.create form {
  margin-top: 16px;
}

/* Midday AskMidday-style Command Box */
.source-box {
  position: relative;
}

.source-box textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 14px 62px 14px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: #FAFAFF;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
  outline: none;
  transition: all 0.16s ease;
}

.source-box > span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px 7px;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.form-row label {
  display: grid;
  min-width: 0;
}

.form-row select {
  width: 100%;
  min-width: 0;
}

.form-row button[type="submit"], .channel-form button {
  padding: 0 20px;
  height: 40px;
  white-space: nowrap;
}

/* Midday QuickActions-style Option Chips */
.pipeline-options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #FAFAFF;
  border: 1px solid var(--line);
  align-items: center;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
}

.option-chip:hover {
  border-color: var(--line-strong);
  background: var(--purple-soft);
}

.option-chip input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  margin: 0;
  accent-color: var(--primary);
}

.option-chip:has(input:checked) {
  border-color: rgba(107, 53, 232, 0.38);
  background: var(--purple-soft);
  color: var(--primary);
  font-weight: 700;
}

.option-chip.affiliate-chip {
  border-color: rgba(245, 183, 49, 0.55);
  background: #FFFBEB;
  color: #92400E;
  font-weight: 700;
}

.option-chip.affiliate-chip input[type="checkbox"] {
  accent-color: #D97706;
}

.option-chip.affiliate-chip:has(input:checked) {
  border-color: #D97706;
  background: linear-gradient(135deg, #FEF9C3, #FDE68A);
  color: #1A103C;
  box-shadow: 0 2px 10px rgba(245, 183, 49, 0.25);
}

.cost-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--purple-soft);
  border: 1px solid rgba(107, 53, 232, 0.18);
  color: var(--ink);
}

.cost-note > span {
  font-size: 16px;
  color: var(--primary);
}

.cost-note b, .cost-note small {
  display: block;
}

.cost-note b {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.cost-note small {
  font-size: 11.5px;
  color: var(--muted);
}

/* Quick Start Steps */
.quick-start ol {
  list-style: none;
  padding: 4px 0 0;
  margin: 12px 0 0;
}

.quick-start li {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 11px 0;
}

.quick-start li:not(:last-child):after {
  content: "";
  position: absolute;
  left: 14px;
  top: 41px;
  width: 1.5px;
  height: 16px;
  background: var(--line-strong);
}

.quick-start li > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--purple-soft);
  border: 1px solid rgba(107, 53, 232, 0.18);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 11.5px;
}

.quick-start li.done > span {
  background: var(--green-soft);
  border-color: rgba(5, 150, 105, 0.25);
  color: var(--green);
}

.quick-start li b, .quick-start li small {
  display: block;
}

.quick-start li b {
  font-size: 12.5px;
  color: var(--ink);
}

.quick-start li small {
  font-size: 11px;
  color: var(--muted);
}

.quick-start li i {
  margin-left: auto;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

/* =========================================================
   CHANNEL LIBRARY & PRODUCTION QUEUE
   ========================================================= */
.channel-library {
  padding: 24px;
  margin-bottom: 24px;
  scroll-margin-top: 84px;
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: 20px;
}

.channel-form {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: #FAFAFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  scroll-margin-top: 90px;
}

.channel-form:target {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(107, 53, 232, 0.12);
}

.channels {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: #FAFAFF;
}

.empty span, .empty b, .empty small {
  display: block;
}

.empty span {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 8px;
}

.empty b {
  color: var(--ink);
  font-size: 14.5px;
}

.empty small {
  font-size: 12px;
  margin-top: 4px;
}

.production {
  scroll-margin-top: 84px;
}

.jobs {
  display: grid;
  gap: 12px;
}

.job {
  padding: 18px 20px;
  transition: all 0.16s ease;
}

.job:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.job h3 {
  margin: 6px 0;
  max-width: 820px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.queue-filter-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.queue-pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.queue-pill:hover {
  color: var(--ink);
  background: var(--purple-soft);
}

.queue-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(107, 53, 232, 0.25);
}

.queue-search {
  min-width: 260px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-search input {
  border: 0;
  outline: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  font-size: 12.5px;
}

.stats article[data-stat-action] {
  cursor: pointer;
}

.job-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.job-opt-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--purple-soft);
  color: var(--primary);
  border: 1px solid rgba(107, 53, 232, 0.16);
}

.job-opt-tag.affiliate {
  background: #FEF9C3;
  color: #92400E;
  border-color: rgba(245, 183, 49, 0.5);
}

.status {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--primary);
  background: var(--purple-soft);
  padding: 3px 9px;
  border-radius: 99px;
  font-family: 'JetBrains Mono', monospace;
}

.status.status-completed,
.status.status-published {
  background: var(--green-soft);
  color: var(--green);
}

.status.status-review,
.status.status-needs-review,
.status.status-paused,
.status.status-scheduled {
  background: #FEF9C3;
  color: #92400E;
}

.status.status-failed,
.status.status-cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.percent {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink);
}

.progress {
  height: 6px;
  background: var(--purple-soft);
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6B35E8 0%, #F5B731 100%);
  width: 0;
  border-radius: 99px;
  transition: width 0.3s ease;
}

@keyframes progressShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.progress.is-running i {
  background: linear-gradient(90deg, #6B35E8 0%, #F5B731 50%, #6B35E8 100%);
  background-size: 200% 100%;
  animation: progressShimmer 1.8s linear infinite;
}

.meta {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.actions {
  justify-content: flex-start;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.actions a, .actions button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.output {
  color: #1A103C;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(245, 183, 49, 0.32);
}

pre {
  white-space: pre-wrap;
  background: #130B2E;
  color: #F3EEFF;
  border-radius: 10px;
  padding: 14px;
  max-height: 300px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 12px;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Modals & Dialogs */
dialog {
  width: min(700px, 94vw);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 28px 80px rgba(26, 16, 60, 0.28);
}

dialog::backdrop {
  background: rgba(19, 11, 46, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-head button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 18px;
}

.check {
  display: grid;
  grid-template-columns: 28px 120px 1fr;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  align-items: center;
}

.ok {
  color: var(--green);
}

.bad, .channel-error {
  color: var(--red);
}

body:not(.app-shell) {
  min-height: 100vh;
}

.card {
  padding: 22px 24px;
}

.card label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 13px;
}

.card textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #FAFAFF;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 13px;
  outline: none;
}

.publish-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  background: #FAFAFF;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.publish-panel label {
  margin: 0;
  flex: 1;
}

.publish-panel .actions {
  margin: 0;
}

/* Toast Notification */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 420px;
  padding: 13px 18px;
  border-radius: 10px;
  background: #1A103C;
  color: #FFFFFF;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 20px 45px rgba(26, 16, 60, 0.35);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 12.5px;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--green);
}

.toast.error {
  background: var(--red);
}

/* Responsive Breakpoints */
@media (max-width: 1150px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .channel-form {
    grid-template-columns: 1fr 130px;
  }
  .channel-form button {
    grid-column: 1 / -1;
  }
  .app-shell {
    --sidebar-width: 228px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    width: 256px !important;
    display: flex;
    transform: translateX(-105%);
    transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 24px 0 60px rgba(19, 11, 46, 0.55);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(19, 11, 46, 0.48);
    backdrop-filter: blur(3px);
  }
  .sidebar.open ~ .sidebar-backdrop {
    display: block;
  }
  .workspace {
    grid-column: 1;
  }
  .topbar {
    padding: 0 16px;
  }
  .mobile-menu {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #FFFFFF;
    padding: 0;
    margin-right: 6px;
    font-size: 17px;
  }
  .connection, .midday-cmd-trigger {
    display: none;
  }
  main {
    padding: 20px 16px 56px;
  }
  .hero {
    display: block;
    padding: 22px 20px;
  }
  .primary-action {
    margin-top: 14px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stats article {
    padding: 14px;
  }
  .stat-icon {
    display: none;
  }
  .channel-form, .form-row {
    grid-template-columns: 1fr !important;
  }
  .channel-form button {
    grid-column: auto;
  }
  .section-heading, .channel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-grid {
    gap: 14px;
  }
  .add-channel-link {
    display: none;
  }
  .publish-panel {
    display: block;
  }
}
