/* =========================================================
   Buckley Pianos Ops
   Base shared styles
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #e9eef4;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --surface-active: #eef5ff;
  --text: #102741;
  --text-soft: #3a556f;
  --text-muted: #667b91;
  --border: #d4deea;

  --navy-950: #0c1a30;
  --navy-900: #142b49;
  --navy-800: #24486e;

  --blue: #3f6f9f;
  --blue-deep: #2f5b86;
  --blue-soft: #dfeafb;
  --blue-text: #204d79;

  --green: #5a8a74;
  --green-deep: #466e5d;
  --green-soft: #e9f4ee;
  --green-text: #1e5c43;

  --red: #c54a55;
  --red-deep: #a53a44;
  --red-soft: #fff0f1;
  --red-text: #8c2d35;

  --collection-bg: #dde9f6;
  --collection-text: #355f8b;
  --delivery-bg: #e6f2df;
  --delivery-text: #486a34;

  --shadow-card: 0 10px 24px rgba(16, 39, 66, 0.08);
  --shadow-card-strong: 0 16px 34px rgba(33, 76, 120, 0.14);
  --shadow-btn: 0 6px 14px rgba(16, 39, 66, 0.12);

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --container-max: 1360px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #f5f8fb 0px, var(--bg) 360px);
  color: var(--text);
}

a {
  color: inherit;
}

.container,
.container-narrow {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 20px;
}

.stack > * + * {
  margin-top: 22px;
}

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

/* ---------- Shared buttons ---------- */

.btn,
button {
  appearance: none;
  border: 0;
  background: var(--navy-900);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.15s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  background: var(--navy-800);
}

.btn-light,
.btn-secondary,
.btn-eta,
.btn-success {
  box-shadow: none;
}

.btn-light {
  background: #eef3f8;
  color: var(--blue-text);
  border: 1px solid var(--border);
}

.btn-light:hover {
  background: #e2eaf3;
}

.btn-secondary {
  background: #475569;
  color: #fff;
  border: 1px solid #5f7184;
}

.btn-secondary:hover {
  background: #334155;
}

.btn-nav-action {
  background: var(--blue);
}

.btn-nav-action:hover {
  background: var(--blue-deep);
}

.btn-action-primary {
  background: var(--green);
}

.btn-action-primary:hover {
  background: var(--green-deep);
}

.btn-action-secondary {
  background: #55687b;
}

.btn-action-secondary:hover {
  background: #415163;
}

.btn-success {
  background: var(--blue-soft);
  color: var(--blue-text);
  border: 1px solid #c7d8ef;
}

.btn-success:hover {
  background: #d2e1f5;
}

.btn-eta {
  background: #e8eef6;
  color: var(--blue-text);
  border: 1px solid #cfdae8;
}

.btn-eta:hover {
  background: #dde6f1;
}

.btn.active {
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* ---------- Shared cards / forms ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 28px;
}

.page-subtitle {
  margin-top: 6px;
  color: rgba(255,255,255,0.84);
  font-size: 16px;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-card,
.job-panel {
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(216,225,236,0.95);
}

.form-section + .form-section {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid #dbe4ef;
}

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

.section-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  color: #143559;
}

.section-copy {
  margin-top: 6px;
  color: #677d97;
  font-size: 15px;
  line-height: 1.45;
}

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

.field,
.info-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.field-label,
.info-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #60758f;
}

.input {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #d8e1ec;
  background: #fff;
  color: #143559;
  font: inherit;
  font-size: 16px;
}

textarea.input {
  min-height: 132px;
  resize: vertical;
}

.input:focus {
  outline: none;
  border-color: #7fa6cf;
  box-shadow: 0 0 0 4px rgba(74, 120, 170, 0.12);
}

.field-span-12 { grid-column: span 12; }
.field-span-8 { grid-column: span 8; }
.field-span-6 { grid-column: span 6; }
.field-span-4 { grid-column: span 4; }
.field-span-3 { grid-column: span 3; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge.collection {
  background: var(--collection-bg);
  color: var(--collection-text);
}

.badge.delivery {
  background: var(--delivery-bg);
  color: var(--delivery-text);
}

.badge.other,
.pending-badge {
  background: #dce8f5;
  color: #3b628e;
}

.info-item {
  grid-column: span 6;
  padding: 18px 18px 16px;
  border: 1px solid #dce4ee;
  background: #fbfdff;
  border-radius: 18px;
}

.info-value {
  color: #173457;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  word-break: break-word;
}

.job-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 20px;
}

.job-stops-list {
  display: grid;
  gap: 18px;
}

.job-stop {
  border: 1px solid #d8e1ec;
  border-radius: 22px;
  background: #fbfdff;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(16,35,63,0.05);
}

.job-stop.completed {
  background: #f5f8fb;
}

.job-stop-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.job-stop-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  color: #143559;
}

.job-stop-subtitle {
  margin-top: 6px;
  color: #5d728d;
  font-size: 15px;
  font-weight: 600;
}

.job-stop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Shared responsive ---------- */

@media (max-width: 1180px) {
  .job-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .container,
  .container-narrow {
    padding: 16px;
  }

  .field-span-6,
  .field-span-4,
  .field-span-3,
  .info-item {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .container,
  .container-narrow {
    padding: 14px;
  }

  .btn,
  button {
    min-width: 88px;
    min-height: 48px;
    font-size: 14px;
    border-radius: 14px;
    padding: 10px 14px;
  }

  .card-pad {
    padding: 18px;
  }

  .section-title {
    font-size: 23px;
  }

  .form-actions,
  .toolbar,
  .job-stop-head {
    flex-direction: column;
    align-items: stretch;
  }

  .job-stop-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
