/* PhiPaveOne – Klickbares Demo-Mockup (read-only).
   Self-contained. Ahmt den Tailwind/Teal-Look der echten App nach.
   Alle Daten sind frei erfunden. */

:root {
  --teal-50:  #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --stone-50: #fafaf9;
  --emerald-50: #ecfdf5;
  --emerald-600: #059669;
  --amber-50: #fffbeb;
  --amber-600: #d97706;
  --red-50: #fef2f2;
  --red-600: #dc2626;
  --blue-50: #eff6ff;
  --blue-600: #2563eb;
  --purple-50: #faf5ff;
  --purple-600: #9333ea;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 25px -5px rgba(15,23,42,.10), 0 8px 10px -6px rgba(15,23,42,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--slate-800);
  background: linear-gradient(135deg, var(--teal-50) 0%, #ffffff 50%, var(--stone-50) 100%);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--slate-200);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-head {
  padding: 1.5rem;
  border-bottom: 1px solid var(--slate-200);
}
.sidebar-head h2 { font-size: 1.25rem; font-weight: 800; color: var(--slate-800); }
.sidebar-head p { font-size: .75rem; color: var(--slate-500); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 1rem; }
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: none;
  background: none;
  border-radius: .5rem;
  font: inherit;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  text-align: left;
  transition: all .2s;
}
.nav-item:hover { background: var(--slate-50); color: var(--slate-800); }
.nav-item.active { background: var(--teal-50); color: var(--teal-700); box-shadow: var(--shadow-sm); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-foot {
  padding: 1rem;
  border-top: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.sidebar-copy { font-size: .75rem; color: var(--slate-400); text-align: center; }

/* ---------- Content ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.demo-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  background: var(--amber-50);
  color: var(--amber-600);
  border-bottom: 1px solid #fde68a;
  font-size: .8rem;
  font-weight: 600;
  padding: .5rem 1rem;
}
.demo-bar svg { width: 15px; height: 15px; }
.page { padding: 2rem; flex: 1; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; color: var(--slate-800); }
.page-head p { color: var(--slate-500); margin-top: .25rem; }

.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Cards & grids ---------- */
.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: .75rem;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card h3 { font-size: 1rem; font-weight: 700; color: var(--slate-800); margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.card h3 svg { width: 18px; height: 18px; color: var(--teal-600); }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mt { margin-top: 1.25rem; }

/* KPI cards */
.kpi { display: flex; flex-direction: column; gap: .35rem; }
.kpi .label { font-size: .8rem; color: var(--slate-500); display: flex; align-items: center; gap: .4rem; }
.kpi .label svg { width: 16px; height: 16px; }
.kpi .value { font-size: 1.75rem; font-weight: 800; color: var(--slate-800); }
.kpi .sub { font-size: .75rem; color: var(--slate-400); }
.kpi.accent-teal .value { color: var(--teal-600); }
.kpi.accent-emerald .value { color: var(--emerald-600); }
.kpi.accent-amber .value { color: var(--amber-600); }

/* Progress */
.progress { height: 10px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); border-radius: 999px; }
.progress-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--slate-500); margin-bottom: .4rem; }

/* Quick-action cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: .75rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--teal-200); }
.feature .ico { width: 42px; height: 42px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; margin-bottom: .75rem; }
.feature .ico svg { width: 22px; height: 22px; }
.feature h4 { font-size: .95rem; font-weight: 700; color: var(--slate-800); }
.feature p { font-size: .8rem; color: var(--slate-500); margin-top: .25rem; }
.ico.teal   { background: var(--teal-50);    color: var(--teal-600); }
.ico.emerald{ background: var(--emerald-50); color: var(--emerald-600); }
.ico.blue   { background: var(--blue-50);    color: var(--blue-600); }
.ico.purple { background: var(--purple-50);  color: var(--purple-600); }
.ico.amber  { background: var(--amber-50);   color: var(--amber-600); }
.ico.red    { background: var(--red-50);     color: var(--red-600); }

/* ---------- Tables ---------- */
.table-wrap { background: #fff; border: 1px solid var(--slate-200); border-radius: .75rem; box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--slate-500);
  font-weight: 700;
  padding: .85rem 1rem;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; transition: background .15s; }
