:root {
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-slate-950: #020617;
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #2563eb;
  --color-primary-600: #1d4ed8;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-success-50: #ecfdf5;
  --color-success-100: #d1fae5;
  --color-success-700: #047857;
  --color-primary: #2563eb;
  --color-primary-bright: #3b82f6;
  --color-ink: #0f172a;
  --color-muted: #64748b;
  --color-paper: #f4f6fa;
  --color-surface: #ffffff;
  --color-line: #e5e7eb;
  --color-sidebar-active: #eef2ff;
  --color-s0: #f7743c;
  --color-s1: #4b83fd;
  --color-s2: #00a63e;
  --color-all-docs: #848892;
  --color-leave-green: #86efac;
  --color-leave-blue: #93c5fd;
  --color-leave-yellow: #fde68a;
  --color-accent-teal: #14b8a6;
  --color-accent-violet: #7c3aed;
  --color-danger: #ef4444;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --text-h1: 22px;
  --text-h2: 16px;
  --text-body: 14px;
  --text-caption: 12px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --sidebar-w: 240px;
}

*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-ink);
  background: var(--color-paper);
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.h1 { font-size: var(--text-h1); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.h2 { font-size: var(--text-h2); font-weight: 650; margin: 0; }
.sub { color: var(--color-muted); font-size: var(--text-caption); margin: 4px 0 0; }
.muted { color: var(--color-muted); }
.caption { font-size: var(--text-caption); color: var(--color-muted); }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  padding: var(--space-md) var(--space-sm);
}
.brand {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 12px 20px;
  font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
}
.brand-logo { display: block; width: 132px; height: auto; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--color-primary); color: #fff;
  display: grid; place-items: center; font-size: 16px;
}
.brand small { display: block; font-weight: 600; font-size: 10px; letter-spacing: 0.18em; color: var(--color-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; color: #334155; font-size: 13.5px;
}
.nav a:hover { background: #f8fafc; }
.nav a.active { background: var(--color-sidebar-active); color: var(--color-primary); font-weight: 650; }
.nav .ico { width: 18px; text-align: center; opacity: 0.75; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
}
.search {
  flex: 1; max-width: 420px;
  background: var(--color-paper); border: 1px solid var(--color-line);
  border-radius: 999px; padding: 8px 14px; color: var(--color-muted);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bell, .avatar {
  width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center; background: #f1f5f9; font-size: 13px;
}
.bell { position: relative; }
.bell::after {
  content: ""; position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; background: #ef4444; border-radius: 99px; border: 1px solid #fff;
}

.user-menu { position: relative; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 999px;
  border: 0; background: #e2e8f0; color: #334155;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  cursor: pointer; overflow: hidden; padding: 0;
}
.user-menu.open .user-avatar { box-shadow: 0 0 0 3px rgb(37 99 255 / 0.16); }
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 50;
  padding: 4px 0;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; color: #334155;
  font-size: 14px; white-space: nowrap;
}
.user-dropdown a:hover { background: #f8fafc; }
.user-dropdown a.is-danger { color: var(--color-danger); }
.user-dropdown-sep { height: 1px; background: #f1f5f9; margin: 4px 0; }
.user-dropdown svg { flex: 0 0 auto; }
.content { padding: 28px 32px 48px; max-width: 1180px; }

.crumbbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--color-line);
}
.crumb { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-muted); }
.crumb a { color: var(--color-primary); font-weight: 600; }

.btn-primary, .btn-ghost, .btn-soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--radius-sm); padding: 9px 14px;
  font-weight: 650; font-size: 13px; cursor: pointer;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary[disabled], .btn-primary.is-disabled { background: #93c5fd; }
.btn-ghost { background: #fff; border: 1px solid var(--color-line); }
.btn-soft { background: #eef2ff; color: var(--color-primary); }
.btn-wide { width: 100%; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; }
.kpi-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; background: #eff6ff; font-size: 16px;
}
.kpi .label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); font-weight: 650; }
.kpi .value { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; }

