:root {
  --bg: #07111c;
  --panel: rgba(9, 27, 43, 0.88);
  --panel-strong: rgba(12, 34, 54, 0.95);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef6fc;
  --muted: #a9bfd2;
  --gold: #f6b34f;
  --teal: #66d5c0;
  --danger: #ff7777;
  --radius: 24px;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 12%, rgba(246, 179, 79, 0.18), transparent 30%),
    radial-gradient(circle at 86% 10%, rgba(102, 213, 192, 0.15), transparent 24%),
    linear-gradient(180deg, #0c1b2b 0%, var(--bg) 48%, #030810 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.32;
}

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

button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #102030;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), #ffdf8a 60%, #f3a11d);
  cursor: pointer;
}

.secondary-button {
  min-height: 40px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Avenir Next Condensed", "Franklin Gothic Medium", sans-serif;
  letter-spacing: 0.01em;
}

.muted,
.server-note,
.hero-panel p,
.module-grid p,
.status-card dd {
  color: var(--muted);
  line-height: 1.62;
}

.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  z-index: 1;
}

.auth-card,
.hero-panel,
.planner-preview,
.module-grid article {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), rgba(4, 15, 25, 0.96));
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
  border-radius: var(--radius);
}

.auth-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(246, 179, 79, 0.7);
  box-shadow: 0 0 0 3px rgba(246, 179, 79, 0.12);
}

.alert {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #ffd6d6;
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.28);
}

