/* ===== Admin panel styles — Dr. Moges ===== */
:root {
  --teal: #0a5f67;
  --teal-d: #083f44;
  --teal-l: #dcefed;
  --ink: #17252b;
  --muted: #6a7b83;
  --line: #e4ecee;
  --bg: #f4f8f8;
  --white: #ffffff;
  --red: #c0392b;
  --green: #1d6b43;
  --amber: #9a6700;
  --radius: 14px;
  --shadow: 0 12px 34px rgba(8, 63, 68, 0.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--bg);
  display: flex; min-height: 100vh;
}
svg { display: block; }
a { color: var(--teal); text-decoration: none; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin-bottom: 1rem; }

/* ---------- Login (full screen, no sidebar) ---------- */
.login-page { display: block; background: linear-gradient(160deg, var(--teal-d), var(--teal)); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  width: min(420px, 100%); background: var(--white); border-radius: 20px;
  box-shadow: var(--shadow); padding: 2.6rem 2.6rem 2.4rem;
}
.login-card .sidebar__brand { margin-bottom: 1.8rem; }
.login-card h1 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.login-card .login-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px; flex: none; background: var(--teal-d); color: #d7eef0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 0.65rem; padding: 1.3rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 700; font-size: 1.05rem; color: #fff; line-height: 1.15;
}
.sidebar__brand small { display: block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #8ad4d8; }
.sidebar__mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), #1296a0); color: #fff;
}
.sidebar__mark svg { width: 22px; height: 22px; }
.sidebar__mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.sidebar__mark--logo { border-radius: 50%; overflow: hidden; }
.sidebar__mark--logo img { border-radius: 50%; object-fit: cover; }

.photo-preview--logo {
  width: 120px; height: 120px; max-width: 120px; max-height: 120px;
  border-radius: 50%; object-fit: cover;
}
.sidebar__nav { padding: 1rem 0.75rem; flex: 1; overflow-y: auto; }
.sidebar__nav a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.62rem 0.8rem; margin-bottom: 2px;
  border-radius: 10px; color: #c9e9ea; font-weight: 500; font-size: 0.92rem;
  transition: background 0.2s, color 0.2s;
}
.sidebar__nav a svg { width: 18px; height: 18px; flex: none; }
.sidebar__nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar__nav a.is-active { background: var(--teal); color: #fff; }
.sidebar__foot { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); display: flex; gap: 1.2rem; font-size: 0.85rem; }
.sidebar__foot a { color: #8ad4d8; font-weight: 600; }
.sidebar__foot a:hover { color: #fff; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; padding-bottom: 3rem; }
.main__top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 2rem; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.main__crumb { color: var(--muted); font-size: 0.85rem; }
.main__body { padding: 2rem; max-width: 1100px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem; border-radius: 999px;
  font-weight: 600; font-size: 0.88rem; border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { box-shadow: 0 8px 18px rgba(10,95,103,0.3); }
.btn--ghost { background: var(--white); color: var(--teal); border-color: var(--teal); }
.btn--danger { background: var(--white); color: var(--red); border-color: #e6b0aa; }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn--xs { padding: 0.3rem 0.65rem; font-size: 0.78rem; }

/* ---------- Alert ---------- */
.alert { margin: 1.5rem 2rem 0; padding: 0.9rem 1.2rem; border-radius: var(--radius); font-size: 0.92rem; font-weight: 500; }
.alert--success { background: #eaf7f0; color: var(--green); border: 1px solid #bfe8d2; }
.alert--error { background: #fdecea; color: var(--red); border: 1px solid #f3c1bb; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.stat-card strong { font-size: 1.7rem; color: var(--teal); display: block; line-height: 1.2; }
.stat-card span { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat-card em { font-style: normal; font-size: 0.82rem; color: var(--teal); font-weight: 600; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; margin-bottom: 1.5rem; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #eef6f6; color: var(--teal-d); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; }
.table .muted { color: var(--muted); font-size: 0.85rem; }

.badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.badge--pending { background: #fdf3e2; color: var(--amber); }
.badge--confirmed { background: #eaf7f0; color: var(--green); }
.badge--cancelled { background: #fdecea; color: var(--red); }
.badge--active { background: #eaf7f0; color: var(--green); }
.badge--inactive { background: #eef1f3; color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--teal-d); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fbfdfd; font: inherit; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-l);
}
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.day-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.day-picker__item {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.85rem; border: 1.5px solid var(--line); border-radius: 999px;
  background: #fbfdfd; cursor: pointer; font-weight: 500; font-size: 0.88rem;
  transition: all 0.15s;
}
.day-picker__item input { width: auto; margin: 0; accent-color: var(--teal); }
.day-picker__item:has(input:checked) { background: var(--teal-l); border-color: var(--teal); color: var(--teal-d); }

.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 0.5rem; margin-top: 0.4rem; }
.icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker label {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fbfdfd;
  color: var(--teal); cursor: pointer; transition: all 0.15s;
}
.icon-picker label svg { width: 22px; height: 22px; }
.icon-picker input:checked + label { background: var(--teal-l); border-color: var(--teal); }
.icon-preview { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--teal-l); color: var(--teal); }
.icon-preview svg { width: 18px; height: 18px; }

/* ---------- Row forms (edit inline) ---------- */
.rowform { background: var(--teal-l); border: 1px dashed var(--teal); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.5rem; }
.rowform h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--teal-d); }

/* ---------- Appointment list ---------- */
.filter-bar { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.filter-bar select, .filter-bar input { padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); font: inherit; }
.msg-block { white-space: pre-wrap; max-width: 360px; }

/* ---------- Site photos & gallery manager ---------- */
.photo-preview {
  display: block; max-width: 240px; max-height: 170px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line); margin-bottom: 0.6rem;
}
.checkline {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--ink); margin: 0.35rem 0; cursor: pointer;
}
.checkline input { width: auto; margin: 0; accent-color: var(--teal); }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery-admin__item {
  border: 1px solid var(--line); border-radius: 12px;
  background: #fbfdfd; padding: 0.8rem;
}
.gallery-admin__item img {
  width: 100%; height: 150px; object-fit: cover;
  border-radius: 8px; margin-bottom: 0.7rem;
}
.gallery-admin__item .field { margin-bottom: 0.5rem; }
.gallery-admin__item .field label { margin-bottom: 0.2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar__nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.25rem; }
  .main__top { flex-wrap: wrap; }
  .main__body { padding: 1.25rem; }
}