﻿/* DentSide — additional view styles */

/* ════════════ AI SPINNER ════════════ */
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ════════════ STOCK TABLE ════════════ */
.stock-table { min-width: 900px; }
.stock-row {
  display: grid;
  grid-template-columns: 180px 1fr 55px 110px 120px 120px 150px 110px 120px 36px;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  min-height: 42px;
  font-size: 12.5px;
}
.stock-row > span { padding: 8px 6px; }
.stock-row--head {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 36px;
  border-bottom: 1px solid var(--line-strong);
}
.stock-row--odeme { background: oklch(0.98 0.005 150 / 0.4); }
.stock-row:last-child { border-bottom: none; }
.stock-firma { font-weight: 600; color: var(--ink); font-size: 12px; }
.stock-malzeme { color: var(--text); }

/* ════════════ CLINIC CARDS ════════════ */
.clinic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.clinic-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .12s, box-shadow .12s;
  text-align: left;
}
.clinic-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.clinic-card__top {
  height: 84px;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px;
}
.clinic-card__mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.clinic-card__body {
  padding: 4px 18px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.clinic-card__name { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -0.015em; }
.clinic-card__loc { font-size: 12.5px; color: var(--text-mute); display: flex; align-items: center; gap: 5px; }
.clinic-card__contract { font-size: 12.5px; display: flex; gap: 6px; }
.clinic-card__contract span:first-child { color: var(--text-mute); }
.clinic-card__stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.clinic-stat { display: flex; flex-direction: column; gap: 4px; }
.clinic-stat__l { font-size: 10.5px; color: var(--text-mute); }
.clinic-stat__v { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.clinic-card__contact {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text);
}
.clinic-card__actions { display: flex; gap: 6px; margin-top: 4px; }

.clinic-card--add {
  background: transparent;
  border: 1.5px dashed var(--line-strong);
  display: grid; place-items: center;
  min-height: 360px;
  text-align: center;
  color: var(--text-mute);
}
.clinic-card--add:hover { border-color: var(--accent); color: var(--accent); }
.add-clinic { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; }
.add-clinic span:first-of-type { font-size: 14px; font-weight: 600; }

/* ════════════ FINANCE ════════════ */
.fin-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.fin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.fin-card::before {
  content: "";
  position: absolute; right: -40px; top: -40px;
  width: 140px; height: 140px;
  border-radius: 100%;
  opacity: .07;
}
.fin-card--mint::before { background: var(--mint); }
.fin-card--blue::before { background: var(--accent); }
.fin-card--coral::before { background: var(--coral); }
.fin-card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  margin-bottom: 14px;
}
.fin-card__icon--mint { background: linear-gradient(135deg, var(--mint), color-mix(in oklch, var(--mint), white 18%)); }
.fin-card__icon--blue { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.fin-card__icon--coral { background: linear-gradient(135deg, var(--coral), color-mix(in oklch, var(--coral), white 18%)); }
.fin-card__label { font-size: 12.5px; color: var(--text-mute); margin-bottom: 8px; }
.fin-card__value { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; line-height: 1; margin-bottom: 6px; }
.fin-card__sub { font-size: 12px; }

.fin-clinic-bars { padding: 8px 24px 24px; display: flex; flex-direction: column; gap: 18px; }
.fin-clinic-row {}
.fin-clinic-row__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.fin-clinic-row__name { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fin-clinic-row__total { font-size: 14px; font-weight: 700; color: var(--ink); }
.fin-bar {
  display: flex;
  height: 10px;
  background: var(--surface-2);
  border-radius: 5px;
  overflow: hidden;
}
.fin-bar__paid, .fin-bar__pending { height: 100%; }
.fin-clinic-row__legend {
  display: flex; gap: 10px; align-items: center;
  font-size: 11.5px; color: var(--text-mute);
  margin-top: 6px;
}
.fin-clinic-row__legend b { color: var(--ink); }
.dot-sep { opacity: .5; }

.fin-trans {}
.fin-trans__row {
  display: grid;
  grid-template-columns: 100px 1.2fr 1.6fr 1.3fr 100px 100px 110px;
  gap: 12px;
  align-items: center;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.fin-trans__row--head {
  background: var(--surface-2);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-mute); font-weight: 600;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
}

/* ════════════ SCHEDULE ════════════ */
.cal-clinic-key {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.cal-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }

.cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-top: 1px solid var(--line);
}
.cal-hour-col { border-right: 1px solid var(--line); }
.cal-day-head {
  height: 60px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
}
.cal-day { border-right: 1px solid var(--line); position: relative; }
.cal-day:last-child { border-right: none; }
.cal-day__name { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.cal-day__date {
  font-family: "JetBrains Mono", monospace;
  font-size: 17px; font-weight: 700; color: var(--ink);
}
.cal-day__date.is-today {
  background: var(--accent); color: #fff;
  width: 28px; height: 28px; border-radius: 100%;
  display: grid; place-items: center; margin: 0 auto;
}
.cal-day.is-today .cal-day-head { background: color-mix(in oklch, var(--accent), white 96%); }

.cal-hour {
  height: 56px; padding: 6px 8px;
  font-size: 10.5px; color: var(--text-mute);
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
}
.cal-day-body { position: relative; }
.cal-slot { height: 56px; border-bottom: 1px solid var(--line); }

.cal-event {
  position: absolute;
  left: 4px; right: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  text-align: left;
  background: transparent;
  border: none;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.cal-event:hover { transform: scale(1.02); box-shadow: var(--shadow); z-index: 2; }
.cal-event__time { font-family: "JetBrains Mono", monospace; font-size: 10.5px; font-weight: 700; color: var(--ink); }
.cal-event__patient { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event__procedure { font-size: 11px; color: var(--text); opacity: 0.78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ════════════ TREATMENTS ════════════ */
.tx-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}
.catalog { display: flex; flex-direction: column; margin-top: 14px; }
.catalog-row {
  display: grid;
  grid-template-columns: 60px 1fr 90px;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.catalog-row:first-child { border-top: none; }
.catalog-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  background: var(--surface-2);
  color: var(--text-mute);
  padding: 3px 7px; border-radius: 5px;
  font-weight: 600;
  text-align: center;
}
.catalog-name { color: var(--ink); font-weight: 500; }

.tx-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.tx-row {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.4fr;
  gap: 16px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 13px 16px;
}
.tx-row__name { font-size: 13px; font-weight: 600; color: var(--ink); }
.tx-row__sub { font-size: 11.5px; }
.tx-prog { display: flex; flex-direction: column; gap: 4px; }
.tx-prog__bar { height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.tx-prog__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.tx-next { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }

/* ════════════ REPORTS ════════════ */
.rep-overview {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

/* Chart with Y-axis + grid lines */
.rep-chart-area {
  display: flex;
  height: 200px;
  margin: 16px 0 10px;
}
.rep-y-axis {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 10px;
}
.rep-y-lbl {
  font-size: 10px;
  color: var(--text-mute);
  line-height: 1;
}
.rep-chart-body {
  flex: 1;
  position: relative;
  border-left: 1px solid var(--line-strong);
  border-bottom: 1.5px solid var(--line-strong);
}
.rep-grid-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.rep-bars-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 4px 20px 0;
  gap: 10px;
}
.rep-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 8px;
}
.rep-bar-stack {
  width: 100%;
  max-width: 56px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 4px;
  transition: opacity .15s;
}
.rep-bar-stack:hover { opacity: .82; }
.rep-bar__lbl {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}
.rep-bar__name { font-size: 11px; color: var(--text); font-weight: 500; text-align: center; }
.rep-legend { display: flex; justify-content: center; gap: 18px; font-size: 11.5px; color: var(--text-mute); margin-top: 10px; }
.rep-legend span { display: inline-flex; align-items: center; gap: 6px; }

.rep-summary { list-style: none; padding: 0; margin: 14px 0 0; }
.rep-summary li {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.rep-summary li:first-child { border-top: none; }
.rep-summary li span { color: var(--text-mute); }
.rep-summary li b { color: var(--ink); font-weight: 700; }

.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.rep-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.rep-card:hover { background: var(--surface-3); }
.rep-card__icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--accent), white 88%);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.rep-card__main { flex: 1; min-width: 0; }
.rep-card__title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 3px; }
.rep-card__desc { font-size: 11.5px; color: var(--text-mute); margin: 0 0 8px; line-height: 1.4; }
.rep-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rep-card__fmts { display: flex; gap: 4px; }

/* ════════════ SETTINGS ════════════ */
.settings-layout { display: flex; flex-direction: column; gap: 16px; }
.settings-form { margin-top: 16px; }
.settings-form__foot { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-pref-list { margin-top: 14px; display: flex; flex-direction: column; gap: 0; }
.settings-pref {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 16px;
  border-top: 1px solid var(--line);
}
.settings-pref:first-child { border-top: none; }
.settings-pref__label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.settings-pref__desc { font-size: 11.5px; color: var(--text-mute); }

/* Toggle button */
.toggle-btn {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--line-strong); border: none; cursor: pointer;
  position: relative; flex-shrink: 0;
  transition: background .2s;
}
.toggle-btn.is-on { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-btn.is-on .toggle-thumb { left: 21px; }

/* ════════════ HELP ════════════ */
.help-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.help-step {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.help-step__num {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: color-mix(in oklch, var(--accent), white 88%);
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 10px;
}
.help-step__icon { font-size: 22px; margin-bottom: 8px; }
.help-step__title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.help-step__desc { font-size: 11.5px; color: var(--text-mute); line-height: 1.5; }

.help-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.faq-list { margin-top: 14px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:first-child { border-top: none; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 13px 0; background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink); text-align: left;
}
.faq-q:hover { color: var(--accent); }
.faq-q svg { flex-shrink: 0; transition: transform .2s; }
.faq-item.is-open .faq-q svg { transform: rotate(180deg); }
.faq-a {
  font-size: 12.5px; color: var(--text-mute); line-height: 1.6;
  padding-bottom: 14px;
}

.changelog-list { margin-top: 14px; display: flex; flex-direction: column; gap: 0; }
.changelog-item { padding: 14px 0; border-top: 1px solid var(--line); }
.changelog-item:first-child { border-top: none; }
.changelog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.changelog-ver { font-size: 12px; font-weight: 700; color: var(--accent); background: color-mix(in oklch, var(--accent), white 88%); padding: 2px 8px; border-radius: 20px; }
.changelog-date { font-size: 11.5px; color: var(--text-mute); }
.changelog-changes { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.changelog-changes li { font-size: 12.5px; color: var(--text); line-height: 1.5; }

/* Placeholder */
.placeholder {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 80px 40px;
  text-align: center;
  color: var(--text-mute);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

/* Compact density tweaks */
[data-density="compact"] .kpi { padding: 14px; }
[data-density="compact"] .pt-row { padding: 10px 14px; }
[data-density="compact"] .content { padding: 20px 24px 40px; }
[data-density="compact"] .page-title { font-size: 20px; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }
::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sb-line); }

/* Responsive narrowing */
@media (max-width: 1280px) {
  .view--split { grid-template-columns: 1fr 400px; }
  .span-7 { grid-column: span 12; }
  .span-5 { grid-column: span 12; }
}
