/* Shared application UI -------------------------------------------------- */
:root {
  --ui-bg: #f4f7fb;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8fafc;
  --ui-text: #172033;
  --ui-muted: #667085;
  --ui-border: #e3e8ef;
  --ui-primary: #2563eb;
  --ui-primary-dark: #1d4ed8;
  --ui-nav: #111827;
  --ui-success: #16865c;
  --ui-warning: #b45309;
  --ui-danger: #dc2626;
  --ui-radius: 12px;
  --ui-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

html { color-scheme: light; }

body.site-page {
  min-height: 100vh;
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.site-page nav {
  height: 58px;
  line-height: 58px;
  background: rgba(17, 24, 39, .97) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: none;
}

.site-page nav .nav-wrapper {
  width: 100%;
  max-width: none;
  min-height: 58px;
  padding: 0 20px;
  box-sizing: border-box;
}

.site-page nav .brand-logo,
.site-page nav .brand-logo.center,
.site-page nav .brand-center {
  left: 20px;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 58px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.site-page nav .brand-logo i {
  margin: 0;
  color: #7dd3fc;
  font-size: 22px;
}

.site-page nav ul a {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 58px;
  padding: 0 13px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
}

.site-page nav ul a:hover,
.site-page nav li.active a,
.site-page nav a.active {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.site-page nav ul a i.material-icons.left {
  margin: 0;
  font-size: 18px;
}

.site-page main.container {
  width: 100%;
  max-width: none;
  padding: 24px 20px 32px;
  box-sizing: border-box;
}

.site-page main.container > .section { padding: 0; }

.site-page h4,
.site-page h5,
.site-page h6 {
  color: var(--ui-text);
  font-weight: 700;
  letter-spacing: -.025em;
}

.site-page h4 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
.site-page h5 { font-size: 1.35rem; }
.site-page h6 { font-size: 1rem; }
.site-page p { line-height: 1.6; }
.site-page .grey-text.text-darken-1 { color: var(--ui-muted) !important; }

.site-page .card {
  margin: 0 0 16px;
  overflow: hidden;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

.site-page .card .card-content { padding: 20px; }
.site-page .card .card-content .card-title { margin-bottom: 6px; font-size: 17px; font-weight: 700; }
.site-page .card .card-action { padding: 12px 20px; background: var(--ui-surface-soft); border-color: var(--ui-border); }
.site-page .card .card-action a:not(.btn):not(.btn-large):not(.btn-small) { margin-right: 0; color: var(--ui-primary); }

.site-page .toolbar {
  min-height: 48px;
  margin-bottom: 14px;
}

.site-page .toolbar h5 { margin: 0; }
.site-page .toolbar p { font-size: 13px; }

.site-page .btn,
.site-page .btn-small,
.site-page .btn-large {
  background: var(--ui-primary) !important;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.site-page .btn { height: 38px; padding: 0 16px; line-height: 38px; }
.site-page .btn-small { height: 32px; padding: 0 12px; line-height: 32px; }
.site-page .btn:hover,
.site-page .btn-small:hover,
.site-page .btn-large:hover { background: var(--ui-primary-dark) !important; box-shadow: 0 4px 10px rgba(37, 99, 235, .18); }
.site-page .btn.grey,
.site-page .btn.blue-grey { background: #475467 !important; }
.site-page .btn.green { background: var(--ui-success) !important; }
.site-page .btn.orange { background: var(--ui-warning) !important; }
.site-page .btn.red { background: var(--ui-danger) !important; }
.site-page .btn.disabled,
.site-page .btn-small.disabled { background: #e4e7ec !important; color: #98a2b3 !important; }
.site-page .btn-flat { border-radius: 8px; color: #475467 !important; font-weight: 650; letter-spacing: 0; text-transform: none; }
.site-page .btn i,
.site-page .btn-small i { font-size: 18px; }

.site-page .input-field { margin-top: 1.15rem; margin-bottom: .75rem; }
.site-page .input-field input:not([type]),
.site-page .input-field input[type=text]:not(.browser-default),
.site-page .input-field input[type=password]:not(.browser-default),
.site-page .input-field input[type=email]:not(.browser-default),
.site-page .input-field input[type=date]:not(.browser-default),
.site-page .input-field input[type=datetime-local]:not(.browser-default),
.site-page textarea.materialize-textarea,
.site-page .select-wrapper input.select-dropdown {
  height: 40px;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #d0d5dd !important;
  border-radius: 8px;
  box-shadow: none !important;
  color: var(--ui-text);
  font-size: 14px;
}

.site-page textarea.materialize-textarea { min-height: 92px; padding-top: 10px; }
.site-page .input-field input:focus,
.site-page textarea.materialize-textarea:focus,
.site-page .select-wrapper input.select-dropdown:focus {
  border-color: var(--ui-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
}

.site-page .input-field > label {
  left: .75rem;
  color: var(--ui-muted);
}

.site-page .input-field > label.active {
  transform: translateY(-17px) scale(.82);
  transform-origin: 0 0;
  padding: 0 4px;
  background: var(--ui-surface);
  color: #475467 !important;
}

.site-page table { font-size: 13px; }
.site-page table th {
  height: 42px;
  padding: 10px 12px;
  background: var(--ui-surface-soft) !important;
  border-bottom: 1px solid var(--ui-border);
  color: #475467;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.site-page table td { padding: 11px 12px; border-bottom: 1px solid #edf0f4; }
.site-page table.striped > tbody > tr:nth-child(odd) { background: #fbfcfe; }
.site-page table tbody tr:hover { background: #f5f8fc; }

.site-page .chip {
  height: 26px;
  line-height: 26px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-soft);
  color: #475467;
  font-size: 12px;
}

.site-page .modal {
  max-height: 88%;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .24);
}
.site-page .modal .modal-content { padding: 22px 24px; }
.site-page .modal .modal-footer { height: auto; min-height: 58px; padding: 10px 16px; border-top: 1px solid var(--ui-border); }
.site-page .dropdown-content { border: 1px solid var(--ui-border); border-radius: 10px; box-shadow: var(--ui-shadow); }
.site-page .dropdown-content li > a,
.site-page .dropdown-content li > span { color: var(--ui-text); font-size: 13px; }

.site-page .divider { background: var(--ui-border); }
.site-page .readonly-pill { background: #eff6ff; color: #1e40af; }

/* Landing */
.site-page .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  align-items: center;
  gap: clamp(36px, 7vw, 96px);
  min-height: calc(100vh - 114px);
  padding: 32px 0;
}
.site-page .hero-copy { max-width: 680px; }
.site-page .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--ui-primary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.site-page .hero h4 { margin: 0 0 18px; }
.site-page .hero-copy > p { max-width: 620px; margin: 0; color: var(--ui-muted); font-size: 17px; }
.site-page .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.site-page .hero-panel { padding: 18px; }
.site-page .workflow-preview { display: grid; gap: 10px; }
.site-page .workflow-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface-soft); }
.site-page .workflow-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: #e0f2fe; color: #0369a1; }
.site-page .workflow-icon .material-icons { font-size: 20px; }
.site-page .workflow-item strong { display: block; font-size: 13px; }
.site-page .workflow-item small { color: var(--ui-muted); }
.site-page .workflow-item > .material-icons { color: #98a2b3; font-size: 18px; }

/* Authentication */
.site-page.auth-page main.container { display: grid; place-items: center; min-height: calc(100vh - 58px); padding: 28px 20px; }
.site-page .auth-card { width: min(100%, 420px); margin: 0; }
.site-page .auth-card .card-content { padding: 30px; }
.site-page .auth-card .card-title { margin-bottom: 22px; }
.site-page .auth-card form.col { padding: 0; }
.site-page .auth-card .row { margin-bottom: 4px; }
.site-page .auth-card button[type=submit] { width: 100%; margin-top: 4px; }
.site-page .auth-card .auth-field { margin: 8px 0 12px; }
.site-page .auth-card .auth-field > label {
  position: static;
  display: block;
  width: auto;
  margin: 0 0 6px;
  padding: 0;
  transform: none !important;
  color: #344054 !important;
  font-size: 12px;
  font-weight: 700;
}
.site-page .auth-card .auth-field > input {
  height: 42px;
  padding: 0 12px;
  line-height: 42px;
}
.site-page .auth-card .auth-field > input::placeholder {
  color: #98a2b3;
  opacity: 1;
}

/* Data-heavy views */
.site-page .projects-table-shell { border-radius: var(--ui-radius); }
.site-page .action-icon-btn { border-radius: 8px; background: #f8fafc !important; color: #344054 !important; border: 1px solid var(--ui-border); }
.site-page .action-icon-btn:hover { background: #eef2f6 !important; box-shadow: none; }

@media (max-width: 760px) {
  .site-page nav .nav-wrapper,
  .site-page main.container { width: 100%; padding-left: 12px; padding-right: 12px; }
  .site-page nav ul a { width: 44px; padding: 0; justify-content: center; overflow: hidden; font-size: 0; }
  .site-page nav ul a i.material-icons.left { font-size: 20px; }
  .site-page nav .brand-logo,
  .site-page nav .brand-logo.center,
  .site-page nav .brand-center { left: 12px; font-size: 15px; }
  .site-page main.container { padding-top: 18px; }
  .site-page .hero { grid-template-columns: 1fr; min-height: auto; padding: 54px 0; }
  .site-page .hero-panel { display: none; }
  .site-page .toolbar { align-items: flex-start; }
  .site-page .toolbar > * { width: 100%; }
  .site-page .filters { width: 100%; }
  .site-page .filters .input-field { flex: 1; }
  .site-page .card .card-content { padding: 16px; }
  .site-page table.responsive-table tbody { overflow-x: auto; }
}

@media (max-width: 480px) {
  .site-page nav .brand-logo,
  .site-page nav .brand-logo.center,
  .site-page nav .brand-center { width: 30px; overflow: hidden; font-size: 0; }
  .site-page nav .brand-logo i { flex: 0 0 22px; font-size: 22px; }
  .site-page .hero-actions .btn { width: 100%; text-align: center; }
  .site-page .modal { width: calc(100% - 20px); }
}
html.admin-auth-pending body { visibility: hidden; }

.site-page nav .account-dropdown-trigger { display: flex; align-items: center; }
.site-page nav .account-dropdown-trigger .account-dropdown-arrow { margin: 0 0 0 2px; font-size: 20px; }
.dropdown-content.account-dropdown { min-width: 270px; border-radius: 9px; overflow: hidden; box-shadow: 0 12px 30px rgba(15, 23, 42, .22); }
.dropdown-content.account-dropdown li.account-dropdown-identity { min-height: 0; height: auto; cursor: default; }
.dropdown-content.account-dropdown li.account-dropdown-identity > span { display: block; padding: 14px 18px 13px; color: #1f2937; line-height: 1.35; }
.dropdown-content.account-dropdown li.account-dropdown-identity strong,
.dropdown-content.account-dropdown li.account-dropdown-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-content.account-dropdown li.account-dropdown-identity strong { font-size: 14px; }
.dropdown-content.account-dropdown li.account-dropdown-identity small { margin-top: 3px; color: #64748b; font-size: 12px; }
.dropdown-content.account-dropdown li.account-dropdown-identity .account-role { margin-top: 6px; color: #475569; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.dropdown-content.account-dropdown li > a { display: flex; height: 46px; align-items: center; gap: 11px; padding: 0 18px; color: #334155; line-height: 1; }
.dropdown-content.account-dropdown li > a > .material-icons { display: inline-flex; flex: 0 0 20px; align-items: center; justify-content: center; margin: 0; color: #64748b; font-size: 20px; line-height: 1; }

/* Compact application navigation for narrow portrait screens. */
@media (max-width: 760px) {
  .site-page nav,
  .site-page nav .nav-wrapper {
    height: 58px;
    min-height: 58px;
  }

  .site-page nav .nav-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .site-page nav .brand-logo,
  .site-page nav .brand-logo.center,
  .site-page nav .brand-center {
    position: static;
    min-width: 0;
    max-width: calc(100% - 96px);
    flex: 0 1 auto;
    transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-page nav ul.right {
    display: flex;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
  }

  .site-page nav ul.right > li { flex: 0 0 auto; }

  .site-page nav ul.right > li > a {
    width: 42px;
    min-width: 42px;
    padding: 0;
    justify-content: center;
    gap: 0;
    font-size: 0;
  }

  .site-page nav ul.right > li > a i.material-icons.left {
    margin: 0;
    font-size: 20px;
  }

  .site-page nav .account-dropdown-trigger > span,
  .site-page nav .account-dropdown-trigger .account-dropdown-arrow {
    display: none;
  }

  .dropdown-content.account-dropdown {
    width: min(270px, calc(100vw - 16px)) !important;
    min-width: 0;
    max-width: calc(100vw - 16px);
  }
}

@media (max-width: 400px) {
  .site-page nav .brand-logo,
  .site-page nav .brand-logo.center,
  .site-page nav .brand-center {
    width: 34px;
    max-width: 34px;
    flex-basis: 34px;
    font-size: 0;
  }

  .site-page nav .brand-logo i { flex: 0 0 22px; }
}