.server-note {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.alert p {
  margin: 0;
}

.topbar,
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.topbar form {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.app-shell {
  display: grid;
  gap: 18px;
  padding-bottom: 48px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  padding: 28px;
  border-radius: 30px;
}

.hero-panel h2 {
  margin-bottom: 12px;
  max-width: 14ch;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.status-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.status-card dl {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.status-card div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.status-card dt {
  color: var(--text);
  font-weight: 800;
}

.status-card dd {
  margin: 0;
  text-align: right;
}

.planner-preview {
  overflow: hidden;
  padding: 22px;
  border-radius: 26px;
}

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.preview-head h2 {
  margin: 0;
  font-size: 2rem;
}

.preview-head span {
  color: var(--muted);
}

.grid-demo {
  display: grid;
  grid-template-columns: 140px repeat(14, minmax(38px, 1fr));
  min-width: 820px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.grid-demo > * {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.grid-demo strong:first-child,
.grid-demo span {
  justify-content: start;
  padding-left: 12px;
}

.grid-demo b {
  color: #102030;
}

.shift-s,
.shift-sr {
  background: rgba(180, 230, 224, 0.9);
}

.shift-f {
  background: rgba(249, 201, 226, 0.92);
}

.shift-x {
  background: rgba(248, 220, 135, 0.95);
}

.shift-db {
  background: rgba(238, 191, 143, 0.95);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.module-grid article {
  padding: 18px;
  border-radius: 22px;
}

.module-grid h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.module-grid p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .topbar,
  .topbar form {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .planner-preview {
    overflow-x: auto;
  }
}

body.app-page {
  color: #1e242b;
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 52%, #e5ebf3 100%);
  color-scheme: light;
}

body.app-page::before {
  display: none;
}

body.app-page button {
  color: inherit;
}

body.app-page .topbar,
body.app-page .app-shell {
  width: min(1180px, calc(100vw - 40px));
}

body.app-page .topbar {
  padding: 18px 0 12px;
}

body.app-page .topbar h1 {
  color: #171b21;
  font-family: "Avenir Next", system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
}

body.app-page .topbar p {
  margin: 4px 0 0;
  color: #667280;
  font-weight: 700;
}

body.app-page .topbar form {
  color: #667280;
}

body.app-page .secondary-button {
  color: #1e242b;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(28, 37, 48, 0.14);
  box-shadow: 0 4px 12px rgba(23, 31, 42, 0.08);
}

body.app-page .app-shell {
  gap: 18px;
  min-height: calc(100vh - 120px);
  padding-bottom: 24px;
}

.main-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.menu-tile {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 110px;
  padding: 0 16px;
  border: 1px solid rgba(27, 35, 45, 0.14);
  border-radius: 22px;
  color: #20262d;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(31, 42, 55, 0.12);
  text-decoration: none;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.menu-tile:hover,
.menu-tile:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(40, 105, 178, 0.34);
  box-shadow: 0 16px 30px rgba(31, 42, 55, 0.16);
  outline: none;
}

.menu-tile.is-disabled {
  cursor: default;
  opacity: 0.62;
  pointer-events: none;
}

.sf-symbol {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-right: 12px;
  place-items: center;
  border-radius: 12px;
  color: #f8fbff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(145deg, #2f6fae, #214c7d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.menu-tile strong {
  display: block;
  color: #20262d;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
}

.menu-tile small {
  display: block;
  margin-top: 6px;
  color: #6b7480;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
}

.menu-footer {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 24px;
  margin-top: auto;
  padding-top: 18px;
}

.events-panel {
  color: #20262d;
}

.events-panel h2 {
  margin: 0 0 8px;
  font-family: "Avenir Next", system-ui, sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
}

.event-list {
  border-top: 1px solid rgba(27, 35, 45, 0.16);
}

.event-row {
  display: grid;
  grid-template-columns: 86px 150px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: #2c333b;
  font-size: 0.93rem;
  font-weight: 650;
  background: rgba(105, 116, 128, 0.10);
}

.event-row:nth-child(even) {
  background: rgba(105, 116, 128, 0.18);
}

.event-row.is-today {
  border: 1px solid rgba(229, 138, 38, 0.72);
  border-radius: 6px;
  background: rgba(244, 161, 58, 0.28);
  font-weight: 800;
}

.event-row strong {
  min-width: 0;
  padding: 0 12px;
  border-left: 1px solid rgba(27, 35, 45, 0.16);
  border-right: 1px solid rgba(27, 35, 45, 0.16);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row em {
  min-width: 0;
  padding-left: 10px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-panel {
  display: grid;
  grid-template-columns: 180px 190px minmax(120px, 190px);
  align-items: end;
  justify-content: center;
  gap: 22px;
  color: #1f262d;
}

.clock-panel,
.brand-copy {
  text-align: center;
}

.clock-panel strong {
  display: block;
  font-size: 2.75rem;
  font-weight: 850;
  line-height: 1;
}

.clock-panel span,
.brand-copy span,
.brand-copy small {
  display: block;
  color: #64717f;
  font-weight: 700;
}

.clock-panel span {
  margin-top: 8px;
  font-size: 0.96rem;
}

.brand-copy strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.14;
}

.brand-copy span {
  margin-top: 4px;
  font-size: 0.86rem;
}

.brand-copy small {
  margin-top: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.brand-panel img {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
}

.link-button {
  display: inline-grid;
  min-height: 40px;
  padding: 0 18px;
  place-items: center;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.feature-shell {
  gap: 16px;
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
}

.feature-card {
  padding: 20px;
  border: 1px solid rgba(27, 35, 45, 0.14);
  border-radius: 22px;
  color: #20262d;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(31, 42, 55, 0.10);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-family: "Avenir Next", system-ui, sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0;
}

.section-head p {
  margin: 0;
  color: #667280;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.employee-form {
  display: grid;
  gap: 14px;
}

.feature-card label {
  color: #56616d;
}

.feature-card input,
.feature-card select,
.feature-card textarea {
  color: #20262d;
  background: rgba(248, 250, 252, 0.94);
  border-color: rgba(27, 35, 45, 0.16);
}

.feature-card select {
  appearance: auto;
}

.feature-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tabs a {
  display: inline-grid;
  min-height: 38px;
  padding: 0 14px;
  place-items: center;
  border: 1px solid rgba(27, 35, 45, 0.14);
  border-radius: 999px;
  color: #48515c;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  text-decoration: none;
}

.feature-tabs a.is-active {
  color: #f8fbff;
  background: linear-gradient(145deg, #2f6fae, #214c7d);
}

.form-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(27, 35, 45, 0.12);
  border-radius: 16px;
}

.form-section legend {
  padding: 0 6px;
  color: #20262d;
  font-weight: 850;
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: #20262d;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  accent-color: #2f6fae;
}

.contract-list {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  color: #667280;
  background: rgba(105, 116, 128, 0.10);
  font-size: 0.88rem;
  font-weight: 700;
}

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

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(35, 133, 99, 0.28);
  border-radius: 14px;
  color: #135f43;
  background: rgba(53, 180, 132, 0.14);
  font-weight: 800;
}

.feature-alert {
  margin-top: 0;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-content: center;
  gap: 6px;
  border: 1px dashed rgba(27, 35, 45, 0.18);
  border-radius: 16px;
  color: #667280;
  text-align: center;
}

.empty-state strong {
  color: #20262d;
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(27, 35, 45, 0.10);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #667280;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table td strong,
.data-table td small {
  display: block;
}

.data-table td small {
  margin-top: 3px;
  color: #667280;
}

.inline-form {
  margin: 0;
}

.pill {
  display: inline-grid;
  min-height: 24px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  color: #135f43;
  background: rgba(53, 180, 132, 0.16);
  font-size: 0.78rem;
  font-weight: 850;
}

.muted-inline {
  color: #8a949f;
}

.danger-button {
  color: #8f1d1d;
  background: rgba(202, 52, 52, 0.10);
  border-color: rgba(202, 52, 52, 0.20);
}

@media (max-width: 900px) {
  body.app-page .topbar,
  body.app-page .topbar form {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-menu,
  .menu-footer,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .event-row {
    grid-template-columns: 82px minmax(88px, 0.7fr) minmax(0, 1fr);
    font-size: 0.84rem;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head p {
    text-align: left;
  }
}

@media (max-width: 560px) {
  body.app-page .topbar,
  body.app-page .app-shell {
    width: min(100vw - 24px, 1180px);
  }

  .menu-tile {
    min-height: 92px;
    border-radius: 18px;
  }

  .menu-footer {
    gap: 18px;
  }

  .event-row {
    grid-template-columns: 1fr;
    gap: 2px;
    min-height: 0;
    padding: 8px 10px;
  }

  .event-row strong,
  .event-row em {
    padding: 0;
    border: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  max-width: 760px;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.theme-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(27, 35, 45, 0.14);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.94);
}

.theme-choice input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: #2f6fae;
}

.theme-choice strong,
.theme-choice small {
  display: block;
}

.theme-choice strong {
  color: #20262d;
  font-weight: 850;
}

.theme-choice small {
  margin-top: 4px;
  color: #667280;
  font-weight: 700;
}

body.app-page {
  --app-bg-top: #f8fafc;
  --app-bg-mid: #eef2f7;
  --app-bg-bottom: #e5ebf3;
  --app-text: #20262d;
  --app-heading: #171b21;
  --app-muted: #667280;
  --app-panel: rgba(255, 255, 255, 0.88);
  --app-panel-strong: rgba(248, 250, 252, 0.94);
  --app-row: rgba(105, 116, 128, 0.10);
  --app-row-alt: rgba(105, 116, 128, 0.18);
  --app-border: rgba(27, 35, 45, 0.14);
  --app-border-soft: rgba(27, 35, 45, 0.10);
  --app-shadow: 0 10px 24px rgba(31, 42, 55, 0.10);
  --app-accent: #2f6fae;
  --app-accent-strong: #214c7d;
  color: var(--app-text);
  background: linear-gradient(180deg, var(--app-bg-top) 0%, var(--app-bg-mid) 52%, var(--app-bg-bottom) 100%);
  color-scheme: light;
}

body.app-page.theme-dark {
  --app-bg-top: #0c1b2b;
  --app-bg-mid: #07111c;
  --app-bg-bottom: #030810;
  --app-text: #eef6fc;
  --app-heading: #f8fbff;
  --app-muted: #a9bfd2;
  --app-panel: rgba(9, 27, 43, 0.88);
  --app-panel-strong: rgba(12, 34, 54, 0.95);
  --app-row: rgba(255, 255, 255, 0.045);
  --app-row-alt: rgba(255, 255, 255, 0.075);
  --app-border: rgba(255, 255, 255, 0.12);
  --app-border-soft: rgba(255, 255, 255, 0.08);
  --app-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
  --app-accent: #66d5c0;
  --app-accent-strong: #2f6fae;
  color-scheme: dark;
}

body.app-page .topbar h1,
body.app-page .topbar span,
body.app-page .menu-tile,
body.app-page .menu-tile strong,
body.app-page .events-panel,
body.app-page .event-row,
body.app-page .brand-panel,
body.app-page .clock-panel,
body.app-page .brand-copy,
body.app-page .feature-card,
body.app-page .feature-tabs a,
body.app-page .secondary-button,
body.app-page .form-section legend,
body.app-page .checkbox-row,
body.app-page .empty-state strong,
body.app-page .theme-choice strong {
  color: var(--app-heading);
}

body.app-page .topbar p,
body.app-page .topbar form,
body.app-page .menu-tile small,
body.app-page .clock-panel span,
body.app-page .brand-copy span,
body.app-page .brand-copy small,
body.app-page .section-head p,
body.app-page .feature-card label,
body.app-page .contract-list,
body.app-page .empty-state,
body.app-page .data-table th,
body.app-page .data-table td small,
body.app-page .muted-inline,
body.app-page .theme-choice small {
  color: var(--app-muted);
}

body.app-page .menu-tile,
body.app-page .feature-card,
body.app-page .secondary-button,
body.app-page .theme-choice,
body.app-page .feature-tabs a {
  background: var(--app-panel);
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
}

body.app-page .feature-card input,
body.app-page .feature-card select,
body.app-page .feature-card textarea {
  color: var(--app-text);
  background: var(--app-panel-strong);
  border-color: var(--app-border);
}

body.app-page .form-section,
body.app-page .empty-state,
body.app-page .data-table th,
body.app-page .data-table td {
  border-color: var(--app-border-soft);
}

body.app-page .event-list,
body.app-page .event-row strong {
  border-color: var(--app-border);
}

body.app-page .event-row,
body.app-page .contract-list {
  background: var(--app-row);
}

body.app-page .event-row:nth-child(even) {
  background: var(--app-row-alt);
}

body.app-page .sf-symbol,
body.app-page .feature-tabs a.is-active {
  background: linear-gradient(145deg, var(--app-accent), var(--app-accent-strong));
}

@media (max-width: 560px) {
  .theme-choice-grid {
    grid-template-columns: 1fr;
  }
}