tbody tr.clickable:hover { background: var(--teal-50); }
.muted { color: var(--slate-400); }
.strong { font-weight: 600; color: var(--slate-800); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; }
.badge.paid { background: var(--emerald-50); color: var(--emerald-600); }
.badge.open { background: var(--amber-50); color: var(--amber-600); }
.badge.teal { background: var(--teal-50); color: var(--teal-700); }
.badge.blue { background: var(--blue-50); color: var(--blue-600); }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--slate-200); border-radius: .6rem;
  padding: .55rem .8rem; color: var(--slate-400); flex: 1; max-width: 320px;
}
.search svg { width: 16px; height: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1rem; border-radius: .6rem; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; transition: all .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-ghost { background: #fff; color: var(--slate-600); border-color: var(--slate-200); }
.btn-ghost:hover { background: var(--slate-50); }
.spacer { flex: 1; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cal-nav { display: flex; gap: .35rem; }
.icon-btn { width: 34px; height: 34px; border-radius: .5rem; border: 1px solid var(--slate-200); background: #fff; color: var(--slate-600); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--slate-50); }
.icon-btn svg { width: 16px; height: 16px; }
.cal-title { font-weight: 700; color: var(--slate-800); }
.calendar { background: #fff; border: 1px solid var(--slate-200); border-radius: .75rem; box-shadow: var(--shadow); overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(5, 1fr); }
.cal-grid > div { border-right: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); }
.cal-corner { background: var(--slate-50); }
.cal-day { background: var(--slate-50); text-align: center; padding: .65rem .25rem; font-weight: 700; color: var(--slate-700); font-size: .82rem; }
.cal-day span { display: block; font-size: .72rem; font-weight: 500; color: var(--slate-400); }
.cal-time { font-size: .72rem; color: var(--slate-400); text-align: right; padding: .35rem .5rem; height: 56px; }
.cal-cell { height: 56px; position: relative; padding: 3px; }
.appt {
  border-radius: .4rem; padding: .35rem .5rem; height: 100%; font-size: .72rem; cursor: pointer;
  border-left: 3px solid; overflow: hidden; transition: filter .15s;
}
.appt:hover { filter: brightness(.97); }
.appt .who { font-weight: 700; }
.appt .meta { opacity: .8; }
.appt.t1 { background: var(--teal-50);    border-color: var(--teal-600);    color: var(--teal-700); }
.appt.t2 { background: var(--blue-50);    border-color: var(--blue-600);    color: var(--blue-600); }
.appt.t3 { background: var(--purple-50);  border-color: var(--purple-600);  color: var(--purple-600); }
.appt.t4 { background: var(--emerald-50); border-color: var(--emerald-600); color: var(--emerald-600); }

/* ---------- Bar chart ---------- */
.chart { display: flex; align-items: flex-end; gap: .85rem; height: 200px; padding-top: 1rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; justify-content: flex-end; }
.bar { width: 70%; max-width: 38px; border-radius: .35rem .35rem 0 0; background: linear-gradient(180deg, var(--teal-500), var(--teal-600)); transition: opacity .2s; }
.bar-col span { font-size: .72rem; color: var(--slate-500); }
.bar-col .amt { font-size: .68rem; color: var(--slate-400); }

/* ---------- Detail panel / modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.4);
  display: none; align-items: center; justify-content: center; padding: 1.5rem; z-index: 50;
  backdrop-filter: blur(2px);
}
.overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: .9rem; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: 88vh; overflow: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--slate-200); }
.modal-head h3 { font-size: 1.15rem; font-weight: 800; color: var(--slate-800); }
.modal-body { padding: 1.5rem; }
.close-btn { width: 34px; height: 34px; border-radius: .5rem; border: none; background: var(--slate-100); color: var(--slate-600); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.close-btn:hover { background: var(--slate-200); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.field .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-400); font-weight: 700; }
.field .v { color: var(--slate-800); font-weight: 500; margin-top: .15rem; }
.section-title { font-size: .8rem; font-weight: 700; color: var(--slate-600); text-transform: uppercase; letter-spacing: .03em; margin: 1.5rem 0 .75rem; }
.note-box { background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: .6rem; padding: .9rem 1rem; color: var(--slate-600); font-size: .85rem; }

/* Invoice preview */
.inv { border: 1px solid var(--slate-200); border-radius: .6rem; overflow: hidden; }
.inv-top { padding: 1.25rem 1.5rem; background: var(--slate-50); border-bottom: 1px solid var(--slate-200); }
.inv-top .big { font-size: 1.1rem; font-weight: 800; color: var(--slate-800); }
.inv .total-row td { font-weight: 800; color: var(--slate-800); border-top: 2px solid var(--slate-200); }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--slate-200); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab { padding: .65rem 1rem; border: none; background: none; font: inherit; font-weight: 600; font-size: .85rem; color: var(--slate-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--slate-700); }
.tab.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ---------- Auto-Tour Indikator ---------- */
.auto-indicator {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: none;
  align-items: center;
  gap: .55rem;
  background: rgba(15, 23, 42, .88);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .55rem .85rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.45);
  z-index: 9999;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
body.auto-tour .auto-indicator { display: inline-flex; animation: autoIn .25s ease; }
.auto-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
  animation: autoPulse 1.6s ease-out infinite;
}
@keyframes autoPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
@keyframes autoIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* dezenter Hinweis am aktiven Navi-Eintrag während Auto-Tour */
body.auto-tour .nav-item.active { box-shadow: inset 0 0 0 1px rgba(16,185,129,.35); }

/* Settings list */
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--slate-100); }
.set-row:last-child { border-bottom: none; }
.set-row .v { color: var(--slate-700); font-weight: 600; }

/* Responsive within iframe */
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4, .feature-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
}
