/* Integris Service Schedules: brand tokens from docs/brand-ui.md */
:root {
  --plum: #3a2742;
  --nav-bg: #24132b;
  --violet: #502e99;
  --violet-hover: #3f2380;
  --violet-tint: #ede9f7;
  --red: #ce0019;
  --red-hover: #a80014;
  --gradient: linear-gradient(90deg, #502e99 0%, #ce0019 55%, #ff8800 100%);
  --bg: #f6f4f9;
  --card: #ffffff;
  --border: #e0dce8;
  --row-border: #eeebf2;
  --chip-bg: #f3f1f6;
  --text: #1c1528;
  --text-2: #3a2742;
  --muted: #5e536b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(58, 39, 66, 0.05), 0 6px 20px rgba(58, 39, 66, 0.06);
  --font: 'Neue Haas Grotesk', Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--violet);
}

a:hover {
  color: var(--violet-hover);
}

:focus-visible {
  outline: 3px solid rgba(80, 46, 153, 0.45);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Header */
.site-header {
  background: var(--nav-bg);
  color: #fff;
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.wordmark {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.wordmark:hover {
  color: #fff;
}

.wordmark__dot {
  color: var(--red);
}

.site-header__divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.25);
}

.site-header__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.brand-stripe {
  height: 3px;
  background: var(--gradient);
}

.app {
  flex: 1 0 auto;
}

/* Footer */
.site-footer {
  background: var(--nav-bg);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

/* Hero */
.hero {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  padding-top: 40px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 520px;
  min-width: 0;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--violet);
  letter-spacing: 0.4px;
}

.hero h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.hero__meta {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 10px 0 0;
  padding: 0;
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
}

.stats dd {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stats dt {
  font-size: 13px;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    box-shadow 0.15s,
    color 0.15s;
}

.btn svg {
  flex: none;
}

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(206, 0, 25, 0.22);
}

.btn--primary:hover {
  background: var(--red-hover);
  color: #fff;
}

.btn--outline {
  background: #fff;
  border-color: var(--violet);
  color: var(--violet);
}

.btn--outline:hover {
  background: var(--violet);
  color: #fff;
}

.btn--violet {
  background: var(--violet);
  color: #fff;
  height: 40px;
  font-size: 14px;
  padding: 0 14px;
}

.btn--violet:hover {
  background: var(--violet-hover);
  color: #fff;
}

.btn--ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text-2);
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  padding: 0 14px;
}

.btn--ghost:hover {
  border-color: var(--violet);
  color: var(--violet);
}

.btn--icon {
  width: 40px;
  padding: 0;
}

/* Toolbar */
.content {
  padding-top: 28px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.search {
  position: relative;
  flex: 1 1 300px;
  max-width: 420px;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 13px;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}

.search input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(80, 46, 153, 0.12);
}

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

.chip {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.chip__count {
  color: var(--muted);
  margin-left: 4px;
}

.chip[aria-pressed='true'] {
  border-color: var(--violet);
  background: var(--violet-tint);
  color: var(--violet);
  font-weight: 600;
}

.chip[aria-pressed='true'] .chip__count {
  color: var(--violet);
}

.view-toggle {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 10px;
  background: var(--chip-bg);
}

.view-toggle button {
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.view-toggle button[aria-pressed='true'] {
  background: #fff;
  color: var(--violet);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(58, 39, 66, 0.1);
}

/* Card view */
.area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.area__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.area__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.area__count {
  font-size: 14px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.card__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--violet-tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
}

.card__sub {
  font-size: 13px;
  color: var(--muted);
}

.covers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.covers__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.sku-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.sku {
  flex: none;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}

.sku-desc {
  font-size: 14px;
  color: var(--text-2);
  min-width: 0;
  padding-top: 1px;
}

/* Quote line descriptions can run to a paragraph: show two lines, full text on hover */
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.card__actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

/* Also on this proposal */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.panel p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Table view */
.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.table-card table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

.table-card th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  background: #f7f6f9;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.td-desc {
  max-width: 360px;
}

.td-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.table-card td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--row-border);
  vertical-align: middle;
}

.table-card th:first-child,
.table-card td:first-child {
  padding-left: 20px;
}

.table-card th:last-child,
.table-card td:last-child {
  padding-right: 20px;
  text-align: right;
}

.table-card tr:last-child td {
  border-bottom: 0;
}

.td-area {
  color: var(--muted);
  white-space: nowrap;
}

.schedule-link {
  font-weight: 600;
  text-decoration: none;
}

.schedule-link:hover {
  text-decoration: underline;
}

.schedule-version {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.schedule-cell + .schedule-cell {
  margin-top: 8px;
}

.muted {
  color: var(--muted);
}

.table-foot {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--muted);
  background: #fcfbfd;
  border-top: 1px solid var(--row-border);
}

.note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* States */
.state {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  justify-content: center;
}

.state__card {
  max-width: 520px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  align-items: center;
}

.state__card h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.state__card p {
  margin: 0;
  color: var(--muted);
}

.state__wordmark {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Loading skeleton */
.loading {
  padding-top: 40px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #ece9f1 0%, #f6f4f9 50%, #ece9f1 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton--short {
  width: 180px;
  height: 14px;
}

.skeleton--title {
  width: min(460px, 80%);
  height: 34px;
}

.skeleton-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.skeleton--card {
  height: 180px;
  border-radius: var(--radius);
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}

/* Phone */
@media (max-width: 640px) {
  .container,
  .site-header__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-header__inner {
    height: 56px;
    gap: 12px;
  }

  .wordmark {
    font-size: 22px;
  }

  .site-header__label {
    font-size: 11px;
    letter-spacing: 1.4px;
  }

  .hero__inner {
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .hero h1 {
    font-size: 26px;
    letter-spacing: -0.5px;
  }

  .hero__meta {
    font-size: 14px;
  }

  .hero__actions,
  .hero__actions .btn {
    width: 100%;
  }

  .content {
    padding-top: 16px;
    gap: 24px;
  }

  .search {
    max-width: none;
    flex-basis: 100%;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }

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

  .card {
    padding: 16px;
  }

  .card__actions .btn--violet {
    flex: 1 1 auto;
  }
}
