:root {
  --app-bg: #f7f6f2;
  --app-surface: #ffffff;
  --app-surface-soft: #fbfaf7;
  --app-border: #e7e1d8;
  --app-border-strong: #d8d0c4;
  --app-text: #201c17;
  --app-muted: #756d63;
  --app-faint: #aaa197;
  --app-accent: #f5bd2e;
  --app-accent-soft: #fff6d6;
  --app-success: #079669;
  --app-danger: #dc2626;
  --app-info: #2563eb;
  --app-shadow: 0 12px 32px rgba(32, 28, 23, 0.06);
  --app-shadow-hover: 0 18px 48px rgba(32, 28, 23, 0.1);
}

body {
  background: var(--app-bg);
}

.org-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}

.app-header::after {
  content: "MVP סביבת עבודה";
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.app-header {
  position: sticky;
  top: 0;
  grid-row: 1 / 3;
  align-self: start;
  height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-left: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.brand-mark img {
  width: 138px;
  height: auto;
}

.role-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--app-muted);
  padding: 10px 12px;
  text-align: right;
  font-size: 14px;
  font-weight: 850;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover {
  background: var(--app-surface-soft);
  color: var(--app-text);
  transform: translateX(-2px);
}

.nav-button.active {
  border-color: var(--app-border);
  background: var(--app-text);
  color: var(--sz-cream);
  box-shadow: none;
}

.app-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
  padding: 30px 0 42px;
}

.workspace-shell {
  display: grid;
  gap: 16px;
}

.app-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 0 28px;
  color: var(--app-faint);
  font-size: 12px;
}

.app-footer a {
  color: var(--app-muted);
  font-weight: 850;
  text-decoration: none;
}

.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(251, 250, 247, 0.9)),
    radial-gradient(circle at top left, rgba(245, 189, 46, 0.16), transparent 32%);
}

.page-title > .sz-button {
  justify-self: end;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8a5b05;
  font-size: 12px;
  font-weight: 900;
}

.page-title h1 {
  margin: 0;
  color: var(--app-text);
  font-size: 28px;
  line-height: 1.18;
  font-weight: 950;
}

.page-title p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--app-muted);
  line-height: 1.65;
}

.sz-button {
  min-height: 40px;
  border-radius: 10px;
  box-shadow: none;
}

.sz-button-primary {
  border-color: #d99d0d;
  background: var(--app-accent);
  box-shadow: none;
}

.sz-button-primary:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.sz-button-secondary {
  background: var(--app-text);
}

.sz-button-ghost {
  border-color: var(--app-border);
  background: var(--app-surface);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.task-card,
.library-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.metric-card {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--app-accent);
}

.metric-card span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
}

.metric-card strong {
  color: var(--app-text);
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.metric-card small {
  color: var(--app-faint);
  font-size: 12px;
  font-weight: 750;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee9df;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--app-accent), #f59e0b);
}

.progress-fill.success {
  background: linear-gradient(90deg, #10b981, #059669);
}

.progress-fill.info {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 320px;
  gap: 14px;
}

.panel {
  overflow: hidden;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.panel:hover,
.library-card:hover,
.task-card:hover {
  border-color: var(--app-border-strong);
  box-shadow: var(--app-shadow);
}

.panel-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}

.panel-header h2 {
  margin: 0;
  color: var(--app-text);
  font-size: 17px;
  font-weight: 950;
}

.panel-body {
  padding: 14px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
}

.tab-button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--app-muted);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 850;
}

.tab-button.active {
  background: var(--app-text);
  color: var(--sz-cream);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--app-border);
  text-align: right;
  white-space: nowrap;
}

th {
  color: var(--app-muted);
  background: var(--app-surface-soft);
  font-size: 12px;
  font-weight: 900;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 720;
}

.status-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.status-badge.warn {
  background: #fffbeb;
  color: #92400e;
}

.status-badge.danger {
  background: #fef2f2;
  color: #b91c1c;
}

tbody tr:hover {
  background: var(--app-surface-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--app-success);
}

