/* ClinicKhoj admin panel */
:root { --navy: #081F4C; --blue: #0662E9; --line: #DCE4F0; --bg: #F4F7FB; --text: #2B3A5C; --muted: #5B6B8C; --red: #B02020; --green: #0A6B45; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
h1, h2 { margin: 0; color: var(--navy); line-height: 1.2; }
h1 { font-size: 24px; } h2 { font-size: 17px; margin-bottom: 12px; } h2 small { font-weight: 400; color: var(--muted); font-size: 13px; }
p { margin: 0 0 10px; } a { color: var(--blue); } small { color: var(--muted); } img { max-width: 100%; }
:focus-visible { outline: 3px solid #079EFF; outline-offset: 2px; }
.muted { color: var(--muted); }

.shell { display: grid; min-height: 100vh; }
.sidebar { background: var(--navy); color: #C9D8F5; }
.sidebar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; }
.sidebar__brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; }
.sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.sidebar nav a { padding: 9px 12px; border-radius: 8px; color: #C9D8F5; text-decoration: none; font-weight: 500; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar__foot { display: flex; gap: 14px; align-items: center; margin-left: auto; font-size: 13px; }
.sidebar__foot a { color: #9FD8FF; }
.sidebar__foot button { padding: 0; border: 0; background: none; color: #C9D8F5; font: inherit; text-decoration: underline; cursor: pointer; }
.content { padding: 20px 16px 60px; min-width: 0; }
.page-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1.5px solid var(--blue); border-radius: 9px; background: var(--blue); color: #fff; font: 600 14px/1 inherit; text-decoration: none; cursor: pointer; }
.btn:hover { background: #064DB9; }
.btn--ghost { background: #fff; color: var(--blue); border-color: #B9D4FA; }
.btn--ghost:hover { background: #F2FBFF; }
.btn--danger { background: #fff; color: var(--red); border-color: #E7B4B4; }
.btn--danger:hover { background: #FDECEC; }
.btn--small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.link-danger { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--red); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.flash--ok { background: #E5F6EE; color: var(--green); }
.flash--error { background: #FDECEC; color: var(--red); }
.flash--warn { background: #FFF4E0; color: #7A4E00; font-weight: 400; }

.panel { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.panel--danger { border-color: #F0C9C9; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.stats li { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.stats strong { display: block; font-size: 28px; color: var(--navy); line-height: 1.1; }
.stats span { font-size: 13px; color: var(--muted); }
.columns { display: grid; gap: 0 18px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); margin: 0; }
.row:first-of-type { border-top: 0; }
.howto { margin: 0; padding-left: 20px; } .howto li + li { margin-top: 6px; }
.quote { padding: 10px 14px; border-left: 3px solid var(--line); background: var(--bg); border-radius: 0 8px 8px 0; white-space: pre-line; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #E4EAF5; color: var(--navy); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--published, .badge--listed { background: #E5F6EE; color: var(--green); }
.badge--draft, .badge--closed { background: #EEF0F4; color: #55607A; }
.badge--new { background: #FFF1D6; color: #8A5A00; }
.badge--contacted { background: #E1EEFF; color: #064DB9; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; vertical-align: top; }
th { background: #F7F9FC; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr + tr { border-top: 1px solid var(--line); }
td.actions { white-space: nowrap; } td.actions a + a { margin-left: 10px; } td.actions form { display: inline-block; margin-right: 4px; }
td input[type="text"], td input[type="number"], td select { width: 100%; min-width: 80px; }
td select { min-width: 140px; }
td:first-child input[type="text"] { min-width: 150px; }
.inline-form .labelled { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--navy); }
.inline-form .labelled input[type="number"] { width: 90px; }
.inline-form { align-items: flex-end; }
.inline-form label.inline { min-height: 40px; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="search"], input[type="file"], select, textarea {
  min-height: 40px; padding: 8px 12px; border: 1.5px solid #C5D0E2; border-radius: 9px; background: #fff; font: inherit; color: var(--navy); max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(7, 158, 255, .3); }
.filters, .inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.inline-form h2 { flex-basis: 100%; margin-bottom: 0; }
.inline-form .grow { flex: 1; min-width: 180px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
label.inline input[type="number"] { width: 76px; }

.form h2 { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.form h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form__grid { display: grid; gap: 14px 18px; }
.form--narrow { max-width: 460px; } .form--narrow .f { margin-bottom: 14px; }
.f label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13.5px; color: var(--navy); }
.f label b { color: var(--red); }
.f input, .f select, .f textarea { width: 100%; }
.f small { display: block; margin-top: 4px; font-size: 12.5px; }
.f--error input, .f--error select, .f--error textarea { border-color: var(--red); }
.f__error { color: var(--red); font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks--stack { flex-direction: column; align-self: center; }
.checks label { display: inline-flex; align-items: center; gap: 7px; }
.f .check-line { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; line-height: 1.45; }
.f .check-line input { flex: none; width: auto; margin-top: 3px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
.form__actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; margin-bottom: 16px; border: 1.5px dashed #B9D4FA; border-radius: 12px; background: #F7FBFF; }
.upload label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; color: var(--navy); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.photo-grid li { position: relative; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.photo-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--bg); }
.photo-grid .badge { position: absolute; top: 16px; left: 16px; }
.photo-grid li, .photo-grid form { min-width: 0; }
.photo-grid form { display: grid; gap: 6px; }
.photo-grid form > select, .photo-grid form > input[type="text"], .photo-grid form > .btn { width: 100%; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.tags li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; }
.tags button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--red); font-size: 16px; line-height: 1; cursor: pointer; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pagination__item { padding: 8px 16px; border: 1.5px solid #B9D4FA; border-radius: 9px; background: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.pagination__item.is-disabled { color: #9AA7C2; border-color: var(--line); }

body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: linear-gradient(160deg, #F2FBFF, #E4F3FF); }
.auth__card { width: min(100%, 400px); padding: 30px 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(8, 31, 76, .12); }
.auth__card h1 { margin: 18px 0 16px; font-size: 21px; }
.auth__card label { display: block; margin: 12px 0 5px; font-weight: 600; font-size: 13.5px; color: var(--navy); }
.auth__card input { width: 100%; }
.auth__card .btn { width: 100%; margin-top: 18px; }

@media (min-width: 720px) {
  .form__grid { grid-template-columns: 1fr 1fr; }
  .form__wide { grid-column: 1 / -1; }
  .columns { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .shell { grid-template-columns: 232px 1fr; }
  .sidebar__inner { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 18px; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
  .sidebar__brand { flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 8px; }
  .sidebar nav { flex-direction: column; }
  .sidebar__foot { flex-direction: column; align-items: flex-start; gap: 10px; margin: auto 0 0; padding: 0 8px; }
  .content { padding: 28px 32px 60px; }
}
.inline-form > p.muted { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; }
.upload--inline { margin-bottom: 8px; }
