/* DentEngine — ადმინ პანელის სტილი */
:root {
  --brand: #0E7C7B;
  --brand-deep: #0A5C5B;
  --accent: #28B5B5;
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2a2e;
  --muted: #6b7b80;
  --line: #e3e8ea;
  --ok: #2E9E6B;
  --warn: #C9883B;
  --err: #C0533F;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Noto Sans Georgian", "Noto Sans Armenian", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }

/* ---------- აპლიკაციის კარკასი ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #eafdfd;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 6px 20px; }
.brand img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: #fff; }
.brand-mark { font-size: 30px; }
.brand-text strong { display: block; font-size: 16px; }
.brand-text small { opacity: .8; font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.nav a, .nav-soon {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.12); }
.nav a.active { background: rgba(255,255,255,.20); font-weight: 600; }
.nav-soon { opacity: .55; cursor: default; }

.sidebar-foot { margin-top: auto; }
.logout {
  display: block; padding: 10px 12px; border-radius: 10px;
  background: rgba(0,0,0,.18); text-align: center; font-size: 14px;
}
.logout:hover { background: rgba(0,0,0,.30); }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 20px; font-weight: 600; }
.page { padding: 28px; }

/* ---------- flash ---------- */
.flashes { padding: 0 28px; }
.auth-card .flashes, .page .flashes { padding: 0; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.flash-success { background: #e6f6ee; color: #1c6b46; }
.flash-error   { background: #fbe9e5; color: #8a2f1e; }
.flash-warning { background: #fdf2e2; color: #8a5a18; }

/* ---------- ბარათები ---------- */
.welcome h2 { margin: 0 0 6px; }
.welcome p { color: var(--muted); margin: 0 0 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; display: flex; align-items: center; gap: 14px; position: relative;
}
.card-icon { font-size: 28px; }
.card-body strong { display: block; }
.card-body small { color: var(--muted); }
.badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: #fff; font-size: 11px;
  padding: 2px 8px; border-radius: 999px;
}

.status-note {
  margin-top: 28px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 24px;
}
.status-note h3 { margin: 0 0 12px; }
.status-note ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.9; }

/* ---------- ენის გადამრთველი ---------- */
.lang-switcher { position: relative; }
.lang-current {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-size: 14px; display: flex; gap: 6px; align-items: center;
}
.lang-current span { color: var(--muted); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px;
  list-style: none; margin: 0; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .15s; z-index: 30;
}
.lang-switcher:hover .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.lang-menu li a:hover { background: var(--bg); }
.lang-menu li.is-active a { font-weight: 600; color: var(--brand); }

/* ---------- ავტორიზაცია ---------- */
body.auth {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-topbar { position: fixed; top: 18px; right: 18px; }
.auth-topbar .lang-current { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.auth-topbar .lang-current span { color: rgba(255,255,255,.8); }
.auth-card {
  background: #fff; border-radius: 18px; padding: 36px 34px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { font-size: 44px; }
.auth-brand h1 { margin: 8px 0 2px; font-size: 22px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.auth-form input[type=text], .auth-form input[type=password] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px;
}
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(40,181,181,.15); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.btn-primary {
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.btn-primary:hover { background: var(--brand-deep); }

/* ---------- ღილაკები ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.btn:hover { background: var(--bg); }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-deep); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-danger { color: var(--err); border-color: #f0cabf; }
.btn-danger:hover { background: #fbe9e5; }
.btn-link { border: none; background: none; color: var(--brand); padding: 4px; }

/* ---------- ხელსაწყოთა ზოლი ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { display: flex; gap: 8px; }
.search input { padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; min-width: 240px; }

/* ---------- ცხრილი ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); }
table.grid th { background: #fafcfc; color: var(--muted); font-weight: 600; font-size: 13px; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: #fafcfc; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.muted { color: var(--muted); }
.right { text-align: end; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- სტატუს-ნიშნაკები ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill-on { background: #e6f6ee; color: #1c6b46; }
.pill-off { background: #f0f0f0; color: #888; }
.pill-info { background: #e4f3f3; color: #0a5c5b; }
.pill-warn { background: #fdf2e2; color: #8a5a18; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eef4f4; border-radius: 999px; padding: 3px 10px; font-size: 12px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: var(--accent); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 600;
}

/* ---------- ფორმები ---------- */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; max-width: 920px; }
.form-section { margin-bottom: 26px; }
.form-section h3 { margin: 0 0 14px; font-size: 15px; color: var(--brand-deep); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=number], .field input[type=date], .field input[type=color],
.field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit;
}
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(40,181,181,.15);
}
.field-check { display: flex; align-items: center; gap: 8px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; background: var(--bg); padding: 8px 10px; border-radius: 8px; }

.def-list { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; font-size: 14px; }
.def-list dt { color: var(--muted); }
.def-list dd { margin: 0; }
.section-title { margin: 26px 0 12px; font-size: 16px; }
.med-block { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; margin-bottom: 16px; }
.med-block h3 { margin: 0 0 10px; font-size: 15px; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- სტატისტიკის ბარათები ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--brand-deep); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- ფასის preview ---------- */
.price-box { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.price-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
.price-chip b { display: block; font-size: 18px; }
.price-chip.patient { background: #e4f3f3; border-color: #bfe3e3; }
.price-chip.insurer { background: #fdf2e2; border-color: #f0dcb8; }

/* ---------- კალენდარი ---------- */
#calendar { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.fc .fc-button-primary { background: var(--brand); border-color: var(--brand); }
.fc .fc-button-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--brand-deep); border-color: var(--brand-deep); }
.fc-event { cursor: pointer; }

/* ---------- გადახდის მოდალი ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 420px; }
.modal h3 { margin: 0 0 16px; }

/* ---------- პაციენტის tab-ები ---------- */
.ptabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.ptabs a { padding: 10px 16px; border-radius: 10px 10px 0 0; font-size: 14px; color: var(--muted); border: 1px solid transparent; border-bottom: none; }
.ptabs a:hover { background: var(--bg); color: var(--ink); }
.ptabs a.active { background: var(--card); color: var(--brand-deep); font-weight: 600; border-color: var(--line); margin-bottom: -1px; }

/* ---------- ოდონტოგრამა ---------- */
.odontogram { padding: 10px 0; }
.jaw { display: flex; gap: 24px; justify-content: center; }
.quad { display: flex; gap: 4px; }
.jaw-divider { height: 1px; background: var(--line); margin: 10px auto; max-width: 560px; }
.tooth {
  width: 40px; height: 54px; border: 1px solid #b9c4c7; border-radius: 6px 6px 8px 8px;
  cursor: pointer; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 4px; position: relative; transition: transform .1s;
}
.tooth:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.tooth-num { font-size: 11px; font-weight: 600; color: #33444a; background: rgba(255,255,255,.7); padding: 0 3px; border-radius: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.legend-dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #b9c4c7; }

/* ---------- დოკუმენტები ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.doc-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.doc-thumb { display: flex; align-items: center; justify-content: center; height: 150px; background: var(--bg); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-icon { font-size: 18px; font-weight: 600; color: var(--err); }
.doc-meta { padding: 12px 14px; }

/* ---------- საჯარო გვერდი (landing) ---------- */
body.site { background: #fff; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.site-header {
  display: flex; align-items: center; gap: 20px; padding: 14px 28px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px); z-index: 20; flex-wrap: wrap;
}
.site-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.site-brand img { height: 38px; border-radius: 8px; }
.site-nav { display: flex; gap: 18px; margin-left: 10px; }
.site-nav a { color: var(--muted); font-size: 15px; }
.site-nav a:hover { color: var(--brand); }
.site-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  background-size: cover; background-position: center; color: #fff; text-align: center;
  padding: 110px 24px;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 42px; margin: 0 0 14px; }
.hero p { font-size: 19px; opacity: .92; margin: 0 0 28px; }

.site-section { max-width: 1080px; margin: 0 auto; padding: 56px 24px; }
.site-section h2 { font-size: 30px; text-align: center; margin: 0 0 28px; }
.site-section.about { text-align: center; max-width: 760px; }
.site-section.about p { color: var(--muted); font-size: 17px; line-height: 1.7; }
.cat-title { color: var(--brand-deep); margin: 22px 0 12px; }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.srv-card { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.srv-card strong { color: var(--brand); white-space: nowrap; }

.doc-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.team-card { text-align: center; }
.team-card img, .team-avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; font-weight: 600;
}
.team-card strong { display: block; }
.team-card small { color: var(--muted); }

.branch-grid, .news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.branch-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 20px; line-height: 1.9; }
.branch-card strong { display: block; font-size: 17px; margin-bottom: 6px; }
.news-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.news-card img { width: 100%; height: 160px; object-fit: cover; }
.news-body { padding: 16px 18px; }
.news-body h3 { margin: 6px 0 8px; }
.news-body p { color: var(--muted); font-size: 14px; margin: 0; }

.site-footer { background: var(--brand-deep); color: #eafdfd; padding: 40px 24px 24px; }
.footer-cols { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; line-height: 1.9; }
.site-footer .muted { color: rgba(255,255,255,.7); }
.footer-bottom { max-width: 1080px; margin: 28px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); text-align: center; font-size: 13px; }

/* ---------- რესპონსივი ---------- */
@media (max-width: 720px) {
  .form-grid, .detail-cols { grid-template-columns: 1fr; }
  .jaw { gap: 8px; }
  .tooth { width: 30px; height: 42px; }
  .site-nav { display: none; }
  .hero h1 { font-size: 30px; }
  .def-list { grid-template-columns: 1fr; gap: 2px 0; }
  .def-list dt { margin-top: 8px; }
}
/* ---------- რესპონსივი (კარკასი) ---------- */
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0 0 0 auto; }
}