.chip {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; font-size: 11px; font-weight: 650;
}
.chip-s0 { background: #fff1e8; color: var(--color-s0); }
.chip-s1 { background: #eef4ff; color: var(--color-s1); }
.chip-s2 { background: #e8f8ee; color: var(--color-s2); }
.chip-all { background: #eef0f3; color: var(--color-all-docs); }
.chip-wait { background: #fff4e5; color: #ea580c; }
.chip-new { background: #e8f8ee; color: #16a34a; }
.chip-acc { background: #f3e8ff; color: #7c3aed; }
.chip-warn { background: #fee2e2; color: #b91c1c; }
.chip-draft { background: #f1f5f9; color: #475569; }
.chip-job { background: #e8f8ee; color: #16a34a; }
.chip-b2b { background: #e0f2fe; color: #0369a1; }
.chip-kind-tekst { background: #e0e7ff; color: #3730a3; }
.chip-kind-lista { background: #f3e8ff; color: #6b21a8; }
.chip-kind-liczba { background: #ffedd5; color: #c2410c; }
.chip-kind-data { background: #dcfce7; color: #15803d; }
.chip-kind-bool { background: #f1f5f9; color: #334155; }
.chip-kind-osoba { background: #fce7f3; color: #9d174d; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.04em;
  color: var(--color-muted); font-weight: 650; padding: 10px 14px;
  border-bottom: 1px solid var(--color-line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.check { width: 14px; height: 14px; border: 1.5px solid #cbd5e1; border-radius: 3px; display: inline-block; }

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-card { overflow: hidden; }
.project-card .hero {
  height: 92px; color: #fff; display: grid; place-items: center;
  position: relative; font-size: 28px;
}
.project-card .hero::before,
.project-card .hero::after {
  content: ""; position: absolute; border-radius: 999px; background: rgba(255,255,255,0.15);
}
.project-card .hero::before { width: 90px; height: 90px; right: -20px; top: -30px; }
.project-card .hero::after { width: 70px; height: 70px; left: -18px; bottom: -24px; }
.project-card .body { padding: 14px 16px 16px; }
.project-card h3 { margin: 0 0 4px; font-size: 14px; }
.project-card p { margin: 0; color: var(--color-muted); font-size: 12px; min-height: 32px; }
.project-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 10px; border-top: 1px solid #f1f5f9;
  font-size: 12px; color: var(--color-muted);
}
.project-meta a { color: var(--color-primary); font-weight: 650; }

.banner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: #eef8ff; border: 1px solid #dbeafe;
}
.banner .btn-soft { margin-left: auto; align-self: center; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-head { font-size: 11px; color: var(--color-muted); text-align: center; padding-bottom: 4px; }
.cal-cell {
  min-height: 88px; background: #fff; border: 1px solid var(--color-line);
  border-radius: 10px; padding: 6px 8px; font-size: 12px;
}
.cal-cell.today { outline: 2px solid #93c5fd; background: #eff6ff; }
.leave {
  display: block; margin-top: 4px; border-radius: 4px;
  padding: 1px 5px; font-size: 10px; font-weight: 650;
}
.leave-g { background: var(--color-leave-green); color: #166534; }
.leave-b { background: var(--color-leave-blue); color: #1e3a8a; }
.leave-y { background: var(--color-leave-yellow); color: #854d0e; }

.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini-cal { padding: 14px 16px 18px; }
.mini-cal h3 { text-align: center; font-size: 14px; margin: 0 0 10px; }
.mini-cal .dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 10px; color: var(--color-muted); text-align: center; margin-bottom: 4px; }
.mini-cal .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-cal .d { height: 26px; display: grid; place-items: center; font-size: 12px; border-radius: 6px; }
.mini-cal .d.holy { background: #fee2e2; color: #b91c1c; }
.mini-cal .d.ev { background: #dbeafe; color: #1d4ed8; }
.mini-cal .d.today { box-shadow: inset 0 0 0 1.5px var(--color-primary); }

.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: grid; place-items: center; padding: 24px; z-index: 20;
}
.modal {
  background: #fff; border-radius: 16px; width: min(560px, 100%);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.modal.wide { width: min(680px, 100%); }
.modal-h { padding: 18px 20px 10px; }
.modal-h .sub { margin-top: 2px; }
.modal-b { padding: 8px 20px 16px; }
.modal-f {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--color-line); background: #fafafa;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 6px; }
.field label em { color: #ef4444; font-style: normal; }
.input, .select, .area {
  width: 100%; border: 1px solid var(--color-line); border-radius: 8px;
  padding: 8px 10px; background: #fff;
}
.area { min-height: 72px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.kind-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-tabs span {
  border: 1px solid var(--color-line); border-radius: 8px;
  padding: 4px 10px; font-size: 12px; background: #fff;
}
.kind-tabs .on { color: #fff; border-color: transparent; }
.kind-tabs .on.tekst { background: #4f46e5; }
.kind-tabs .on.lista { background: #7c3aed; }
.kind-tabs .on.liczba { background: #ea580c; }
.kind-tabs .on.data { background: #16a34a; }
.kind-tabs .on.bool { background: #475569; }
.kind-tabs .on.osoba { background: #db2777; }

.choice {
  border: 1px solid var(--color-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.choice.on { border-color: #f9a8d4; background: #fdf2f8; }

.tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 20px; }
.tile {
  border-radius: 14px; color: #fff; padding: 16px; min-height: 92px;
  position: relative; overflow: hidden;
}
.tile h3 { margin: 18px 0 2px; font-size: 15px; }
.tile p { margin: 0; font-size: 12px; opacity: 0.85; }
.tile .bgico { position: absolute; right: 12px; top: 12px; font-size: 28px; opacity: 0.35; }
.tile.teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.tile.violet { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.tile.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.tile.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; }

.avatar-sm {
  width: 28px; height: 28px; border-radius: 99px; display: inline-grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.dots { display: flex; gap: 8px; }
.dot { width: 22px; height: 22px; border-radius: 99px; border: 2px solid transparent; }
.dot.on { border-color: var(--color-ink); }

.pager { display: flex; gap: 6px; align-items: center; }
.pager span {
  min-width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 12px;
}
.pager .on { background: var(--color-primary); color: #fff; }

.pop {
  position: absolute; right: 0; top: 36px; width: 280px;
  background: #fff; border: 1px solid var(--color-line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,0.12); z-index: 5;
  padding: 10px;
}
.rel { position: relative; }

.gallery { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; }
.gallery h1 { margin-bottom: 8px; }
.gallery .group { margin-top: 28px; }
.gallery .list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.gallery a { color: var(--color-primary); font-weight: 600; }
.gallery a small { display: block; color: var(--color-muted); font-weight: 500; }

.usage { background: #1d4ed8; color: #fff; border-radius: 14px; padding: 16px; }
.bar { height: 6px; background: rgba(255,255,255,0.25); border-radius: 99px; margin-top: 10px; }
.bar > i { display: block; height: 100%; width: 78%; background: #fff; border-radius: 99px; }

.hero-project {
  background: var(--color-primary-bright); color: #fff;
  border-radius: 18px; padding: 22px 24px 18px; position: relative; overflow: hidden;
}
.hero-project::after {
  content: ""; position: absolute; right: -20px; top: -30px;
  width: 140px; height: 140px; border-radius: 99px; background: rgba(255,255,255,0.12);
}
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { padding: 14px 16px; }
.stat .n { font-size: 22px; font-weight: 750; }

.team-row { display: flex; gap: 16px; }
.team-row > .grow { flex: 1; min-width: 0; }
.team { width: 280px; padding: 14px; }
.person { display: flex; gap: 10px; align-items: center; padding: 8px 0; }

.planner-app { min-height: 100vh; background: var(--color-paper); }
.planner-page-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
}
.planner-page-bar {
  display: flex; align-items: center; gap: 16px;
  min-height: 56px; padding: 0 16px;
}
.planner-topbar-brand { display: flex; align-items: center; flex: 0 0 auto; }
.planner-brand-logo { display: block; height: 28px; width: auto; }
.planner-page-nav { flex: 1; min-width: 0; display: flex; align-items: center; }
.planner-page-nav .crumb { padding: 0; }
.planner-content {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.planner-dashboard { display: flex; flex-direction: column; gap: 28px; }
.planner-page-heading h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.planner-page-heading p {
  margin: 8px 0 0; color: var(--color-muted); font-size: 15px; font-weight: 500;
}
.planner-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 24px;
}
.planner-menu-card {
  position: relative; display: block; overflow: hidden;
  min-height: 178px; border-radius: 10px; color: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.14);
  transform-origin: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.planner-menu-card:hover,
.planner-menu-card:focus-visible {
  transform: scale(1.025);
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.16);
}
.planner-menu-card.tone-violet { background: linear-gradient(135deg, #b241ff, #9a20ff); }
.planner-menu-card.tone-green { background: linear-gradient(135deg, #08c95d, #05ad48); }
.planner-menu-card.tone-orange { background: linear-gradient(135deg, #ff6908, #ff4f00); }
.planner-menu-card.tone-red { background: linear-gradient(135deg, #ff243b, #f00022); }
.planner-menu-card.tone-cyan { background: linear-gradient(135deg, #13b7cf, #0699b7); }
.planner-menu-card.tone-indigo { background: linear-gradient(135deg, #6258ff, #4a39f4); }
.planner-menu-card.tone-slate { background: linear-gradient(135deg, #687589, #526074); }
.planner-menu-card-icon {
  position: absolute; z-index: 2; left: 28px; top: 28px; color: #fff;
}
.planner-menu-card-icon svg { width: 34px; height: 34px; stroke-width: 2.25; }
.planner-menu-card-watermark {
  position: absolute; right: 22px; top: 20px;
  color: rgb(255 255 255 / 0.16); pointer-events: none;
}
.planner-menu-card-watermark svg { width: 70px; height: 70px; stroke-width: 2.1; }
.planner-menu-card-body {
  position: relative; z-index: 1;
  min-height: 178px; padding: 86px 28px 24px;
}
.planner-menu-card-body h2 {
  margin: 0; color: #fff; font-size: 20px; font-weight: 750; line-height: 1.24;
}
.planner-menu-card-body p {
  min-height: 42px; max-width: 22rem;
  margin: 10px 0 16px; color: rgb(255 255 255 / 0.72);
  font-size: 14px; font-weight: 600; line-height: 1.35;
}
.planner-menu-card-footer {
  display: flex; align-items: center; gap: 4px;
  color: rgb(255 255 255 / 0.86); font-size: 14px; font-weight: 750;
}
.planner-menu-card-footer svg { width: 17px; height: 17px; }

.login-body { min-height: 100vh; background: var(--color-paper); }
.login-main {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  padding: 32px 28px 24px;
}
.login-logo { display: block; height: 40px; width: auto; margin: 0 auto 24px; }
.login-title {
  margin: 0 0 20px; font-size: 20px; font-weight: 700;
  text-align: center; letter-spacing: -0.02em;
}
.login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.login-field label { font-size: 14px; font-weight: 650; color: #334155; }
.login-field input {
  border: 1px solid #cbd5e1; border-radius: 10px;
  padding: 10px 12px; background: #fff;
}
.login-field input:focus {
  outline: 2px solid var(--color-primary); outline-offset: 1px;
  border-color: var(--color-primary);
}
.login-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.login-btn {
  appearance: none; border: 0; border-radius: 10px;
  padding: 11px 14px; font-weight: 650; cursor: pointer;
  background: var(--color-primary); color: #fff; text-align: center;
}
.login-btn.secondary {
  background: #fff; color: #1e293b; border: 1px solid #cbd5e1;
}
.login-footer { margin-top: 18px; text-align: center; font-size: 14px; }
.login-footer a { color: var(--color-primary); font-weight: 650; }
.login-hint { margin: 0 0 12px; color: var(--color-muted); font-size: 14px; text-align: center; }
.otp-digits { display: flex; gap: 8px; justify-content: center; margin: 8px 0 16px; }
.otp-digits input {
  width: 42px; height: 48px; text-align: center;
  font-size: 20px; font-weight: 700;
  border: 1px solid #cbd5e1; border-radius: 10px;
}

.crumbbar .user-menu { margin-left: 12px; }
.crumbbar > div:last-child { display: flex; align-items: center; gap: 12px; }

.planner-page-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.planner-page-nav { display:flex; align-items:center; gap:16px; flex:1; }
.btn-diminished {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:32px; padding:0 12px; border:1px solid var(--color-line);
  border-radius:8px; background:#fff; color:#334155; font-weight:650; font-size:13px;
}
.btn-danger { background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.input { width:100%; border:1px solid var(--color-line); border-radius:8px; padding:8px 10px; background:#fff; }

.planner-card { border:1px solid var(--color-slate-200); border-radius:16px; background:#fff; box-shadow:0 12px 28px rgb(15 23 42 / 0.05); }
.planner-form-card { padding:32px; }
.planner-panel { padding:24px; }
.planner-card-title { margin:0 0 20px; font-size:20px; font-weight:800; }

.structure-switch-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.structure-switch-card { position:relative; display:block; min-height:170px; overflow:hidden; border-radius:10px; color:#fff; box-shadow:0 1px 2px rgb(15 23 42 / .14); }
.structure-switch-card:hover { transform:scale(1.02); }
.structure-switch-card.tone-violet { background:linear-gradient(135deg,#b241ff,#9a20ff); }
.structure-switch-card.tone-blue { background:linear-gradient(135deg,#2f80ff,#1768f2); }
.structure-switch-card.active { box-shadow:0 0 0 4px rgb(178 65 255 / .22), 0 14px 34px rgb(15 23 42 / .13); }
.structure-switch-card.tone-blue.active { box-shadow:0 0 0 4px rgb(47 128 255 / .24); }
.structure-workspace { display:grid; grid-template-columns:minmax(360px,.45fr) minmax(0,1fr); gap:24px; align-items:start; }
.structure-tree-card, .structure-detail-card { border:1px solid var(--color-slate-200); border-radius:10px; background:#fff; box-shadow:0 10px 26px rgb(15 23 42 / .04); }
.structure-tree-card { padding:24px; }
.structure-detail-card { padding:28px; min-width:0; }
.structure-card-header, .structure-detail-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.structure-card-header h2, .structure-detail-header h2 { margin:0; font-size:18px; font-weight:650; }
.structure-tree-list { display:flex; flex-direction:column; gap:4px; }
.structure-tree-item > .item-row { display:flex; align-items:center; gap:4px; }
.structure-tree-item .children { margin-left:22px; margin-top:4px; display:flex; flex-direction:column; gap:4px; }
.structure-tree-item a { display:flex; flex:1; gap:12px; align-items:center; border-radius:10px; padding:8px 12px; }
.structure-tree-item a:hover { background:var(--color-slate-50); }
.structure-tree-item.active > .item-row > a { background:var(--color-primary-50); box-shadow:inset 0 0 0 1.5px var(--color-primary-200); }
.structure-node-icon { width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center; border-radius:10px; background:#f3d8ff; color:#a820f3; }
.structure-tree-item .type-position .structure-node-icon { background:#dbeafe; color:var(--color-primary-500); }
.structure-node-icon svg { width:18px; height:18px; }
.structure-node-copy { display:flex; flex-direction:column; min-width:0; }
.structure-node-title { font-size:13px; font-weight:650; }
.structure-node-meta { font-size:11px; color:var(--color-slate-500); font-weight:600; }
.collapse-placeholder { width:16px; flex:0 0 16px; }
.structure-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:12px 0; }
.structure-detail-section { margin-top:22px; }
.structure-detail-section h3 { margin:0 0 10px; font-size:14px; }
.structure-person-row { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid #f1f5f9; }
.structure-person-row.highlight { background:#faf5ff; margin:0 -8px; padding:10px 8px; border-radius:8px; }
.structure-person-avatar { width:36px; height:36px; border-radius:99px; background:#e2e8f0; display:grid; place-items:center; font-size:12px; font-weight:800; }
.structure-person-copy { display:flex; flex-direction:column; min-width:0; }
.structure-person-name { font-weight:700; font-size:13px; }
.structure-person-meta { font-size:12px; color:var(--color-slate-500); }
.structure-add-person { display:inline-flex; margin-top:12px; border:0; background:transparent; color:var(--color-primary); font-weight:800; cursor:pointer; }
.structure-empty-text { color:var(--color-slate-500); font-weight:600; }
.structure-edit-panel { border:1px solid var(--color-slate-200); border-radius:8px; padding:12px 14px; margin-bottom:16px; }
.structure-edit-panel summary { cursor:pointer; font-weight:700; }
.danger-zone { margin-top:40px; border:1.5px solid #fecaca; border-radius:10px; background:#fef2f2; padding:18px; }
.danger-zone header { color:#b91c1c; font-weight:650; margin-bottom:10px; }
.items-outside { margin-top:20px; padding-top:12px; border-top:1.5px solid var(--color-slate-200); }
.items-outside header { font-weight:700; color:var(--color-slate-500); margin-bottom:8px; }

.scope-catalog { width:min(840px,100%); margin:0 auto; }
.scope-catalog-heading { margin-bottom:22px; }
.scope-catalog-heading h1 { margin:0; font-size:22px; font-weight:700; }
.scope-catalog-heading p { margin:8px 0 0; color:var(--color-slate-500); font-size:13px; }
.scope-catalog-filters { display:grid; grid-template-columns:minmax(0,1fr) 10rem 9rem; gap:10px; margin-bottom:16px; background:#fff; padding:12px; border-radius:8px; box-shadow:0 10px 24px rgb(15 23 42 / .04); }
.scope-catalog-filters input, .scope-catalog-filters select { min-height:34px; border:1px solid var(--color-slate-200); border-radius:7px; padding:0 10px; font-size:13px; background:#fff; }
.scope-catalog-count { margin:0 0 12px; color:var(--color-slate-500); font-size:13px; font-weight:700; }
.scope-catalog-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.scope-create-card, .scope-area-card { position:relative; min-height:140px; overflow:hidden; border-radius:8px; }
.scope-create-card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; border:1.5px dashed var(--color-slate-300); background:rgb(255 255 255 / .5); color:var(--color-slate-500); padding:20px; text-align:center; }
.scope-create-icon { width:40px; height:40px; display:grid; place-items:center; border-radius:99px; background:var(--color-primary-100); color:var(--color-primary-500); }
.scope-create-card strong { color:var(--color-slate-600); font-size:14px; }
.scope-create-card span:last-child { font-size:12px; max-width:200px; }
.scope-area-card { display:block; color:#fff; box-shadow:0 8px 20px rgb(15 23 42 / .08); }
.scope-area-card:hover { transform:scale(1.03); }
.scope-area-card-icon { position:absolute; top:18px; left:16px; }
.scope-area-card-watermark { position:absolute; top:10px; right:12px; opacity:.16; }
.scope-area-card-body { min-height:140px; display:flex; flex-direction:column; justify-content:flex-end; padding:56px 16px 16px; }
.scope-area-card h2 { margin:0; color:#fff; font-size:15px; font-weight:800; }
.scope-area-card p { margin:8px 0 12px; color:rgb(255 255 255 / .82); font-size:12px; }
.scope-area-card span { color:#fff; font-size:12px; font-weight:800; }

.scope-create-dialog, .structure-employee-dialog, .prod-modal {
  background:#fff; border:1px solid var(--color-slate-200); border-radius:12px;
  box-shadow:0 24px 70px rgb(15 23 42 / .22); width:min(680px, calc(100vw - 32px)); overflow:hidden;
}
.scope-create-dialog { width:min(760px, calc(100vw - 32px)); }
.scope-create-dialog-header, .structure-dialog-header, .prod-modal > header {
  display:flex; justify-content:space-between; gap:12px; padding:20px 22px 14px; border-bottom:1px solid var(--color-slate-200); font-weight:700;
}
.scope-create-dialog-body, .prod-modal .modal-body { padding:20px 22px; max-height:52vh; overflow:auto; }
.scope-create-dialog-footer, .prod-modal > footer {
  display:flex; justify-content:flex-end; gap:8px; padding:16px 22px; border-top:1px solid var(--color-slate-200); background:var(--color-slate-50);
}
.scope-create-dialog-footer { justify-content:space-between; align-items:center; }
.scope-template-filters { display:grid; grid-template-columns:1fr 11rem; gap:10px; margin-bottom:14px; }
.scope-template-list { max-height:270px; overflow:auto; border:1px solid var(--color-slate-200); border-radius:8px; padding:6px; }
.scope-template-row { display:flex; width:100%; align-items:center; gap:12px; border:1px solid var(--color-slate-100); border-radius:8px; background:#fff; padding:10px 12px; text-align:left; margin-bottom:6px; }
.scope-template-row:hover { background:var(--color-primary-50); }
.scope-template-icon { width:40px; height:40px; display:grid; place-items:center; border-radius:8px; color:#fff; flex:0 0 auto; }
.scope-template-copy { display:flex; flex-direction:column; min-width:0; gap:2px; }
.scope-template-copy strong, .scope-template-copy span { display:block; }
.scope-editor-preview-copy { display:flex; flex-direction:column; min-width:0; gap:4px; }
.scope-editor-preview-copy strong, .scope-editor-preview-copy span { display:block; }
.btn-primary:disabled, .btn-primary[disabled] { background:#93c5fd; cursor:not-allowed; }
.scope-editor-choice-group { margin-top:16px; }
.scope-empty-create { border:0; background:transparent; color:var(--color-slate-600); font-weight:700; cursor:pointer; }
.structure-dialog-filter { padding:12px 22px; }
.structure-dialog-filter input { width:100%; height:42px; border:1px solid var(--color-slate-200); border-radius:8px; padding:0 12px; }
.structure-employee-list { display:flex; flex-direction:column; gap:10px; padding:0 22px 22px; max-height:360px; overflow:auto; }
.structure-employee-button { display:flex; align-items:center; gap:12px; width:100%; min-height:64px; border:1px solid var(--color-slate-200); border-radius:10px; background:#fff; padding:12px; text-align:left; cursor:pointer; }

.scope-editor-page { display:flex; flex-direction:column; gap:18px; }
.scope-editor-well { border:1px solid var(--color-slate-200); border-radius:8px; background:#fff; box-shadow:0 1px 2px rgb(15 23 42 / .03); }
.scope-editor-name-well { padding:22px 24px; }
.scope-editor-identity-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,320px); gap:28px; align-items:end; }
.scope-editor-field { margin-bottom:12px; }
.scope-editor-field-label { display:block; font-size:12px; font-weight:700; color:var(--color-slate-600); margin-bottom:6px; }
.scope-editor-text-input { width:100%; border:1px solid var(--color-slate-200); border-radius:8px; padding:8px 10px; }
.scope-editor-color-swatches, .scope-editor-icon-choices { display:flex; flex-wrap:wrap; gap:6px; }
.scope-editor-color-swatch { width:28px; height:28px; border:0; border-radius:8px; background:var(--scope-swatch-color); cursor:pointer; }
.scope-editor-color-swatch.selected { box-shadow:0 0 0 3px #fff, 0 0 0 5px var(--color-primary-500); }
.scope-editor-icon-choice { width:28px; height:28px; display:grid; place-items:center; border:1px solid var(--color-slate-200); border-radius:8px; background:#fff; color:var(--color-slate-400); }
.scope-editor-icon-choice.selected { border-color:var(--color-primary-500); background:var(--color-primary-50); color:var(--color-primary-600); }
.scope-editor-preview-card { display:flex; min-height:100px; align-items:center; gap:16px; border-radius:8px; padding:18px 22px; color:#fff; }
.scope-editor-list-well { padding:18px 20px; }
.scope-editor-list-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.scope-editor-list-header h2 { margin:0; font-size:12px; font-weight:800; text-transform:uppercase; }
.scope-editor-toolbar { display:flex; justify-content:flex-end; margin-bottom:8px; }
.scope-editor-matrix-table th, .scope-editor-matrix-table td { text-align:center; }
.matrix-cell { display:inline-flex; width:48px; height:28px; align-items:center; justify-content:center; border-radius:8px; border:1px solid var(--color-slate-200); font-size:11px; font-weight:800; }
.matrix-cell.oz { background:var(--color-success-50); color:var(--color-success-700); border-color:var(--color-success-100); }
.matrix-cell.o { background:var(--color-primary-50); color:var(--color-primary-700,#1d4ed8); }
.scope-editor-footer { display:flex; justify-content:flex-end; gap:8px; margin-top:8px; }
.scope-legend { display:flex; flex-wrap:wrap; gap:20px; margin-top:16px; font-size:12px; color:var(--color-slate-600); }

.flow-editor { display:flex; flex-direction:column; gap:12px; }
.flow-editor-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.flow-canvas { min-height:520px; overflow:auto; border:1px solid var(--color-slate-200); border-radius:8px; background:#fff; padding:40px 24px; }
.flow-col { display:flex; flex-direction:column; align-items:center; }
.flow-step { width:152px; min-height:72px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; border:1px solid var(--color-slate-300); border-radius:10px; background:#fff; padding:10px 12px; box-shadow:0 1px 3px rgb(15 23 42 / .08); font-size:12px; font-weight:650; }
.flow-step .kind { font-size:10px; text-transform:uppercase; color:var(--color-slate-500); font-weight:700; }
.flow-step.start, .flow-step.end { border-radius:999px; width:140px; min-height:56px; }
.flow-line { width:1px; height:20px; background:var(--color-slate-300); }
.flow-plus-wrap { position:relative; display:flex; flex-direction:column; align-items:center; }
.flow-plus { width:24px; height:24px; border-radius:99px; border:1px solid var(--color-slate-300); background:#fff; display:grid; place-items:center; font-weight:800; position:relative; }
.flow-menu { position:absolute; top:28px; left:50%; transform:translateX(-50%); width:220px; background:#fff; border:1px solid var(--color-slate-200); border-radius:8px; box-shadow:0 16px 40px rgb(15 23 42 / .16); z-index:20; padding:4px; text-align:left; }
.flow-menu a, .flow-menu button { display:block; width:100%; padding:8px 12px; border:0; background:transparent; text-align:left; font-size:13px; border-radius:6px; }
.flow-menu a:hover, .flow-menu button:hover { background:var(--color-slate-50); }

.filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; align-items:end; }
.filter-grid .span-all { grid-column:1/-1; display:flex; justify-content:flex-end; }
.table-card-head { display:flex; justify-content:space-between; align-items:center; padding:14px 16px 0; }
.table-toggle { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--color-slate-600); }
.click-row { cursor:pointer; }
.click-row:hover td { background:#f8fafc; }
.pager-bar { display:flex; justify-content:space-between; align-items:center; padding:16px; font-size:13px; color:var(--color-slate-700); }

.dg-table-card { position:relative; }
.dg-table-toolbar {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:12px 16px 8px;
}
.dg-table-title { flex:1; margin:0; min-width:8rem; }
.dg-table-icon {
  width:34px; height:34px; border:1px solid var(--color-line); border-radius:8px;
  background:#fff; display:grid; place-items:center; cursor:pointer;
}
.dg-table-search { max-width:240px; }
.dg-table-toolbar-end { display:flex; align-items:center; gap:8px; margin-left:auto; }
.dg-th-btn, .dg-col-picker {
  border:0; background:transparent; font:inherit; font-weight:650; color:inherit;
  cursor:pointer; padding:0; display:inline-flex; align-items:center; gap:4px;
}
.dg-th-ico { color:var(--color-muted); font-size:11px; }
.dg-col-picker { font-size:18px; line-height:1; padding:0 6px; }
.dg-row-chevron { width:28px; color:var(--color-muted); text-align:right; }
.dg-pop {
  position:absolute; z-index:40; width:min(280px, calc(100% - 24px));
  background:#fff; border:1px solid var(--color-line); border-radius:12px;
  box-shadow:0 16px 40px rgba(15,23,42,.14); padding:12px; font-size:13px;
}
.dg-pop-sort { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:8px; }
.dg-pop-tools { display:flex; justify-content:space-between; margin:8px 0; }
.dg-pop-values { display:flex; flex-direction:column; gap:6px; max-height:180px; overflow:auto; margin:8px 0; }
.dg-pop-foot { display:flex; justify-content:flex-end; gap:8px; padding-top:8px; border-top:1px solid var(--color-line); }
.dg-pop-save { border-top:1px solid var(--color-line); padding-top:10px; margin-top:8px; }
.dg-link { border:0; background:transparent; color:var(--color-primary); font:inherit; font-weight:650; cursor:pointer; padding:0; }
.dg-th-ico.is-on { color:var(--color-primary); }
.dg-preset-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 0; }
.dg-preset-del { border:0; background:transparent; color:var(--color-muted); cursor:pointer; font-size:16px; }
.dg-save-overlay { z-index:60; }
