:root {
  --bg: #08090b;
  --bg-soft: #111419;
  --panel: #161a20;
  --panel-bright: #1e242c;
  --steel: #87909c;
  --steel-light: #c8ced6;
  --text: #f5f7fa;
  --muted: #a7adb6;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff9f1c;
  --accent-strong: #ffb84d;
  --danger: #f05d5e;
  --success: #55d18a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(120deg, rgba(255, 159, 28, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 320px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 90px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 159, 28, 0.48);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2c3139, #101216);
  color: var(--accent-strong);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--steel-light);
  padding: 8px 10px;
  font-size: 0.9rem;
}

.nav-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: 28px;
  min-height: calc(100vh - 76px);
  padding: 74px 0 44px;
}

.hero-content {
  max-width: 830px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.65rem, 8vw, 6.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.04rem;
}

.hero-subtitle {
  max-width: 770px;
  margin: 24px 0 0;
  color: var(--steel-light);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-actions,
.dashboard-actions,
.appointment-actions,
.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-actions {
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #17100a;
  box-shadow: 0 12px 28px rgba(255, 159, 28, 0.2);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.button-danger {
  border-color: rgba(240, 93, 94, 0.45);
  background: rgba(240, 93, 94, 0.1);
  color: #ffd1d1;
}

.hero-panel,
.preset-section,
.form-panel,
.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.signal-bar {
  display: grid;
  grid-template-columns: 1fr 0.72fr 0.42fr;
  gap: 8px;
  margin-bottom: 4px;
}

.signal-bar span {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.18));
}

.hero-metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
}

.metric-label,
.stat-card span,
.preview-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 1.45rem;
}

.preset-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 20px;
  margin: 0 0 26px;
  padding: 20px;
}

.preset-copy h2 {
  margin-bottom: 10px;
}

.preset-copy p:last-child,
.dashboard-context {
  margin: 0;
  color: var(--muted);
}

.preset-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.preset-button {
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  color: var(--steel-light);
  cursor: pointer;
  font-weight: 850;
  padding: 10px 9px;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.preset-button:hover {
  border-color: rgba(255, 159, 28, 0.44);
  transform: translateY(-1px);
}

.preset-button.is-active {
  border-color: rgba(255, 159, 28, 0.78);
  background: linear-gradient(180deg, rgba(255, 184, 77, 0.22), rgba(255, 159, 28, 0.1));
  color: var(--accent-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dashboard-context {
  margin-top: 8px;
  font-size: 0.92rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
  gap: 22px;
  padding: 28px 0 60px;
}

.form-panel,
.dashboard-panel {
  min-width: 0;
  padding: 22px;
}

.form-panel {
  position: sticky;
  top: 92px;
}

.section-heading {
  margin-bottom: 20px;
}

.appointment-form,
.toolbar {
  display: grid;
  gap: 16px;
}

.form-row,
.search-field,
.filter-field {
  display: grid;
  gap: 7px;
}

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

label {
  color: var(--steel-light);
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

textarea {
  min-height: 128px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 159, 28, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.12);
}

.success-message {
  min-height: 24px;
  margin: 0;
  color: var(--success);
  font-weight: 800;
}

.dashboard-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.stat-card strong {
  display: block;
  margin-top: 7px;
  color: var(--accent-strong);
  font-size: 1.65rem;
  line-height: 1;
}

.toolbar {
  grid-template-columns: minmax(0, 1fr) 210px;
  margin-bottom: 16px;
}

.message-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(255, 159, 28, 0.38);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 159, 28, 0.09);
}

.message-preview[hidden] {
  display: none;
}

.message-preview p {
  margin: 5px 0 0;
  color: var(--text);
}

.appointments-list {
  display: grid;
  gap: 14px;
}

.appointment-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 36, 44, 0.95), rgba(17, 20, 25, 0.95));
  overflow: hidden;
}

.appointment-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 17px 0;
}

.appointment-topline > div {
  min-width: 0;
}

