:root {
  --ink: #2c174f;
  --muted: #6b5a83;
  --purple: #6f49b8;
  --purple-soft: rgba(121, 86, 180, 0.12);
  --gold: #b68a3a;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(121, 86, 180, 0.16);
  --shadow: 0 18px 50px rgba(58, 36, 95, 0.10);
}

* { box-sizing: border-box; }

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: Arial, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(121, 86, 180, 0.16), transparent 32%),
    radial-gradient(circle at bottom left, rgba(182, 138, 58, 0.13), transparent 28%),
    linear-gradient(145deg, #fbf8f1, #f7f2ff);
  color: var(--ink);
}

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 24px auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(111, 73, 184, 0.18), rgba(182, 138, 58, 0.13));
  box-shadow: inset 0 0 0 1px rgba(121, 86, 180, 0.16);
  font-size: 28px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: 0.2px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.6;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

button {
  border: 1px solid rgba(121, 86, 180, 0.22);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button.active,
button:hover,
.primary-action {
  background: var(--purple);
  color: white;
  box-shadow: 0 10px 24px rgba(111, 73, 184, 0.22);
}

button:hover {
  transform: translateY(-1px);
}

main { margin-top: 18px; }
.view { display: none; }
.view.active { display: block; }

.hero-card,
.dashboard-card,
.content-section,
.notice,
.placeholder-panel,
.diagnosis-form,
.client-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(58, 36, 95, 0.08);
  backdrop-filter: blur(8px);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px;
  margin-bottom: 18px;
  min-height: 190px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.68)),
    radial-gradient(circle at 20% 20%, rgba(182, 138, 58, 0.16), transparent 32%);
}

.eyebrow,
.client-status,
.source-badge,
.edited-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(182, 138, 58, 0.22);
  background: rgba(182, 138, 58, 0.10);
  color: #7b5a19;
  font-size: 12px;
  font-weight: 950;
}

.edited-badge {
  color: #2f7a4b;
  border-color: rgba(47, 122, 75, 0.22);
  background: rgba(47, 122, 75, 0.10);
}

.hero-card h2,
.section-head h2 {
  margin: 0 0 10px;
  font-size: 32px;
}

.hero-card p,
.dashboard-card p,
.content-section p,
.notice,
.placeholder-panel p,
.section-head p,
.client-card p {
  color: #4e3d68;
  line-height: 1.8;
  font-size: 16px;
}

.source-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.hero-actions,
.backup-actions,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-actions,
.editor-actions { margin-top: 18px; }

.dashboard-grid,
.clients-grid,
.clients-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 18px;
}

.clients-layout {
  align-items: start;
  margin-bottom: 18px;
}

.dashboard-card {
  position: relative;
  min-height: 210px;
  padding: 22px;
  overflow: hidden;
  cursor: pointer;
}

.dashboard-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -45px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: var(--purple-soft);
}

.dashboard-card:hover,
.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 46px rgba(58, 36, 95, 0.12);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(121, 86, 180, 0.10);
  font-size: 24px;
}

.dashboard-card h3,
.content-section h3,
.placeholder-panel h3,
.client-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
}

.dashboard-card small {
  display: block;
  margin-top: 14px;
  color: #7f6c98;
  font-weight: 800;
  line-height: 1.6;
}

.muted-card { cursor: default; opacity: 0.84; }
.section-head { margin: 6px 0 18px; }
.content-output { display: grid; gap: 16px; }

.content-section,
.notice,
.placeholder-panel,
.diagnosis-form,
.client-card {
  padding: 20px;
}

.number-fields { display: grid; gap: 10px; }

.number-field {
  padding: 12px;
  border-radius: 16px;
  background: rgba(121, 86, 180, 0.08);
}

.number-field strong {
  display: block;
  margin-bottom: 4px;
  color: var(--purple);
}

.diagnosis-form,
.client-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.client-form button { align-self: end; }

.diagnosis-form label,
.client-form label,
.content-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(121, 86, 180, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.7;
}

.content-edit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.content-edit-form label:first-of-type input {
  min-height: 46px;
}

.content-edit-card {
  background: rgba(255, 255, 255, 0.86);
}

.client-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.active-client {
  border-color: rgba(47, 122, 75, 0.26);
  background: linear-gradient(145deg, rgba(255,255,255,0.86), rgba(47,122,75,0.08));
}

.active-client .client-status {
  color: #2f7a4b;
  border-color: rgba(47, 122, 75, 0.22);
  background: rgba(47, 122, 75, 0.10);
}

.client-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-button {
  color: #8a3030;
  border-color: rgba(184, 65, 65, 0.22);
  background: rgba(184, 65, 65, 0.06);
}

.danger-button:hover { background: #8a3030; color: white; }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.list-head strong { color: var(--muted); }

pre {
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(44, 23, 79, 0.05);
}

@media (max-width: 920px) {
  .topbar,
  .hero-card,
  .client-card,
  .list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  nav { justify-content: flex-start; width: 100%; }
  .client-actions { justify-content: flex-start; }
}
/* הגדלת בועות קטנות בתצוגת טלי בלבד */
#view-tali .eyebrow,
#taliContent .eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  min-height: 38px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  border-radius: 999px;
  white-space: nowrap;
}

/* Dynamic backup summary - compact desktop grid */
.system-backup-card .number-fields {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.system-backup-card .number-field {
  min-width: 0;
  min-height: 82px;
  display: grid;
  align-content: center;
  padding: 12px 10px;
  text-align: center;
}

.system-backup-card .number-field strong {
  min-height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  line-height: 1.25;
}

.system-backup-card .number-field p {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
}

@media (max-width: 1200px) {
  .system-backup-card .number-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .system-backup-card .number-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .system-backup-card .number-fields {
    grid-template-columns: 1fr;
  }
}
