/* ============================================================
   NYX — design system
   ============================================================
   Light theme. Strict monochrome: white, black, grays only.
   Typography: Lato. Tone: elegant, serious, refined.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

:root {
  /* Monochrome palette — LIGHT */
  --nyx-bg:         #ffffff;
  --nyx-bg-subtle:  #fafafa;
  --nyx-surface:    #ffffff;
  --nyx-surface-2:  #f5f5f5;
  --nyx-surface-3:  #ebebeb;
  --nyx-border:     #e5e5e5;
  --nyx-border-2:   #d0d0d0;
  --nyx-text:       #0a0a0a;
  --nyx-text-2:     #2a2a2a;
  --nyx-muted:      #707070;
  --nyx-subtle:     #9a9a9a;
  --nyx-dim:        #c0c0c0;

  --nyx-font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nyx-font-mono: ui-monospace, 'SF Mono', 'Menlo', monospace;

  --nyx-radius: 4px;
  --nyx-radius-lg: 8px;

  --nyx-t: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadow for elevation — very subtle on light bg */
  --nyx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --nyx-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure the HTML `hidden` attribute always wins over component display rules. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--nyx-bg);
  color: var(--nyx-text);
  font-family: var(--nyx-font);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ====== Landing page ====== */
.nyx-landing {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: 24px;
  background: var(--nyx-bg);
}
.nyx-landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nyx-landing-card {
  max-width: 480px;
  text-align: center;
  padding: 48px 32px;
}
.nyx-landing-footer {
  text-align: center;
  padding-top: 16px;
}

/* Big logo hero — scales nicely across screens */
.nyx-hero-logo {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .nyx-hero-logo { max-width: 260px; }
}

.nyx-wordmark {
  font-size: 42px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--nyx-text);
  text-transform: uppercase;
}

.nyx-tagline {
  color: var(--nyx-muted);
  font-style: italic;
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 0.03em;
  font-weight: 300;
}

.nyx-muted { color: var(--nyx-muted); }
.nyx-subtle { color: var(--nyx-subtle); }
.nyx-small { font-size: 13px; }
.nyx-tiny { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

.nyx-mt-sm { margin-top: 8px; }
.nyx-mt-md { margin-top: 16px; }
.nyx-mt-lg { margin-top: 24px; }
.nyx-mt-xl { margin-top: 40px; }
.nyx-mt-xxl { margin-top: 56px; }

/* Thin horizontal rule */
.nyx-rule {
  border: 0;
  border-top: 1px solid var(--nyx-border);
  margin: 24px 0;
}
.nyx-rule-sm {
  width: 40px;
  margin: 16px auto;
  border: 0;
  border-top: 1px solid var(--nyx-border-2);
}

/* ====== Buttons ====== */
.nyx-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--nyx-text);
  border-radius: var(--nyx-radius);
  background: transparent;
  color: var(--nyx-text);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--nyx-t), color var(--nyx-t), transform 80ms ease;
  min-height: 44px;
  font-family: var(--nyx-font);
}
.nyx-button:hover { background: var(--nyx-surface-2); }
.nyx-button:active { transform: translateY(1px); }
.nyx-button:disabled { opacity: 0.5; cursor: not-allowed; }

.nyx-button-primary {
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-color: var(--nyx-text);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  padding: 14px 32px;
}
.nyx-button-primary:hover {
  background: var(--nyx-text-2);
  border-color: var(--nyx-text-2);
  color: var(--nyx-bg);
}

.nyx-button-ghost {
  background: transparent;
  border-color: var(--nyx-border-2);
}

.nyx-button-danger {
  color: #a04040;
  border-color: #d0a0a0;
}
.nyx-button-danger:hover { background: #faf0f0; }

/* ====== Inputs ====== */
.nyx-input, .nyx-select, .nyx-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--nyx-surface);
  color: var(--nyx-text);
  border: 1px solid var(--nyx-border-2);
  border-radius: var(--nyx-radius);
  font-size: 14px;
  font-family: var(--nyx-font);
  transition: border-color var(--nyx-t);
}
.nyx-input:focus, .nyx-select:focus, .nyx-textarea:focus {
  outline: none;
  border-color: var(--nyx-text);
}

.nyx-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  margin-bottom: 6px;
  font-weight: 700;
}

/* ====== Boot spinner ====== */
.nyx-boot {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--nyx-bg);
}
.nyx-boot-logo {
  width: 100px;
  height: auto;
  opacity: 0.9;
}

/* ====== App shell ====== */
.nyx-root {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--nyx-bg-subtle);
}

