/* =====================================================================
   El Mecano Garage – shared styles (client form + owner dashboard)
   Mobile-first: base styles are for phones, wider screens via @media.

   Light look everywhere: white page, clearly outlined fields, and a navy
   header band behind the logo (the logo is white). Parts use "role"
   colors (--bg, --text, --field-…) rather than raw brand colors.
   ===================================================================== */

:root {
  /* Brand colors */
  --navy: #141a2e;
  --navy-2: #1c2440;      /* buttons on the navy header band */
  --navy-3: #283152;      /* borders on the navy header band */
  --red: #e10600;
  --red-dark: #b30500;
  --white: #ffffff;
  --grey: #c9ccd6;        /* secondary text on navy */
  --grey-dim: #8a90a3;
  --green: #16a34a;
  --amber: #f5a524;
  --blue: #3b82f6;

  /* Role colors. Contrast checked against white (WCAG AA). */
  --bg: #ffffff;
  --text: var(--navy);
  --muted: #3f4660;               /* secondary text */
  --subtle: #5c6378;              /* hints, "optional", dates */
  --surface: #f2f3f7;             /* light grey boxes */
  --hover: #f7f8fa;               /* row under the mouse */
  --line: #d4d7e0;                /* borders, separators */
  --field-bg: #ffffff;
  --field-border: #767d92;        /* dark enough to see the box at a glance */
  --field-focus-ring: rgba(225, 6, 0, .18);
  --error: #c40500;
  --error-bg: #fdecec;
  --error-text: #a30400;
  --notice-bg: #fff4dc;
  --notice-text: #6e4600;
  --shadow: 0 1px 3px rgba(20, 26, 46, .08);

  --radius: 12px;
  --tap: 52px;            /* minimum height of anything tappable */

  --font-title: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Lato', system-ui, sans-serif;
  --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

h1, h2, h3, button, .btn-primary, .btn-secondary { font-family: var(--font-title); }

/* Arabic: Cairo everywhere */
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] button, html[lang="ar"] input, html[lang="ar"] textarea,
html[lang="ar"] select, html[lang="ar"] .btn-primary, html[lang="ar"] .btn-secondary {
  font-family: var(--font-ar);
  letter-spacing: 0 !important;   /* letter-spacing breaks Arabic joining */
}

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

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}

/* ---------- Header (client form): navy band, full width ---------- */
.top {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
.top-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 16px 18px;
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  color: var(--grey-dim);
}
.lang-switch button {
  background: none;
  border: 0;
  color: var(--grey);
  font-size: 15px;
  min-height: 44px;
  padding: 0 10px;
  cursor: pointer;
}
.lang-switch button[data-lang-btn="ar"] { font-family: var(--font-ar); }
.lang-switch button[data-lang-btn="fr"] { font-family: var(--font-title); }
.lang-switch button[aria-pressed="true"] {
  color: var(--white);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.logo {
  display: block;
  width: 170px;
  height: auto;
  margin: 0 auto 4px;
}
.intro {
  color: var(--grey);
  margin: 0;
}

/* ---------- Titles ---------- */
.step-title {
  font-size: 22px;
  font-weight: 800;
  margin: 12px 0 16px;
  text-align: center;
}
.group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
html[lang="ar"] .group-title { font-size: 15px; }

/* ---------- Step 1: service cards ---------- */
.service-list { display: grid; gap: 14px; }

.service-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 96px;
  padding: 18px;
  background: var(--field-bg);
  color: var(--text);
  border: 2px solid var(--field-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: start;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.service-card:hover, .service-card:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
  outline: none;
}
.service-card:active { transform: scale(.98); }
.service-icon { font-size: 34px; line-height: 1; }
.service-text strong { display: block; font-size: 18px; font-weight: 700; }
.service-text small { display: block; color: var(--muted); font-size: 14px; font-family: var(--font-body); margin-top: 2px; }
html[lang="ar"] .service-text small { font-family: var(--font-ar); }

/* ---------- Step 2: form ---------- */
.chosen-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 8px 16px;
  background: var(--surface);
  border-inline-start: 4px solid var(--red);
  border-radius: 8px;
  font-weight: 700;
}

.link-btn {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  color: var(--muted);
  text-decoration: underline;
  font-size: 14px;
  cursor: pointer;
}