.appointment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--steel-light);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.8rem;
  font-weight: 750;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.status-select {
  width: auto;
  min-width: 138px;
  padding: 9px 10px;
}

.appointment-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 17px;
}

.detail-item {
  min-width: 0;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-item p {
  margin: 3px 0 0;
  color: var(--steel-light);
}

.detail-item.full {
  grid-column: 1 / -1;
}

.appointment-actions {
  border-top: 1px solid var(--line);
  padding: 14px 17px 17px;
}

.appointment-actions .button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.86rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.empty-state p {
  margin: 6px 0 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 16px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .hero-section,
  .preset-section,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 52px;
  }

  .hero-panel {
    max-width: 560px;
  }

  .form-panel {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .preset-actions {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 159, 28, 0.07), transparent 250px),
      var(--bg);
  }

  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 24px, 1180px);
    padding: 11px 0;
    gap: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 42px;
    padding: 9px 8px;
    text-align: center;
    font-size: 0.86rem;
  }

  main {
    width: min(100% - 24px, 1180px);
  }

  .hero-section {
    gap: 16px;
    padding: 30px 0 24px;
  }

  .hero-content {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.55rem);
    line-height: 1;
  }

  h2 {
    font-size: clamp(1.35rem, 7vw, 1.8rem);
  }

  h3 {
    font-size: 1rem;
  }

  .hero-subtitle {
    margin-top: 18px;
    font-size: 1rem;
  }

  .hero-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin: 22px 0 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(8, 9, 11, 0.9);
    backdrop-filter: blur(18px);
  }

  .hero-actions,
  .dashboard-actions,
  .form-footer,
  .appointment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
  }

  .two-column,
  .toolbar,
  .message-preview,
  .appointment-details {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .appointment-topline {
    flex-direction: column;
    align-items: stretch;
  }

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

  .status-select {
    width: 100%;
    min-height: 48px;
  }

  .workspace-grid {
    gap: 16px;
    padding: 20px 0 48px;
  }

  .preset-section {
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px;
  }

  .preset-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-button {
    min-height: 50px;
  }

  .form-panel,
  .dashboard-panel,
  .preset-section,
  .hero-panel {
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.34);
  }

  .form-panel,
  .dashboard-panel {
    padding: 18px;
  }

  .section-heading {
    margin-bottom: 16px;
  }

  .appointment-form,
  .toolbar {
    gap: 14px;
  }

  label {
    font-size: 0.9rem;
  }

  input,
  select,
  textarea {
    min-height: 50px;
    padding: 13px 12px;
    font-size: 16px;
  }

  textarea {
    min-height: 132px;
  }

  .dashboard-actions {
    width: 100%;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card strong {
    font-size: 1.5rem;
  }

  .appointment-topline {
    padding: 15px 15px 0;
  }

  .appointment-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .chip {
    justify-content: center;
    width: 100%;
    min-height: 32px;
    text-align: center;
  }

  .appointment-details {
    gap: 11px;
    padding: 15px;
  }

  .appointment-actions {
    padding: 13px 15px 15px;
  }

  .appointment-actions .button {
    min-height: 46px;
    font-size: 0.9rem;
  }

  .message-preview {
    gap: 12px;
    padding: 14px;
  }

  .empty-state {
    min-height: 155px;
    padding: 18px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.18rem;
  }

  .form-panel,
  .dashboard-panel {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link {
    font-size: 0.82rem;
  }

  .brand small {
    font-size: 0.72rem;
  }

  .hero-panel {
    padding: 14px;
  }

  .preset-section {
    padding: 16px;
  }

  .hero-metric {
    padding: 14px;
  }

  .hero-metric strong {
    font-size: 1.25rem;
  }
}

@media (max-width: 360px) {
  main,
  .nav-shell {
    width: min(100% - 18px, 1180px);
  }

  h1 {
    font-size: 2rem;
  }

  .nav-actions {
    flex-direction: column;
  }

  .form-panel,
  .dashboard-panel {
    padding: 14px;
  }

  .preset-actions {
    grid-template-columns: 1fr;
  }

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