.status-dot.warn {
  background: var(--app-accent);
}

.status-dot.danger {
  background: var(--app-danger);
}

.sz-pill {
  min-height: 26px;
  border-radius: 999px;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 900;
}

.sz-pill-honey {
  background: var(--app-accent-soft);
  color: #7a5107;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.library-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 176px;
  padding: 14px;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.library-card:hover {
  transform: translateY(-1px);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.library-card h3,
.task-card h3 {
  margin: 0;
  color: var(--app-text);
  font-size: 16px;
  line-height: 1.35;
}

.library-card p,
.task-card p,
.muted {
  color: var(--app-muted);
  line-height: 1.55;
}

.library-card p,
.task-card p {
  margin: 6px 0 0;
  font-size: 13px;
}

.mini-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 780;
}

.mini-list li:last-child {
  border-bottom: 0;
}

.mini-list strong {
  color: var(--app-text);
}

.insight-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

.insight-card strong {
  color: var(--app-text);
}

.employee-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.creator-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.login-card {
  padding: 16px;
}

.login-card h2 {
  margin-top: 0;
  font-size: 18px;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.compact-form {
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.assign-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 130px 150px 150px auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

.checkbox-line {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text);
  font-size: 13px;
  font-weight: 850;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--app-accent);
}

.notice-bar {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  font-weight: 850;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--app-border-strong);
  border-radius: 12px;
  background: var(--app-surface-soft);
  color: var(--app-muted);
  text-align: center;
}

.empty-state strong {
  color: var(--app-text);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.learning-player {
  display: grid;
  gap: 12px;
}

.tasks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  transition: box-shadow 160ms ease, border-color 160ms ease;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--app-accent);
}

.task-card .card-topline {
  justify-content: flex-start;
  margin-bottom: 6px;
}

.module-list {
  display: grid;
  gap: 8px;
}

.module-item {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}

.player-stage {
  min-height: 220px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(32, 28, 23, 0.88), rgba(32, 28, 23, 0.66)),
    linear-gradient(135deg, #f5bd2e, #2563eb);
  color: #fffef9;
}

.player-stage h3 {
  margin: 0;
  color: #fffef9;
  font-size: 22px;
}

.player-stage p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 254, 249, 0.78);
  line-height: 1.6;
}

.module-item.done {
  border-color: #a7f3d0;
  background: #f0fdf8;
}

.completion-box {
  padding: 13px 14px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

.completion-box.complete {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.creator-secret {
  border-color: var(--app-border-strong);
}

.creator-banner {
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
  color: var(--app-text);
}

.creator-preview-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fffdf6, #ffffff);
}

.creator-preview-card h3 {
  margin: 0;
  font-size: 19px;
}

.preview-modules {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-modules li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 800;
}

.creator-banner p {
  margin: 8px 0 0;
  color: var(--app-muted);
  line-height: 1.6;
}

.draft-preview {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-soft);
}

@media (max-width: 980px) {
  .org-app {
    display: flex;
    flex-direction: column;
  }

  .app-header {
    position: sticky;
    height: auto;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-left: 0;
    border-bottom: 1px solid var(--app-border);
  }

  .app-header::after {
    display: none;
  }

  .role-nav {
    display: flex;
  }

  .nav-button {
    width: auto;
    text-align: center;
  }

  .app-shell,
  .app-footer {
    width: min(100% - 28px, 1180px);
  }

  .page-title,
  .dashboard-layout,
  .employee-layout,
  .creator-layout,
  .content-grid,
  .toolbar,
  .assign-strip {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .brand-mark img {
    width: 124px;
  }

  .role-nav,
  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .nav-button,
  .tab-button {
    flex: 1;
    white-space: nowrap;
  }

  .page-title {
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-title h1 {
    font-size: 22px;
  }

  .page-title p {
    font-size: 14px;
    line-height: 1.55;
  }

  .page-title > .sz-button {
    justify-self: start;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-card {
    min-height: 86px;
    padding: 12px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .metric-card small {
    font-size: 11px;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
