:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eeeeec;
  color: #191919;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #eeeeec; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 248px;
  flex-direction: column;
  border-right: 1px solid #d5d5d1;
  background: #171717;
  color: #f4f4f2;
  transition: width 180ms ease;
}
.brand { display: flex; align-items: center; gap: 12px; height: 82px; padding: 0 20px; border-bottom: 1px solid #303030; overflow: hidden; }
.brand-mark { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border: 1px solid #5b5b5b; border-radius: 10px; font-weight: 800; }
.brand-copy { display: flex; flex-direction: column; white-space: nowrap; }
.brand-copy strong { font-size: 15px; letter-spacing: .02em; }
.brand-copy span { color: #929292; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.nav-list { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 24px 14px; }
.nav-item, .collapse-button { display: flex; align-items: center; gap: 13px; min-height: 44px; border: 0; border-radius: 9px; color: #a8a8a5; background: transparent; text-decoration: none; cursor: pointer; }
.nav-item { padding: 0 13px; }
.nav-item:hover, .collapse-button:hover { color: #fff; background: #292929; }
.nav-item.active { color: #fff; background: #303030; }
.nav-glyph { width: 20px; flex: 0 0 20px; text-align: center; font-size: 18px; }
.nav-label { white-space: nowrap; overflow: hidden; }
.sidebar-footer { padding: 14px; border-top: 1px solid #303030; }
.collapse-button { width: 100%; padding: 0 13px; text-align: left; }
.collapse-icon { width: 20px; font-size: 25px; line-height: 1; transition: transform 180ms ease; }
.sidebar-collapsed .sidebar { width: 76px; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-label { display: none; }
.sidebar-collapsed .collapse-icon { transform: rotate(180deg); }
.sidebar-collapsed .main-content { margin-left: 76px; }

.main-content { margin-left: 248px; padding: 0 42px 32px; transition: margin-left 180ms ease; }
.topbar { display: flex; min-height: 108px; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #d5d5d1; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 21px; letter-spacing: -.025em; }
.eyebrow { display: block; margin-bottom: 7px; color: #777773; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.session-status { display: flex; align-items: center; gap: 18px; min-width: 260px; justify-content: flex-end; }
.session-copy { display: flex; flex-direction: column; text-align: right; }
.session-copy strong { font-size: 13px; }
.session-copy span { color: #777773; font-size: 11px; }

.hero-panel { display: grid; grid-template-columns: 1fr minmax(220px, 300px); gap: 28px; align-items: stretch; padding: 36px 0 26px; }
.hero-panel > div:first-child { min-height: 190px; padding: 34px; border-radius: 16px; background: #272727; color: #f5f5f3; }
.hero-panel h2 { max-width: 620px; margin-bottom: 12px; font-size: clamp(31px, 5vw, 54px); line-height: .98; letter-spacing: -.055em; }
.hero-panel p { max-width: 620px; margin-bottom: 0; color: #a9a9a6; line-height: 1.6; }
.metric-card { display: flex; min-height: 190px; flex-direction: column; justify-content: space-between; padding: 26px; border: 1px solid #d0d0cc; border-radius: 16px; background: #e3e3e0; }
.metric-card span, .metric-card small { color: #676763; }
.metric-card span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { font-size: 62px; line-height: 1; letter-spacing: -.07em; }
.metric-card small { font-size: 11px; }

.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.card { border: 1px solid #d0d0cc; border-radius: 14px; background: #f7f7f5; }
.auth-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; padding: 24px; }
.card-heading p { margin-bottom: 0; color: #6d6d69; font-size: 13px; line-height: 1.5; }
.stack-form, .user-form { display: grid; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; color: #555551; font-size: 11px; font-weight: 700; }
.field input, .field select { width: 100%; height: 42px; border: 1px solid #c8c8c3; border-radius: 8px; outline: none; background: #fff; color: #191919; padding: 0 12px; }
.field input:focus, .field select:focus { border-color: #555; box-shadow: 0 0 0 3px #ddddda; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 0 15px; font-size: 12px; font-weight: 750; cursor: pointer; }
.button-primary { background: #202020; color: #fff; }
.button-primary:hover { background: #000; }
.button-secondary { border-color: #bdbdb8; background: #e3e3df; color: #242424; }
.button-secondary:hover, .button-quiet:hover { background: #d7d7d3; }
.button-quiet { border-color: #d0d0cc; background: transparent; color: #4b4b48; }
.form-status { min-height: 16px; margin: 0; color: #6d6d69; font-size: 11px; line-height: 1.45; }

.users-section { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 18px; }
.user-form-card, .users-card { padding: 24px; }
.card-heading.compact { margin-bottom: 22px; }
.user-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-form .button { align-self: end; }
.form-status.wide { grid-column: 1 / -1; }
.row-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.row-heading h2 { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; border-bottom: 1px solid #cfcfca; color: #777773; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 14px 12px; border-bottom: 1px solid #e0e0dc; color: #555551; }
td:first-child { display: flex; flex-direction: column; }
td:first-child strong { color: #222; }
td:first-child span { color: #7c7c78; font-size: 11px; }
.empty-state { display: grid; min-height: 190px; place-items: center; border: 1px dashed #cacac5; border-radius: 10px; color: #777773; text-align: center; padding: 24px; }
.page-footer { padding: 26px 0 0; color: #898985; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 1120px) {
  .auth-card { grid-template-columns: 1fr; }
  .users-section { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { width: 76px; }
  .brand-copy, .nav-label { display: none; }
  .main-content, .sidebar-collapsed .main-content { margin-left: 76px; padding: 0 18px 24px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 24px 0; }
  .session-status { width: 100%; justify-content: space-between; }
  .session-copy { text-align: left; }
  .hero-panel, .auth-grid { grid-template-columns: 1fr; }
  .user-form { grid-template-columns: 1fr; }
  .form-status.wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Public home */
.landing-page { min-height: 100vh; background: #efefed; }
.landing-header {
  display: grid;
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  margin: 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid #d0d0cc;
}
.landing-brand { display: flex; align-items: center; gap: 10px; }
.landing-brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #191919; color: #fff; font-size: 13px; font-weight: 800; }
.landing-brand strong { font-size: 15px; letter-spacing: -.02em; }
.landing-links { display: flex; gap: 34px; }
.landing-links a { color: #62625e; font-size: 12px; font-weight: 650; text-decoration: none; }
.landing-links a:hover { color: #111; }
.landing-login-button { justify-self: end; border: 1px solid #252525; border-radius: 8px; padding: 10px 16px; color: #202020; font-size: 12px; font-weight: 750; text-decoration: none; }
.landing-login-button:hover { background: #202020; color: #fff; }
.landing-hero { display: grid; width: min(1180px, calc(100% - 48px)); min-height: 680px; margin: 0 auto; grid-template-columns: .92fr 1.08fr; gap: clamp(40px, 7vw, 100px); align-items: center; padding: 70px 0 88px; }
.hero-copy { position: relative; z-index: 1; }
.landing-eyebrow { display: block; margin-bottom: 24px; color: #73736f; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.landing-hero h1 { display: flex; margin-bottom: 28px; flex-direction: column; font-size: clamp(50px, 6.4vw, 86px); line-height: .91; letter-spacing: -.075em; }
.landing-hero .muted-line { color: #8d8d88; font-weight: 430; }
.landing-hero p { max-width: 510px; margin-bottom: 32px; color: #656561; font-size: 16px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.landing-cta { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; border-radius: 9px; padding: 0 20px; font-size: 12px; font-weight: 750; text-decoration: none; }
.landing-cta-primary { background: #1c1c1c; color: #fff; }
.landing-cta-primary:hover { background: #000; }
.landing-cta-secondary { border: 1px solid #c8c8c3; color: #4c4c48; }
.landing-cta-secondary:hover { border-color: #888883; }
.dashboard-preview { overflow: hidden; border: 1px solid #c6c6c2; border-radius: 18px; background: #dededb; box-shadow: 0 30px 80px rgba(20, 20, 20, .13); transform: rotate(1.5deg); }
.preview-bar { display: flex; height: 42px; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #c7c7c3; color: #777773; font-size: 8px; letter-spacing: .15em; }
.preview-dots { color: #989893; font-size: 7px; letter-spacing: 4px; }
.preview-body { display: grid; min-height: 390px; grid-template-columns: 74px 1fr; }
.preview-sidebar { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 20px 15px; background: #202020; }
.preview-logo { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #555; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 800; }
.preview-nav-line { width: 24px; height: 5px; border-radius: 5px; background: #4d4d4d; }
.preview-content { padding: 38px 30px; }
.preview-kicker { margin-bottom: 8px; color: #7c7c77; font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.preview-title { margin-bottom: 40px; color: #262626; font-size: clamp(18px, 2.2vw, 29px); font-weight: 800; letter-spacing: -.05em; }
.preview-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.preview-main-card, .preview-side-card { display: flex; min-height: 210px; flex-direction: column; padding: 18px; border: 1px solid #c6c6c1; border-radius: 11px; background: #ececea; }
.preview-main-card span, .preview-side-card span { color: #777773; font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.preview-main-card strong { margin: 16px 0 22px; font-size: 43px; letter-spacing: -.07em; }
.preview-side-card strong { margin: 16px 0 auto; font-size: 15px; }
.preview-chart { height: 54px; margin-top: auto; background: linear-gradient(135deg, transparent 0 22%, #aaa 22% 24%, transparent 24% 46%, #888 46% 48%, transparent 48% 63%, #555 63% 65%, transparent 65%); border-bottom: 1px solid #aaa; }
.preview-status { color: #686864; font-size: 8px; }
.landing-features { display: grid; width: min(1180px, calc(100% - 48px)); margin: 0 auto; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #cdcdc8; border-bottom: 1px solid #cdcdc8; }
.landing-feature { min-height: 260px; padding: 36px 34px; border-right: 1px solid #cdcdc8; }
.landing-feature:last-child { border-right: 0; }
.feature-index { color: #969691; font-family: ui-monospace, monospace; font-size: 10px; }
.landing-feature h3 { margin: 54px 0 12px; font-size: 19px; letter-spacing: -.025em; }
.landing-feature p { margin-bottom: 0; color: #6b6b67; font-size: 13px; line-height: 1.6; }
.landing-strip { display: flex; width: min(1180px, calc(100% - 48px)); min-height: 116px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 24px; color: #797975; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.landing-footer { display: grid; min-height: 130px; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: #1d1d1d; color: #f1f1ee; }
.landing-footer .landing-brand-mark { background: #eee; color: #191919; }
.landing-footer > span { color: #858581; font-size: 11px; }
.landing-footer > a { justify-self: end; color: #efefed; font-size: 12px; text-decoration: none; }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 90px; }
  .dashboard-preview { max-width: 660px; transform: none; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-feature { min-height: auto; border-right: 0; border-bottom: 1px solid #cdcdc8; }
  .landing-feature:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  .landing-header { width: min(100% - 32px, 1180px); grid-template-columns: 1fr auto; }
  .landing-links { display: none; }
  .landing-hero, .landing-features, .landing-strip { width: min(100% - 32px, 1180px); }
  .landing-hero { min-height: auto; gap: 56px; padding: 64px 0; }
  .landing-hero h1 { font-size: clamp(46px, 15vw, 68px); }
  .preview-body { min-height: 320px; grid-template-columns: 54px 1fr; }
  .preview-sidebar { padding: 15px 10px; }
  .preview-content { padding: 28px 18px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-side-card { display: none; }
  .landing-strip { flex-wrap: wrap; justify-content: center; padding: 32px 0; }
  .landing-footer { grid-template-columns: 1fr auto; gap: 18px; padding: 28px 20px; }
  .landing-footer > span { display: none; }
}

/* Authentication */
.login-page { min-height: 100vh; background: #e9e9e6; }
.login-header { display: flex; width: min(1180px, calc(100% - 48px)); min-height: 82px; margin: 0 auto; align-items: center; justify-content: space-between; border-bottom: 1px solid #cececa; }
.login-header .landing-brand { color: #191919; text-decoration: none; }
.login-back { color: #62625e; font-size: 12px; font-weight: 700; text-decoration: none; }
.login-back:hover { color: #111; }
.login-main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 72px 0; }
.login-intro { max-width: 670px; margin-bottom: 48px; }
.login-intro h1 { margin-bottom: 20px; font-size: clamp(42px, 6vw, 72px); line-height: .96; letter-spacing: -.065em; }
.login-intro p { max-width: 590px; margin-bottom: 0; color: #676763; font-size: 15px; line-height: 1.7; }
.login-grid { align-items: stretch; }
.login-grid .auth-card { background: #f4f4f1; }

@media (max-width: 760px) {
  .login-header, .login-main { width: min(100% - 32px, 1180px); }
  .login-main { padding: 54px 0; }
  .login-grid { grid-template-columns: 1fr; }
}

/* User management */
.manage-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 34px 0 24px; }
.manage-intro h2 { margin-bottom: 0; font-size: 30px; letter-spacing: -.045em; }
.manage-intro p { max-width: 530px; margin-bottom: 2px; color: #696965; font-size: 13px; line-height: 1.55; }
.user-management-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(440px, 1.2fr); gap: 18px; align-items: start; }
.manage-user-list, .user-editor { padding: 24px; }
.manage-user-list .row-heading p { margin: 4px 0 0; color: #7b7b77; font-size: 11px; }
.manage-user-rows { display: flex; max-height: 650px; flex-direction: column; gap: 7px; overflow: auto; padding-right: 3px; }
.manage-user-row { display: grid; width: 100%; min-height: 64px; grid-template-columns: 38px minmax(0, 1fr) auto 16px 18px; gap: 11px; align-items: center; border: 1px solid #dededa; border-radius: 9px; padding: 9px 11px; background: #efefec; color: #232323; text-align: left; cursor: pointer; }
.manage-user-row:hover, .manage-user-row:focus-visible { border-color: #aaa9a4; background: #e6e6e2; outline: none; }
.user-avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #2b2b2b; color: #fff; font-size: 12px; font-weight: 800; }
.manage-user-copy { display: flex; min-width: 0; flex-direction: column; }
.manage-user-copy strong, .manage-user-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-user-copy strong { font-size: 12px; }
.manage-user-copy span { color: #747470; font-size: 10px; }
.role-pill { border: 1px solid #c7c7c2; border-radius: 999px; padding: 4px 7px; color: #666662; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.status-dot { color: #aaa; font-size: 10px; }
.status-dot.active { color: #333; }
.row-arrow { color: #777; }
.empty-editor { min-height: 360px; align-content: center; text-align: center; }
.empty-editor p { max-width: 360px; margin: 0 auto; color: #73736f; font-size: 13px; line-height: 1.6; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.editor-heading p { margin: 0; }
.user-id { max-width: 170px; overflow: hidden; color: #969691; font-family: ui-monospace, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.editor-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.toggle-field { display: flex; min-height: 64px; align-items: center; gap: 11px; border: 1px solid #d3d3cf; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.toggle-field input { width: 16px; height: 16px; accent-color: #222; }
.toggle-field > div { display: flex; flex-direction: column; }
.toggle-field strong { font-size: 11px; }
.toggle-field span { color: #797975; font-size: 9px; }
.editor-form .form-status { align-self: center; }
.editor-divider { height: 1px; margin: 28px 0; background: #d6d6d1; }
.password-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.password-heading { grid-column: 1 / -1; }
.password-heading h3 { margin: 0 0 5px; font-size: 15px; }
.password-heading p { margin: 0; color: #767672; font-size: 11px; }
.password-form .form-status { align-self: center; }

@media (max-width: 1050px) {
  .user-management-grid { grid-template-columns: 1fr; }
  .manage-user-rows { max-height: 420px; }
}

@media (max-width: 650px) {
  .manage-intro { align-items: flex-start; flex-direction: column; }
  .editor-form, .password-form { grid-template-columns: 1fr; }
  .password-heading { grid-column: auto; }
  .manage-user-row { grid-template-columns: 38px minmax(0, 1fr) 14px 18px; }
  .role-pill { display: none; }
  .user-id { display: none; }
}
