:root {
  color-scheme: light;
  --navy: #0b3a6e;
  --navy-dark: #07294f;
  --blue-soft: #e8f1fc;
  --gold: #f4b740;
  --green: #16865b;
  --red: #b42318;
  --ink: #172536;
  --muted: #66758a;
  --line: #dce3ec;
  --background: #f4f7fb;
  --surface: #ffffff;
  --shadow: 0 12px 30px rgba(24, 45, 73, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--background); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.is-hidden { display: none !important; }

.showroom-loading,
.access-denied {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 12px;
  padding: 24px;
}
.loading-mark { color: var(--navy); font-size: 34px; font-weight: 800; }

.showroom-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--navy-dark);
  box-shadow: 0 6px 18px rgba(4, 24, 47, 0.18);
}
.header-brand, .header-actions { display: flex; align-items: center; gap: 14px; }
.header-brand img { width: 64px; height: 48px; object-fit: contain; padding: 5px; border-radius: 10px; background: #fff; }
.header-brand span { opacity: 0.72; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.header-brand h1 { margin: 2px 0 0; font-size: 25px; }
.user-chip { padding: 9px 13px; border-radius: 999px; background: rgba(255,255,255,.12); }

.showroom-content { width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 52px; }
.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 34px;
  color: #fff;
  border-radius: 22px;
  background: linear-gradient(125deg, var(--navy-dark), var(--navy));
  box-shadow: var(--shadow);
}
.hero-panel h2 { margin: 4px 0 8px; font-size: clamp(25px, 3vw, 37px); }
.hero-panel p:last-child { max-width: 760px; margin: 0; color: rgba(255,255,255,.78); line-height: 1.6; }
.eyebrow { margin: 0 0 4px; color: #507096; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-panel .eyebrow { color: #a9c8ed; }

.button {
  border: 0;
  border-radius: 11px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--navy); box-shadow: 0 7px 16px rgba(11,58,110,.2); }
.hero-panel .button.primary { color: #2b2100; background: var(--gold); white-space: nowrap; }
.button.secondary { color: var(--navy); background: #edf3fa; }
.showroom-header .button.secondary { color: #fff; background: rgba(255,255,255,.13); }
.button.danger { color: var(--red); background: #fff0ee; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.summary-card { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card strong { display: block; margin: 6px 0 2px; color: var(--navy); font-size: 34px; }
.summary-card.emphasis { border-color: #f0c35b; background: #fff9e9; }
.summary-card.emphasis strong { color: #8b5a00; }

.panel { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 22px; }
.panel-count, .info-badge { padding: 7px 11px; color: var(--navy); border-radius: 999px; background: var(--blue-soft); font-size: 13px; font-weight: 700; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 10px; color: var(--muted); background: #eef2f7; font-size: 25px; cursor: pointer; }

.form-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.form-grid.three { grid-template-columns: 2fr 1fr 1fr; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #43536a; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; padding: 11px 12px; color: var(--ink); border: 1px solid #cfd8e5; border-radius: 10px; background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #6d9bd0; box-shadow: 0 0 0 3px rgba(34,105,178,.11); }
textarea { resize: vertical; line-height: 1.45; }
label small { color: var(--muted); font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.panel-description { max-width: 900px; margin: -8px 0 20px; color: var(--muted); line-height: 1.55; }
.announcement-settings { align-items: end; margin-top: 14px; }
.interval-input { display: flex; align-items: center; gap: 10px; }
.interval-input input { max-width: 150px; }
.interval-input span { color: var(--muted); font-weight: 600; }
.switch-field > span { min-height: 46px; display: flex; align-items: center; gap: 9px; }
.switch-field input { width: 20px; height: 20px; }
.recording-box { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.recording-box p { margin: 5px 0 0; color: var(--muted); }
.recording-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.upload-button { position: relative; overflow: hidden; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.recording-box audio { width: min(100%, 650px); margin-top: 15px; }
.announcement-panel.is-recording { border-color: #e68b84; box-shadow: 0 0 0 3px rgba(180,35,24,.08), var(--shadow); }

.vehicle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.vehicle-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfe; }
.vehicle-card-top { min-height: 94px; padding: 18px; color: #fff; background: linear-gradient(135deg, var(--navy), #276aa9); }
.vehicle-card-top h3 { margin: 3px 0 4px; font-size: 20px; }
.vehicle-card-top p { margin: 0; opacity: .76; }
.vehicle-card-body { padding: 16px 18px; }
.vehicle-card-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.status-badge, .pdf-badge { padding: 5px 9px; border-radius: 999px; background: #eaf0f7; font-size: 12px; font-weight: 700; }
.status-badge.published { color: #086843; background: #e5f8ef; }
.status-badge.draft { color: #865600; background: #fff5d9; }
.status-badge.archived { color: #66758a; background: #edf0f4; }
.vehicle-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vehicle-card-actions .button { padding: 8px 11px; font-size: 13px; }
.empty-state { grid-column: 1 / -1; padding: 42px 20px; text-align: center; color: var(--muted); border: 1px dashed #c9d4e1; border-radius: 14px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 11px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 13px 11px; border-bottom: 1px solid #edf1f6; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.online-dot, .offline-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.online-dot { background: var(--green); }
.offline-dot { background: #9aa7b7; }
.inquiry-type { display: inline-block; padding: 5px 8px; border-radius: 8px; color: var(--navy); background: var(--blue-soft); font-size: 12px; font-weight: 700; }
.inquiry-type.test_drive { color: #7b5200; background: #fff2ce; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 430px; padding: 13px 17px; color: #fff; border-radius: 11px; background: #16283d; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }

@media (max-width: 1050px) {
  .summary-grid, .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .showroom-header, .hero-panel { align-items: stretch; flex-direction: column; }
  .header-actions { justify-content: space-between; }
  .summary-grid, .vehicle-grid, .form-grid.three, .form-grid.two { grid-template-columns: 1fr; }
  .showroom-content { width: min(100% - 22px, 1500px); padding-top: 14px; }
  .panel, .hero-panel { padding: 19px; border-radius: 15px; }
}