#request-form { margin-top: 20px; }
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  padding: 0;
}
.opt { color: var(--subtle); font-weight: 400; font-size: 14px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="password"],
input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;            /* ≥16px stops iOS from zooming on focus */
  color: var(--text);
  background: var(--field-bg);
  border: 2px solid var(--field-border);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--field-focus-ring);
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
html[dir="rtl"] select { background-position: 14px 50%, 20px 50%; }

/* Phone with fixed +216 prefix: prefix and input look like one box */
.phone-input { display: flex; border-radius: var(--radius); transition: box-shadow .15s; }
.phone-input .prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--surface);
  border: 2px solid var(--field-border);
  border-inline-end: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--muted);
  font-weight: 700;
}
.phone-input input { border-radius: 0 var(--radius) var(--radius) 0; letter-spacing: 0.05em; }
.phone-input input:focus { box-shadow: none; }
.phone-input:focus-within { box-shadow: 0 0 0 4px var(--field-focus-ring); }
.phone-input:focus-within .prefix { border-color: var(--red); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Radio choices as big pills */
.choices { display: grid; gap: 10px; }
.choices-grid { grid-template-columns: 1fr 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  background: var(--field-bg);
  border: 2px solid var(--field-border);
  border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.choice:hover span { border-color: var(--red); }
.choice input:checked + span { background: var(--red); border-color: var(--red); color: var(--white); }
.choice input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

/* Appointment: day tabs (scroll sideways on small phones) + time buttons */
.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  margin: 0 -2px 10px;
  scrollbar-width: none;
}
.day-tab {
  position: relative;
  flex: 1 0 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: var(--tap);
  padding: 8px 6px;
  font: inherit;
  color: var(--text);
  background: var(--field-bg);
  border: 2px solid var(--field-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.day-tab strong { font-size: 15px; white-space: nowrap; }
.day-tab small { font-size: 13px; color: var(--subtle); white-space: nowrap; }
.day-tab:hover { border-color: var(--red); }
.day-tab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.day-tab[aria-pressed="true"] small { color: var(--grey); }
.day-tab:disabled { opacity: .45; cursor: not-allowed; border-style: dashed; }
.day-tab:disabled:hover { border-color: var(--field-border); }
.day-tab.has-choice::after {   /* the day holding the chosen slot */
  content: '';
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
}
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot span { font-family: var(--font-title); letter-spacing: .03em; }
.slot.is-taken { cursor: not-allowed; }
.slot.is-taken span { opacity: .4; text-decoration: line-through; border-style: dashed; }
.slot.is-taken:hover span { border-color: var(--field-border); }

/* File upload */
.file-btn {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px;
  background: var(--surface);
  border: 2px dashed var(--field-border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.file-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-btn:hover, .file-btn:focus-within { border-color: var(--red); }
.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 14px;
  word-break: break-all;
}
.hint { color: var(--subtle); font-size: 13px; margin: 6px 0 0; }

/* Errors */
.error { color: var(--error); font-size: 14px; font-weight: 700; margin: 6px 0 0; min-height: 0; }
.error:empty { display: none; }
.has-error input, .has-error select, .has-error textarea,
.has-error .choice span, .has-error .file-btn, .has-error .prefix { border-color: var(--error); }
.has-error input, .has-error textarea { background: var(--error-bg); }
.form-error, .notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-weight: 700;
}
.form-error { background: var(--error-bg); border: 1px solid var(--red); color: var(--error-text); }
.notice { background: var(--notice-bg); border: 1px solid var(--amber); color: var(--notice-text); }

/* "After the diagnostic you get a repair appointment" – above the send button */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 0;
  padding: 12px 14px;
  background: #eef4ff;
  border: 1px solid #b9cdf5;
  border-inline-start: 4px solid var(--blue);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
}

/* Honeypot – invisible but not display:none (some bots skip hidden fields).
   Clipped in place: a negative "left" would make RTL pages scroll sideways. */
#request-form { position: relative; }
.hp { position: absolute; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--red);
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--field-border); }
#submit-btn { margin-top: 24px; }

/* ---------- Step 3: thanks ---------- */
#step-thanks { text-align: center; }
.thanks-icon {
  width: 72px; height: 72px;
  margin: 8px auto 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-size: 38px; font-weight: 800;
}
.thanks-text { color: var(--muted); margin-top: -6px; }
.thanks-slot {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--muted);
}
.thanks-slot strong { display: inline-block; margin-top: 4px; font-size: 19px; color: var(--text); }


