/* ═══════════════════════════════════════
   RELIABLE REPAIRS — Admin CMS Styles
   ═══════════════════════════════════════ */

:root {
  --primary:      #1d4ed8;
  --primary-dark: #1e40af;
  --primary-light:#dbeafe;
  --accent:       #f97316;
  --danger:       #dc2626;
  --success:      #16a34a;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --bg:           #f8fafc;
  --bg-white:     #ffffff;
  --border:       #e2e8f0;
  --sidebar-bg:   #0f172a;
  --sidebar-w:    240px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 6px -1px rgba(0,0,0,.1);
  --radius-sm:    8px;
  --radius:       12px;
  --font:         'Inter', system-ui, sans-serif;
  --font-heading: 'Montserrat', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
input, select, textarea, button { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Login ─── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #0f2040 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
  text-align: center;
}
.login-logo { width: 80px; height: 80px; border-radius: 16px; object-fit: cover; margin: 0 auto .75rem; display: block; }
.login-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .25rem;
}
.login-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }
.login-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  font-size: .85rem;
  margin-bottom: .75rem;
  text-align: left;
}
.login-back {
  display: block;
  margin-top: 1.25rem;
  font-size: .85rem;
  color: var(--text-muted);
}

/* ─── Admin Layout ─── */
.admin {
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  z-index: 50;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 1.5rem;
}
.sidebar__brand-name {
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar__brand-sub { font-size: .7rem; color: rgba(255,255,255,.4); }
.sidebar__nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .65rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: rgba(255,255,255,.55);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(29,78,216,.35); color: #93c5fd; }
.unread-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .5rem;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}
.sidebar__footer {
  padding: 1rem .75rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.btn-ghost {
  display: block;
  width: 100%;
  padding: .55rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.6);
  font-size: .825rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.btn-ghost--danger:hover { background: rgba(220,38,38,.2); color: #fca5a5; }

/* ─── Main Content ─── */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-header__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.admin-header__sub { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.admin-header__actions { display: flex; align-items: center; gap: 1rem; }
.save-status {
  font-size: .82rem;
  font-weight: 500;
  padding: .35rem .75rem;
  border-radius: 100px;
  transition: all .3s;
}
.save-status.saving  { background: #fef3c7; color: #92400e; }
.save-status.saved   { background: #dcfce7; color: #166534; }
.save-status.error   { background: #fef2f2; color: var(--danger); }

/* ─── Tab Panels ─── */
.tab-panel {
  display: none;
  padding: 2rem;
  flex: 1;
}
.tab-panel.active { display: block; }

/* ─── Cards ─── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.card__header .card__title { padding: 0; border: none; }
.card__meta { font-size: .82rem; color: var(--text-muted); }

/* ─── Form Elements ─── */
.form-grid {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.field-group { display: flex; flex-direction: column; gap: .4rem; }
.field-group--full { grid-column: 1 / -1; }
.field-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg-white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .875rem;
  padding: .6rem 1.25rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn--danger  { background: var(--danger); color: #fff; }
.btn--danger:hover  { background: #b91c1c; }
.btn--ghost   { background: var(--bg); border: 1.5px solid var(--border); color: var(--text-muted); }
.btn--ghost:hover { border-color: var(--text-muted); color: var(--text); }
.btn--sm { padding: .4rem .9rem; font-size: .78rem; }
.btn--full { width: 100%; justify-content: center; }

/* ─── List Editor (Services & Testimonials) ─── */
.list-editor { padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.list-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s;
}
.list-item:focus-within { border-color: var(--primary); }
.list-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--bg);
  cursor: pointer;
  gap: 1rem;
}
.list-item__header-left { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.list-item__icon { font-size: 1.3rem; flex-shrink: 0; }
.list-item__title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item__toggle { color: var(--text-muted); font-size: .8rem; transition: transform .2s; }
.list-item__toggle.open { transform: rotate(180deg); }
.list-item__body {
  display: none;
  padding: 1rem;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}
.list-item__body.open { display: block; }
.list-item__body .form-grid { padding: 0; }
.list-item__actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ─── Submissions ─── */
.submissions-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-size: .9rem;
}
.submission-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  transition: background .15s;
}
.submission-item:last-child { border-bottom: none; }
.submission-item.unread { background: #eff6ff; }
.submission-item:hover { background: var(--bg); }
.submission-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .4rem;
}
.submission-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.new-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.submission-date { font-size: .78rem; color: var(--text-muted); flex-shrink: 0; }
.submission-meta {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
}
.submission-message {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.65;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  margin-bottom: .75rem;
}
.submission-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