.nyx-sidebar {
  background: var(--nyx-surface);
  border-right: 1px solid var(--nyx-border);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  gap: 2px;
  position: sticky; top: 0;
  height: 100svh;
  overflow-y: auto;
}

.nyx-sidebar-header {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 10px 28px;
}

.nyx-sidebar-logo {
  width: 130px;
  height: auto;
}

.nyx-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--nyx-radius);
  color: var(--nyx-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--nyx-t), color var(--nyx-t);
  user-select: none;
}
.nyx-nav-item:hover { background: var(--nyx-surface-2); color: var(--nyx-text); }
.nyx-nav-item.active { background: var(--nyx-surface-2); color: var(--nyx-text); font-weight: 700; }
.nyx-nav-item.active::before {
  content: '';
  width: 2px;
  height: 16px;
  background: var(--nyx-text);
  margin-left: -14px;
  margin-right: 12px;
}

.nyx-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--nyx-border);
  font-size: 12px;
  color: var(--nyx-muted);
}

.nyx-user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--nyx-radius);
}

.nyx-user-chip-info { min-width: 0; flex: 1; }
.nyx-user-name { font-size: 13px; color: var(--nyx-text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nyx-user-role { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nyx-muted); font-weight: 700; }

.nyx-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ====== Main area ====== */
.nyx-main { padding: 40px 48px; min-width: 0; }

.nyx-page-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--nyx-border);
}

.nyx-page-title {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--nyx-text);
}

.nyx-page-subtitle { color: var(--nyx-muted); font-size: 13px; margin-top: 6px; }

.nyx-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nyx-muted);
  margin-bottom: 16px;
}

.nyx-card {
  background: var(--nyx-surface);
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius-lg);
  padding: 24px;
  box-shadow: var(--nyx-shadow-sm);
}

.nyx-grid { display: grid; gap: 16px; }
.nyx-grid-dashboard { grid-template-columns: 1fr 340px; align-items: start; }
.nyx-grid-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ====== Stats ====== */
.nyx-stat {
  display: flex; flex-direction: column;
  padding: 20px;
  background: var(--nyx-surface);
  border: 1px solid var(--nyx-border);
  border-radius: var(--nyx-radius);
}
.nyx-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--nyx-muted);
  font-weight: 700;
}
.nyx-stat-value {
  font-size: 36px;
  font-weight: 300;
  margin-top: 6px;
  letter-spacing: -0.01em;
  color: var(--nyx-text);
}

/* ====== Activity feed ====== */
.nyx-activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--nyx-border);
  font-size: 13px;
}
.nyx-activity-item:last-child { border-bottom: 0; }
.nyx-activity-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nyx-text);
  margin-top: 7px;
  flex-shrink: 0;
}
.nyx-activity-content { flex: 1; min-width: 0; }
.nyx-activity-text { color: var(--nyx-text-2); line-height: 1.5; }
.nyx-activity-time {
  color: var(--nyx-subtle);
  font-size: 11px;
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* ====== Table ====== */
.nyx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nyx-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--nyx-muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--nyx-border-2);
}
.nyx-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--nyx-border);
}
.nyx-table tr:hover td { background: var(--nyx-surface-2); }

/* ====== Badges ====== */
.nyx-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--nyx-surface-2);
  color: var(--nyx-text-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--nyx-border-2);
}
.nyx-badge-solid {
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-color: var(--nyx-text);
}

/* ====== Empty state ====== */
.nyx-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--nyx-muted);
  font-size: 14px;
}

/* ====== Toast ====== */
.nyx-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 14px 20px;
  background: var(--nyx-text);
  color: var(--nyx-bg);
  border-radius: var(--nyx-radius);
  font-size: 13px;
  z-index: 1000;
  box-shadow: var(--nyx-shadow-md);
}

/* ====== Mobile ====== */
@media (max-width: 800px) {
  .nyx-root { grid-template-columns: 1fr; }
  .nyx-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--nyx-border);
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 12px 16px;
    align-items: center;
  }
  .nyx-sidebar-header { padding: 4px 8px; flex-shrink: 0; }
  .nyx-sidebar-logo { width: 80px; }
  .nyx-sidebar-footer { display: none; }
  .nyx-nav-item { padding: 8px 12px; font-size: 13px; flex-shrink: 0; }
  .nyx-nav-item.active::before { display: none; }
  .nyx-main { padding: 24px 20px; }
  .nyx-grid-dashboard { grid-template-columns: 1fr; }
  .nyx-landing-card { padding: 32px 20px; }
  .nyx-page-title { font-size: 22px; }
}
