/* Signature system - graphite, porcelain and signal color. */

:root {
  --bg-primary: #070807;
  --bg-secondary: #0d0f0e;
  --bg-card: #121413;
  --card-bg: #121413;
  --bg-hover: #1a1d1b;
  --border: #292d2a;
  --border-light: #414743;
  --accent: #c9ff4a;
  --accent-hover: #dcff83;
  --accent-light: rgba(201, 255, 74, 0.1);
  --accent2: #79cfff;
  --accent2-light: rgba(121, 207, 255, 0.1);
  --success: #8be8ae;
  --warning: #f0c66d;
  --danger: #ff756b;
  --info: #79cfff;
  --text-primary: #f3f5f2;
  --text-secondary: #b7bdb9;
  --text-muted: #6f7772;
  --director-rail: 76px;
  --director-offset: 94px;
  --director-mint: #c9ff4a;
  --director-ice: #79cfff;
  --director-gold: #f0c66d;
}

html,
body { background: #070807; }

body:not(.landing-page) {
  background-color: #070807;
  background-image:
    linear-gradient(rgba(208, 216, 211, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 216, 211, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
}

::selection { color: #10130a; background: #c9ff4a; }

/* Expandable icon rail */
.sidebar {
  width: var(--director-rail);
  overflow: hidden;
  background: rgba(8, 9, 8, 0.98);
  border-color: #292c2a;
  border-radius: 4px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}
.sidebar:hover { width: 210px; border-color: #414743; }
.sidebar::before {
  right: 10px;
  left: 10px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), #c9ff4a, transparent);
}
.sidebar::after {
  right: 0;
  background: linear-gradient(to bottom, transparent, #f3f5f2, #c9ff4a, transparent);
  box-shadow: 0 0 14px rgba(201, 255, 74, 0.24);
}

.sidebar-logo {
  min-height: 76px;
  padding: 10px;
  flex-direction: row;
  justify-content: center;
  gap: 0;
}
.sidebar-logo .logo-icon,
.mobile-header-logo .logo-icon,
.mobile-header .logo-icon,
.auth-logo .logo-icon,
.landing-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: #c9ff4a !important;
  color: #11150a !important;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(226, 255, 156, 0.5), 0 0 22px rgba(201, 255, 74, 0.08);
}
.sidebar-logo .logo-text {
  width: 0;
  overflow: hidden;
  opacity: 0;
  color: #f3f5f2;
  font-size: 13px;
  white-space: nowrap;
  transition: width 0.2s ease, margin 0.2s ease, opacity 0.16s ease;
}
.sidebar:hover .sidebar-logo { justify-content: flex-start; padding-right: 14px; padding-left: 14px; }
.sidebar:hover .sidebar-logo .logo-text { width: 104px; margin-left: 10px; opacity: 1; }
.sidebar-logo .logo-text span { color: #c9ff4a; }

.sidebar-nav { padding: 10px 7px; overflow-x: hidden; }
.nav-item {
  min-height: 48px;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  padding: 6px;
  color: #7b827e;
  border-radius: 3px;
  font-size: 0;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, padding 0.24s ease;
}
.nav-item .nav-icon { flex: 0 0 22px; width: 22px; height: 22px; }
.nav-item .nav-icon svg { width: 19px; height: 19px; }
.nav-item::after { right: 18px; left: 18px; bottom: 1px; background: #c9ff4a; }
.nav-item:hover { color: #f3f5f2; background: #151816; border-color: #303532; }
.nav-item.active {
  color: #d9ff7f;
  background: #171b15;
  border-color: rgba(201, 255, 74, 0.24);
  box-shadow: inset 3px 0 0 #c9ff4a;
}
.sidebar:hover .nav-item {
  justify-content: flex-start;
  gap: 11px;
  padding-right: 12px;
  padding-left: 12px;
  font-size: 12px;
}
.sidebar:hover .nav-item::after { right: 12px; left: 44px; }

.sidebar-footer { padding: 7px; }
.sidebar-footer .user-info { min-height: 48px; padding: 7px; justify-content: center; border-radius: 3px; }
.sidebar-footer .user-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; }
.sidebar:hover .sidebar-footer .user-info { justify-content: flex-start; }
.sidebar:hover .sidebar-footer .user-info > div:not(.user-avatar) { display: block; min-width: 0; margin-left: 9px; }

.main-content { margin-left: var(--director-offset); }
.main-content::after { left: var(--director-offset); background: linear-gradient(to bottom, transparent, rgba(201, 255, 74, 0.18), transparent); }

/* Unframed command header */
.page-header {
  top: 0;
  min-height: 92px;
  margin: 0;
  padding: 24px 30px 14px;
  overflow: visible;
  background: rgba(7, 8, 7, 0.88);
  border: 0;
  border-bottom: 1px solid rgba(193, 201, 196, 0.12);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(22px);
}
.page-header::after {
  right: auto;
  left: 30px;
  width: 92px;
  background: linear-gradient(90deg, #c9ff4a, #79cfff);
  box-shadow: 0 0 12px rgba(201, 255, 74, 0.2);
}
.page-title { gap: 9px; font-size: 25px; font-weight: 720; }
.page-title::before { width: 18px; height: 2px; background: #c9ff4a; box-shadow: 0 0 12px rgba(201, 255, 74, 0.3); }
.page-title i[data-lucide] { color: #c9ff4a; filter: none; }
.page-subtitle { padding-left: 27px; color: #777f7a; font-size: 11px; }
.page-body { padding: 28px 30px 48px; }

/* Continuous instrument surfaces */
.card,
.pricing-card,
.chart-container,
.table-container {
  background: #121413;
  border-color: #292d2a;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 16px 40px rgba(0, 0, 0, 0.14);
}
.card:hover { border-color: #454b47; }
.card-title { color: #e9ece9; font-size: 13px; }

.btn { border-radius: 3px; }
.btn-primary {
  color: #11150a;
  background: #c9ff4a;
  border-color: #dfff92;
  box-shadow: 0 7px 24px rgba(201, 255, 74, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.54);
}
.btn-primary::before {
  background: linear-gradient(90deg, transparent 8%, #ffffff 32%, #79cfff 50%, #c9ff4a 70%, transparent 92%);
  background-size: 240% 100%;
}
.btn-primary:hover {
  color: #0d1108;
  background: #dcff83;
  border-color: #efffc7;
  box-shadow: 0 0 0 1px rgba(201, 255, 74, 0.32), 0 0 24px rgba(201, 255, 74, 0.16), 0 12px 28px rgba(0, 0, 0, 0.28);
}
.btn-secondary,
.tool-btn,
.icon-btn {
  color: #bec4c0;
  background: #141715;
  border-color: #303532;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.btn-secondary:hover,
.tool-btn:hover,
.icon-btn:hover { background: #1b1f1c; border-color: #59615c; box-shadow: none; }
#genBtn,
.dashboard-header .btn-primary,
.landing-hero .btn-primary { animation: signature-command-pulse 3.2s ease-in-out infinite; }

.form-control,
.form-control-static {
  background: #0c0e0d;
  border-color: #343936;
  border-radius: 3px;
  box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.22);
}
.form-control:focus {
  border-color: #c9ff4a;
  box-shadow: 0 0 0 2px rgba(201, 255, 74, 0.08);
}

/* Dashboard reads as one control surface */
.dashboard-stats {
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  background: #2b2f2c;
  border: 1px solid #2b2f2c;
  border-radius: 4px;
}
.dashboard-stats .stat-card,
.dashboard-stats .stat-card[style] {
  margin: 0;
  background: #111312 !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none;
}
.dashboard-stats .stat-card:first-child {
  background: linear-gradient(112deg, rgba(201, 255, 74, 0.14), rgba(17, 19, 18, 0.98) 54%) !important;
}
.dashboard-stats .stat-card::after { background: currentColor; opacity: 0.45; }
.dashboard-stats .stat-card:nth-child(1) { color: #c9ff4a; }
.dashboard-stats .stat-card:nth-child(2) { color: #79cfff; }
.dashboard-stats .stat-card:nth-child(3) { color: #8be8ae; }
.dashboard-stats .stat-card:nth-child(4) { color: #ff756b; }
.dashboard-stats .stat-card:hover { transform: none; background: #181c19 !important; box-shadow: none; }
.dashboard-grid { gap: 44px; }
.quick-action-icon { border-radius: 3px; }
.dashboard-tip { background: rgba(240, 198, 109, 0.045); border-radius: 0 3px 3px 0; }

/* Generation canvas */
.gen-panel > .card {
  border-left-color: #c9ff4a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}
.gen-result > .card:first-child {
  background-color: #0a0c0b;
  background-image:
    linear-gradient(rgba(218, 224, 220, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218, 224, 220, 0.028) 1px, transparent 1px);
  border-color: #303532;
  border-radius: 4px;
}
.gen-result > .card:first-child::before {
  background:
    linear-gradient(#79cfff, #79cfff) left 16px top 16px / 32px 1px no-repeat,
    linear-gradient(#79cfff, #79cfff) left 16px top 16px / 1px 32px no-repeat,
    linear-gradient(#c9ff4a, #c9ff4a) right 16px bottom 16px / 32px 1px no-repeat,
    linear-gradient(#c9ff4a, #c9ff4a) right 16px bottom 16px / 1px 32px no-repeat;
  box-shadow: none;
}
.upload-zone { background: #0c0e0d; border-color: #414743; border-radius: 3px; }
.upload-zone:hover { border-color: #c9ff4a; box-shadow: inset 0 0 0 1px rgba(201, 255, 74, 0.08); }
.gen-action-bar { background: rgba(16, 19, 17, 0.96); }
.history-card { border-radius: 3px !important; }

/* Operational pages */
.tab-bar,
.admin-tabs { background: #0c0e0d; border-color: #2c302d; border-radius: 3px; }
.tab-btn { border-radius: 2px; }
.tab-btn.active {
  color: #ddff8b;
  background: #1a1f18;
  border-color: #c9ff4a;
  box-shadow: inset 0 -1px 0 #c9ff4a;
  text-shadow: none;
}
table thead { background: #0d0f0e; }
table tbody tr:hover { background: linear-gradient(90deg, rgba(201, 255, 74, 0.04), transparent 72%); }
.pricing-card { border-radius: 4px; }
.pricing-card:nth-of-type(3n + 1) { border-left-color: #c9ff4a; }
.pricing-card:nth-of-type(3n + 2) { border-left-color: #79cfff; }
.pricing-card:nth-of-type(3n) { border-left-color: #f0c66d; }
#balanceDisplay { color: #c9ff4a !important; text-shadow: 0 0 22px rgba(201, 255, 74, 0.12); }
.card[style*="rgba(124,58,237"] {
  background: linear-gradient(110deg, rgba(201, 255, 74, 0.09), rgba(18, 20, 19, 0.98) 52%) !important;
  border-color: #373d39 !important;
}
.modal-card,
.announcement-modal .announcement-content { border-radius: 4px !important; }

/* Authentication */
.auth-page {
  background-color: #070807;
  background-image:
    linear-gradient(rgba(218, 224, 220, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218, 224, 220, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
}
.auth-page::after { color: rgba(243, 245, 242, 0.028); font-size: 112px; }
.auth-card {
  background: rgba(14, 16, 15, 0.96);
  border: 1px solid #303532;
  border-left: 3px solid #c9ff4a;
  border-radius: 4px;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.54);
}
.auth-card::after { background: linear-gradient(90deg, transparent, #ffffff, #c9ff4a, transparent); }

/* Editorial landing stage */
body.landing-page { background: #070807; }
.landing-nav {
  height: 72px;
  background: rgba(7, 8, 7, 0.76);
  border-bottom-color: rgba(223, 229, 225, 0.14);
  box-shadow: none;
}
.landing-nav-inner { width: min(1360px, calc(100% - 64px)); }
.landing-brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
.landing-nav-links a { color: #858c88; }
.landing-nav-links a::after { bottom: -9px; background: #c9ff4a; }

.landing-hero {
  height: 88vh;
  min-height: 720px;
  max-height: 900px;
  background-position: 54% center;
  border-bottom-color: #292d2a;
  animation: signature-hero-drift 20s ease-in-out infinite alternate;
}
.landing-hero::before {
  background:
    linear-gradient(90deg, rgba(4, 5, 4, 0.98) 0%, rgba(5, 6, 5, 0.92) 37%, rgba(5, 6, 5, 0.52) 67%, rgba(5, 6, 5, 0.2) 100%),
    linear-gradient(to top, rgba(4, 5, 4, 0.88), transparent 54%);
}
.landing-hero::after {
  width: 24%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.08), rgba(201, 255, 74, 0.025), transparent);
}
.landing-hero-inner {
  width: min(1360px, calc(100% - 64px));
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 92px;
  padding-top: 140px;
  padding-bottom: 128px;
}
.landing-hero-copy::before { background: linear-gradient(to bottom, transparent, #f3f5f2 18%, #c9ff4a 72%, transparent); box-shadow: none; }
.landing-kicker { color: #a2a9a4; font-size: 11px; }
.landing-kicker-dot { background: #c9ff4a; box-shadow: 0 0 0 4px rgba(201, 255, 74, 0.08), 0 0 18px rgba(201, 255, 74, 0.28); }
.landing-hero h1 { max-width: 820px; font-size: 92px; font-weight: 720; line-height: 0.94; }
.landing-hero h1 span { color: transparent; -webkit-text-stroke: 1px rgba(222, 255, 142, 0.92); text-shadow: none; }
.landing-hero-lead { color: #aab1ad; font-size: 16px; }
.landing-proof { border-top-color: rgba(223, 229, 225, 0.16); }

.landing-signal-panel {
  background: rgba(8, 9, 8, 0.72);
  border-top-color: #f3f5f2;
  border-bottom-color: #c9ff4a;
  backdrop-filter: blur(16px);
}
.signal-panel-head,
.signal-row,
.signal-panel-foot { border-color: #292d2a; }
.signal-live { color: #d9ff7f; }
.signal-live::before { background: #c9ff4a; box-shadow: 0 0 12px rgba(201, 255, 74, 0.6); }
.signal-panel-foot strong { color: #f0c66d; }

.landing-model-ticker {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  height: 52px;
  overflow: hidden;
  background: rgba(7, 8, 7, 0.86);
  border-top: 1px solid rgba(223, 229, 225, 0.14);
  backdrop-filter: blur(16px);
}
.landing-model-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  animation: signature-ticker 24s linear infinite;
}
.landing-model-ticker span {
  display: inline-flex;
  align-items: center;
  padding: 0 30px;
  color: #9ca39f;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.landing-model-ticker .ticker-signal {
  display: block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  padding: 0;
  border-radius: 50%;
  background: #c9ff4a;
  box-shadow: 0 0 10px rgba(201, 255, 74, 0.5);
}

.landing-section { background: #f0f2ef; color: #101210; }
.landing-section-inner { width: min(1360px, calc(100% - 64px)); }
.landing-eyebrow { color: #5a720f; }
.landing-section h2 { color: #101210; font-size: 42px; }
.capability-grid { background: #c9ceca; border-color: #c9ceca; border-radius: 4px; }
.capability-card { background: #f7f8f6; }
.capability-card:hover { background: #ffffff; box-shadow: none; }
.capability-card::before { color: rgba(16, 18, 16, 0.1); }
.capability-card::after { background: #c9ff4a; }
.capability-card:nth-child(2)::after { background: #f0c66d; }
.capability-card:nth-child(3)::after { background: #79cfff; }
.capability-icon { border-radius: 3px; background: #e8f5c9; color: #4d650c; }
.model-section { background: #0a0c0b; }
.model-list { border-top-color: #303532; }
.model-row { border-bottom-color: #303532; }
.model-row:hover { background: rgba(201, 255, 74, 0.035); }
.landing-cta { background: #eef0ed; }
.landing-footer { background: #070807; }

@keyframes signature-command-pulse {
  0%, 100% { box-shadow: 0 7px 24px rgba(201, 255, 74, 0.1); }
  50% { box-shadow: 0 0 0 1px rgba(201, 255, 74, 0.26), 0 0 22px rgba(201, 255, 74, 0.14); }
}
@keyframes signature-hero-drift { from { background-position: 51% center; } to { background-position: 57% center; } }
@keyframes signature-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 1100px) {
  .landing-hero-inner { grid-template-columns: minmax(0, 1fr) 330px; gap: 50px; }
  .landing-hero h1 { font-size: 74px; }
}

@media (max-width: 900px) {
  .sidebar { width: var(--director-rail); }
  .sidebar:hover { width: 196px; }
  .main-content { margin-left: var(--director-offset); }
  .main-content::after { left: var(--director-offset); }
  .landing-hero-inner { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 62px; }
}

@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  .page-header {
    top: 56px;
    min-height: 78px;
    margin: 0;
    padding: 17px 16px 12px;
  }
  .page-header::after { left: 16px; width: 72px; }
  .page-title { font-size: 20px; }
  .page-subtitle { padding-left: 27px; }
  .page-body { padding: 20px 16px 36px; }
  .mobile-header { background: rgba(7, 8, 7, 0.94); border-bottom-color: #292d2a; }
  .bottom-nav { background: rgba(10, 12, 11, 0.96); border-color: #303532; border-radius: 4px; }
  .bottom-nav-item.active { color: #d9ff7f; background: linear-gradient(to top, rgba(201, 255, 74, 0.08), transparent 74%); }
  .bottom-nav-item.active::after { background: #c9ff4a; box-shadow: 0 0 10px rgba(201, 255, 74, 0.45); }
  .gen-action-bar { border-color: rgba(201, 255, 74, 0.24); border-radius: 4px; }
  .landing-nav-inner,
  .landing-hero-inner,
  .landing-section-inner { width: min(100% - 32px, 1360px); }
  .landing-hero { min-height: 640px; max-height: 760px; }
  .landing-hero-inner { padding-top: 116px; padding-bottom: 92px; }
  .landing-hero h1 { font-size: 50px; }
  .landing-model-ticker { height: 44px; }
  .landing-model-ticker span { padding: 0 20px; }
  .landing-section h2 { font-size: 31px; }
}

@media (max-width: 430px) {
  .landing-hero h1 { font-size: 42px; }
  .landing-hero-inner { padding-top: 104px; }
}

@media (max-height: 700px) {
  .landing-hero {
    height: calc(100svh - 28px);
    min-height: 520px;
    max-height: 640px;
  }
  .landing-hero-inner { padding-top: 94px; padding-bottom: 78px; }
}

@media (max-width: 430px) and (max-height: 700px) {
  .landing-hero-inner { padding-top: 88px; padding-bottom: 70px; }
  .landing-proof { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition-duration: 0.01ms; }
  .landing-model-ticker-track { animation: none; }
}