/* =====================================================================
   Owner dashboard – made for a computer (table or to-do list + detail
   panel on the right). On a phone the detail panel opens full screen.
   ===================================================================== */
.page.dash { max-width: 1440px; padding-top: 12px; }

/* Navy header band (the logo is white) */
.dash-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -12px -16px 16px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--navy);
  color: var(--white);
}
.dash-top .logo { width: 100px; margin: 0; }
.dash-title { margin: 0; font-size: 18px; font-weight: 700; }
.dash-top-actions { display: flex; gap: 6px; margin-inline-start: auto; }

.icon-btn {
  min-height: 40px;
  padding: 0 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--text); }
.icon-btn:disabled { opacity: .5; cursor: default; }
.dash-top .icon-btn { background: var(--navy-2); color: var(--white); border-color: var(--navy-3); }
.dash-top .icon-btn:hover { border-color: var(--grey-dim); }

/* Login: logo on a navy block */
.login { max-width: 380px; margin: 32px auto 0; }
.login .logo {
  width: 100%;
  margin-bottom: 16px;
  padding: 20px 60px;
  background: var(--navy);
  border-radius: var(--radius);
}

/* ---------- Toolbar: search, view switch, filters ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
}
.toolbar input[type="search"] { flex: 1 1 260px; min-height: 44px; font-size: 16px; padding: 8px 14px; }
/* Filters: three simple dropdowns (status, date, type) */
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.filter { display: flex; align-items: center; gap: 6px; }
.filter span {
  color: var(--muted);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.filter select {
  width: auto;
  min-height: 42px;
  padding: 6px 36px 6px 12px;
  font-size: 15px;
  font-weight: 600;
  border-width: 1px;
  border-radius: 10px;
  cursor: pointer;
}

/* Dashboard: day tabs above the list (reuse the form's .day-tab look) */
.dash-days { margin: 0 0 12px; }
.dash-days .day-tab { flex: 0 0 auto; min-width: 120px; min-height: 48px; padding: 6px 14px; }
.dash-days .day-tab strong { text-transform: capitalize; }
.dash-days .day-tab.has-appt:not([aria-pressed="true"]) { border-color: var(--blue); }
.dash-days .day-tab.is-closed:not(.has-appt) { opacity: .55; border-style: dashed; }

.list-info { color: var(--subtle); font-size: 13px; margin: 0 0 8px; }
.empty { text-align: center; color: var(--subtle); padding: 40px 0; }

/* ---------- Layout: list on the left, detail on the right ---------- */
.dash-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dash-main { min-width: 0; }

@media (min-width: 900px) {
  .dash-body { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .detail {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }
}
/* Phone / small window: the panel covers the screen when a request is open */
@media (max-width: 899px) {
  .detail {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow-y: auto;
    border: 0 !important;
    border-radius: 0 !important;
    padding-top: calc(16px + env(safe-area-inset-top, 0px)) !important;
  }
  body:not(.detail-open) .detail { display: none; }
  body.detail-open { overflow: hidden; }
}

/* Each request has its type color on the start edge */
.type-diagnostic { --type-color: var(--blue); }
.type-achat { --type-color: var(--amber); }

.flag { font-size: 12px; font-weight: 700; white-space: nowrap; }
.flag-no { color: var(--error); }
.flag-unsure { color: #8a5a00; }

/* ---------- The list of requests ---------- */
.todo { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--type-color);
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.todo-item:hover { border-color: var(--field-border); border-inline-start-color: var(--type-color); }
.todo-item:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.todo-item.is-selected { border-color: var(--red); border-inline-start-color: var(--red); background: #fff1f0; }

.todo-check {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  background: var(--bg);
  color: transparent;            /* tick only visible when done */
  border: 2px solid var(--field-border);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.todo-check:hover { border-color: var(--green); color: var(--green); }
.todo-check[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--white); }

.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.todo-date { color: var(--subtle); font-size: 12px; min-width: 90px; text-align: end; }
.todo-item.is-done .todo-title { text-decoration: line-through; color: var(--subtle); }
.todo-item.is-done .todo-sub { color: var(--subtle); }

/* Phone: badges and date go on a second line, under the text */
@media (max-width: 599px) {
  .todo-item { flex-wrap: wrap; gap: 6px 12px; }
  .todo-main { flex: 1 1 calc(100% - 42px); }
  .todo-meta { width: 100%; justify-content: flex-start; padding-inline-start: 42px; }
  .todo-meta .badge-diagnostic, .todo-meta .badge-achat { display: none; }
  .todo-date { min-width: 0; margin-inline-start: auto; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-diagnostic { background: #dbeafe; color: #1e40af; }
.badge-achat { background: #fef3c7; color: #92400e; }
.badge-status { background: #e5e7eb; color: #374151; }
.badge-status.s-nouveau { background: var(--red); color: var(--white); }
.badge-status.s-en_cours { background: #fef3c7; color: #92400e; }

/* ---------- Detail panel ---------- */
.detail {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(20, 26, 46, .08);
  padding: 16px;
}
.detail-empty { color: var(--subtle); text-align: center; margin: 40px 0; }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.detail-date { color: var(--subtle); font-size: 13px; }
.detail-close { margin-inline-start: auto; min-height: 36px; padding: 0 12px; }

.alert {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--error-bg);
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--error-text);
  font-weight: 700;
  font-size: 14px;
}
.alert.soft { background: var(--notice-bg); border-color: var(--amber); color: var(--notice-text); }

.appt { font-size: 13px; font-weight: 700; white-space: nowrap; }
/* Detail panel: appointment, and its edit form */
.appt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  background: #eef4ff;
  border-inline-start: 4px solid var(--blue);
  border-radius: var(--radius);
}
.appt-current { font-weight: 700; }
.appt-none, .appt-closed { color: var(--subtle); }
.appt-edit { padding: 10px; background: var(--surface); border-radius: var(--radius); }
.appt-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.appt-fields input, .appt-fields select { width: auto; flex: 1 1 140px; min-height: 42px; padding: 6px 10px; font-size: 15px; border-width: 1px; }
.appt-fields select { padding-inline-end: 32px; }
.appt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.appt-actions .btn-save { background: var(--navy); color: var(--white); border-color: var(--navy); }

.detail-phone { font-family: var(--font-title); font-size: 22px; font-weight: 700; letter-spacing: .03em; }
.detail-name { color: var(--muted); }
.detail-car { margin-top: 6px; font-weight: 700; }
.detail-car small { color: var(--muted); font-weight: 400; }
.detail-problem {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-media { margin-top: 10px; }
.detail-media img, .detail-media video {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  background: #000;
}
.detail-media a { display: inline-block; }

.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn-call, .btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px;
  border-radius: 10px;
  font-family: var(--font-title);
  font-weight: 700;
  text-decoration: none;
  color: var(--white);
}
.btn-call { background: var(--red); }
.btn-call:hover { background: var(--red-dark); }
.btn-wa { background: #15803d; }
.btn-wa:hover { background: #166534; }

.detail-label {
  margin: 18px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.status-btn {
  min-height: 40px;
  padding: 0 2px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--field-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.status-btn:hover { border-color: var(--text); color: var(--text); }
.status-btn[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }

#note-input { min-height: 90px; font-size: 15px; }
.note-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.note-row .icon-btn { background: var(--navy); color: var(--white); border-color: var(--navy); }

.detail-foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.link-btn.danger { color: var(--error); }

/* Delete confirmation */
.confirm {
  padding: 12px;
  background: var(--error-bg);
  border: 1px solid var(--red);
  border-radius: 10px;
}
.confirm p { margin: 0 0 10px; font-weight: 700; color: var(--error-text); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-actions button { min-height: 44px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-danger { background: var(--red); color: var(--white); border: 0; }
.btn-cancel { background: var(--bg); color: var(--text); border: 1px solid var(--field-border); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(20, 26, 46, .3);
  z-index: 50;
}
.toast.error { background: var(--red); color: var(--white); }

/* ---------- Wider screens ---------- */
@media (min-width: 600px) {
  .page:not(.dash) { padding-top: 24px; }
  .top .logo { width: 200px; }
  .choices-grid { grid-template-columns: repeat(3, 1fr); }
  .status-btn { font-size: 13px; }
}

/* Very small phones */
@media (max-width: 360px) {
  .row-2 { grid-template-columns: 1fr; }
  .status-btn { font-size: 11px; }
}


/* Wide screens: a roomier detail panel */
@media (min-width: 1380px) {
  .dash-body { grid-template-columns: minmax(0, 1fr) 400px; }
}
