/* === DienstBuddy — Vanilla CSS === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --navy: #0F172A;
  --navy-2: #1E293B;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #EFF6FF;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --ok: #16A34A;
  --warn: #DC2626;
  --warn-soft: #FEF2F2;
  --info: #0284C7;
  --row-hover: #F8FAFC;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --radius: 10px;
  --gap: 16px;
}
[data-theme="dark"] {
  --bg: #0B1220;
  --card: #111827;
  --border: #1F2937;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --primary-soft: #1E293B;
  --warn-soft: #2A1A1F;
  --row-hover: #0F172A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4);
}
[data-theme="dark"] .calendar thead th,
[data-theme="dark"] .data-table thead th { background: #0B1220; }
[data-theme="dark"] .quota-item { background: #0F172A; }
[data-theme="dark"] .info-box { background: #1E2C50; border-color: #2C3E72; color: #BFDBFE; }
[data-theme="dark"] .flash-ok { background: #14322A; color: #86EFAC; border-color: #1F4035; }
[data-theme="dark"] .flash-error { background: #3B1A1F; color: #FCA5A5; border-color: #4A2228; }
[data-theme="dark"] .badge-ok, [data-theme="dark"] .badge-approved, [data-theme="dark"] .badge-active { background: #14322A; color: #86EFAC; }
[data-theme="dark"] .badge-error, [data-theme="dark"] .badge-rejected, [data-theme="dark"] .badge-expired { background: #3B1A1F; color: #FCA5A5; }
[data-theme="dark"] .badge-pending, [data-theme="dark"] .badge-trial { background: #3F2A0A; color: #FCD34D; }
[data-theme="dark"] .badge-info, [data-theme="dark"] .badge-vacation, [data-theme="dark"] .badge-cancelled { background: #1E2C50; color: #93C5FD; }
[data-theme="dark"] .badge-other, [data-theme="dark"] .badge-muted { background: #1F2937; color: var(--muted); }
[data-theme="dark"] .auth-body { background: #0B1220; }
[data-theme="dark"] .banner-info { background: #1E2C50; color: #BFDBFE; }
[data-theme="dark"] .banner-warn { background: #3F2A0A; color: #FCD34D; }
[data-theme="dark"] .btn-ghost:hover { background: #1F2937; }
[data-theme="dark"] .menu-btn span { background: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.r { text-align: right; }
.mt-16 { margin-top: 16px; }

/* === Layout === */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--navy);
  color: #E2E8F0;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  padding: 20px 0;
  z-index: 30;
}
.sidebar-brand { padding: 4px 20px 20px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand img { max-width: 100%; height: auto; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; color: #CBD5E1;
  font-size: 14px; min-height: 44px;
}
.nav-item:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; opacity: .9; }
.icon-home     { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 3l9 8h-3v9h-5v-6H11v6H6v-9H3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M12 3l9 8h-3v9h-5v-6H11v6H6v-9H3z'/></svg>"); }
.icon-calendar { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M7 2v2H4v18h16V4h-3V2h-2v2H9V2H7zm-1 8h12v10H6V10z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M7 2v2H4v18h16V4h-3V2h-2v2H9V2H7zm-1 8h12v10H6V10z'/></svg>"); }
.icon-users    { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M9 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm6 1a3.5 3.5 0 1 0-3.5-3.5A3.5 3.5 0 0 0 15 13zm-6 1c-3.3 0-7 1.7-7 5v3h14v-3c0-3.3-3.7-5-7-5zm6 0c-.4 0-.8 0-1.2.1A6.7 6.7 0 0 1 16 19v3h7v-2c0-3-4-5-8-5z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M9 12a4 4 0 1 0-4-4 4 4 0 0 0 4 4zm6 1a3.5 3.5 0 1 0-3.5-3.5A3.5 3.5 0 0 0 15 13zm-6 1c-3.3 0-7 1.7-7 5v3h14v-3c0-3.3-3.7-5-7-5zm6 0c-.4 0-.8 0-1.2.1A6.7 6.7 0 0 1 16 19v3h7v-2c0-3-4-5-8-5z'/></svg>"); }
.icon-leaf     { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M17 3c-7 0-13 5-13 12 0 3 1 5 1 5l2-2c1-7 7-9 11-9-2 4-7 5-9 8-1 1 2 4 5 4 7 0 9-7 8-15 0-2-3-3-5-3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M17 3c-7 0-13 5-13 12 0 3 1 5 1 5l2-2c1-7 7-9 11-9-2 4-7 5-9 8-1 1 2 4 5 4 7 0 9-7 8-15 0-2-3-3-5-3z'/></svg>"); }
.icon-settings { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M12 8a4 4 0 1 0 4 4 4 4 0 0 0-4-4zm9 4l2-1.5-2-3.5-2.5.6a8 8 0 0 0-1.5-1L17 4h-4l-.5 2.6a8 8 0 0 0-1.5 1L8.5 7l-2 3.5 2 1.5a8 8 0 0 0 0 1.8l-2 1.5 2 3.5 2.5-.6a8 8 0 0 0 1.5 1L13 22h4l.5-2.6a8 8 0 0 0 1.5-1l2.5.6 2-3.5-2-1.5a8 8 0 0 0 0-1.8z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M12 8a4 4 0 1 0 4 4 4 4 0 0 0-4-4zm9 4l2-1.5-2-3.5-2.5.6a8 8 0 0 0-1.5-1L17 4h-4l-.5 2.6a8 8 0 0 0-1.5 1L8.5 7l-2 3.5 2 1.5a8 8 0 0 0 0 1.8l-2 1.5 2 3.5 2.5-.6a8 8 0 0 0 1.5 1L13 22h4l.5-2.6a8 8 0 0 0 1.5-1l2.5.6 2-3.5-2-1.5a8 8 0 0 0 0-1.8z'/></svg>"); }
.icon-card     { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M2 6h20v3H2zm0 5h20v8H2zm3 4v2h6v-2z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M2 6h20v3H2zm0 5h20v8H2zm3 4v2h6v-2z'/></svg>"); }
.icon-shield   { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5z'/></svg>"); }
.icon-logout   { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M10 17v-2H5V9h5V7l5 5z M14 3h5a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5v-2h5V5h-5z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M10 17v-2H5V9h5V7l5 5z M14 3h5a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5v-2h5V5h-5z'/></svg>"); display: inline-block; width: 18px; height: 18px; }

/* Identity block — directly under the logo */
.sidebar-id {
  display: flex; align-items: center; gap: 10px;
  margin: 0 12px 16px; padding: 10px 12px;
  background: var(--navy-2); border-radius: 10px;
}
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }

/* Photo-or-initials avatar — used everywhere employees show up */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  color: #fff; font-weight: 700; font-size: 12px;
  text-transform: uppercase; line-height: 1;
}
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initials { background: var(--primary); }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-company { font-size: 11px; color: #93C5FD; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.user-role { font-size: 11px; color: #94A3B8; margin-top: 1px; }

.sidebar-footer { margin-top: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* Dark-mode toggle — icon-only button in the topbar (top-left). Size locked. */
.topbar .theme-toggle,
button.theme-toggle {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  width: 38px !important; height: 38px !important;
  min-width: 38px; max-width: 38px;
  min-height: 38px; max-height: 38px;
  padding: 0; margin: 0;
  background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0; flex-grow: 0; flex-basis: 38px;
  box-sizing: border-box;
  font-size: 0; line-height: 1;
  transition: background .15s, border-color .15s;
}
.topbar .theme-toggle:hover { background: var(--bg); border-color: var(--primary); }
.theme-icon-sun, .theme-icon-moon { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.theme-icon-sun  { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><circle cx='12' cy='12' r='4'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1' stroke='currentColor' stroke-width='2' stroke-linecap='round'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><circle cx='12' cy='12' r='4'/><path d='M12 2v3M12 19v3M2 12h3M19 12h3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1' stroke='currentColor' stroke-width='2' stroke-linecap='round'/></svg>"); }
.theme-icon-moon { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/></svg>"); display: none; }
[data-theme="dark"] .theme-icon-sun  { display: none; }
[data-theme="dark"] .theme-icon-moon { display: inline-block; }

.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; min-height: 44px;
  background: var(--navy-2); color: #CBD5E1;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}
.logout-btn:hover { background: var(--primary); color: #fff; text-decoration: none; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.main { flex: 1; margin-left: 240px; min-width: 0; padding-bottom: 32px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 14px; font-weight: 600; color: var(--muted); flex: 1; }
.topbar-logo { display: none; flex-shrink: 0; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1280px; margin: 0 auto; }

.banner {
  padding: 12px 24px; font-size: 14px;
  display: flex; gap: 16px; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.banner-info { background: #EFF6FF; color: #1E40AF; }
.banner-warn { background: #FEF3C7; color: #92400E; }
.banner a { color: inherit; font-weight: 700; text-decoration: underline; }

.flash { margin: 16px 24px 0; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.flash-ok { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.flash-error { background: var(--warn-soft); color: var(--warn); border: 1px solid #FECACA; }

.bottom-nav { display: none; }

/* === Page head === */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Cards === */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: var(--gap); }
.card-title { font-size: 15px; color: var(--text); margin-bottom: 12px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.cards-grid.two-col { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat-card { padding: 18px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 32px; font-weight: 700; margin-top: 4px; }
.stat-link { display: inline-block; margin-top: 8px; font-size: 13px; }
.stat-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.big-num { font-size: 36px; font-weight: 700; line-height: 1; }
.big-num span { font-size: 14px; color: var(--muted); font-weight: 500; }

/* === Buttons & forms === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; min-height: 44px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-warn { background: var(--card); color: var(--warn); border-color: #FECACA; }
.btn-warn:hover { background: var(--warn-soft); }
.btn-ghost { background: var(--card); }
.btn-ghost:hover { background: #F1F5F9; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.form-row input { flex: 1; min-width: 200px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  font: inherit; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field input[type="color"] { padding: 4px; height: 44px; min-height: 44px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-box { padding: 12px; background: var(--primary-soft); border: 1px solid #BFDBFE; border-radius: 8px; font-size: 13px; }
.inline-form { display: inline-flex; }

.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; padding: 10px 12px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; }

/* === Tables === */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #F8FAFC; }
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #E2E8F0; color: var(--text); }
.badge-ok, .badge-approved, .badge-active { background: #DCFCE7; color: #166534; }
.badge-error, .badge-rejected, .badge-expired { background: #FEE2E2; color: #991B1B; }
.badge-pending, .badge-trial { background: #FEF3C7; color: #92400E; }
.badge-info, .badge-vacation, .badge-cancelled { background: #DBEAFE; color: #1E40AF; }
.badge-sick, .badge-warn { background: #FEE2E2; color: #B91C1C; }
.badge-other, .badge-muted { background: #E2E8F0; color: var(--muted); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }

.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.dl dt { color: var(--muted); }

.empty { padding: 32px; text-align: center; color: var(--muted); }

/* === Calendar === */
.calendar-controls { margin-bottom: 12px; }
.calendar-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.calendar { width: 100%; border-collapse: collapse; min-width: 760px; }
.calendar th, .calendar td { border: 1px solid var(--border); padding: 0; text-align: left; vertical-align: top; }
.calendar thead th { background: #F8FAFC; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.calendar .sticky-col { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 180px; }
.calendar .emp-cell { padding: 12px; font-weight: 600; }
.calendar .day-cell { height: 70px; padding: 6px; cursor: pointer; position: relative; }
.calendar .day-cell:hover { background: #F8FAFC; }
.calendar .day-head { text-align: center; }
.calendar .day-head .dl { display: block; font-weight: 700; color: var(--text); font-size: 13px; }
.calendar .day-head .dd { display: block; color: var(--muted); font-size: 11px; }
.shift-block { padding: 6px 8px; border-radius: 6px; font-size: 12px; }
.shift-time { font-weight: 700; }
.shift-note { color: var(--muted); margin-top: 2px; font-size: 11px; }
.leave-block { padding: 6px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; text-align: center; }
.leave-vacation { background: #DBEAFE; color: #1E40AF; }
.leave-sick { background: #FEE2E2; color: #B91C1C; }
.leave-other { background: #E2E8F0; color: var(--muted); }
.add-hint { color: #CBD5E1; text-align: center; font-size: 18px; line-height: 60px; }
.day-cell:hover .add-hint { color: var(--primary); }

/* === Modal === */
.modal { border: none; padding: 0; border-radius: 12px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); width: 90%; max-width: 420px; }
.modal::backdrop { background: rgba(15, 23, 42, .5); }
.modal form { padding: 24px; }
.modal h3 { margin-top: 0; }

/* === Auth === */
.auth-body { background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side { background: var(--navy); color: #E2E8F0; padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.auth-side h2 { color: #fff; margin-top: auto; font-size: 28px; line-height: 1.2; }
.auth-brand { display: flex; align-items: center; }
.auth-brand img { max-width: 100%; height: auto; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: #CBD5E1; font-size: 14px; }
.auth-points li::before { content: '✓'; color: var(--primary); margin-right: 8px; font-weight: 700; }
.auth-main { padding: 40px; display: grid; place-items: center; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; box-shadow: var(--shadow); width: 100%; max-width: 420px; }
.auth-links { margin-top: 16px; font-size: 14px; text-align: center; color: var(--muted); display: flex; gap: 8px; justify-content: center; }

/* === Settings tabs === */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px; }
.tab.active { color: var(--primary); border-color: var(--primary); }

/* === Misc === */
.staff-today { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.staff-today li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.staff-today .name { flex: 1; }
.staff-today .time { color: var(--muted); }
.activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.activity li { font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: none; padding-bottom: 0; }
.act-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 2px; }
.quota-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.quota-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #F8FAFC; border-radius: 8px; font-size: 13px; }
.quota-item .qname { flex: 1; }
.quota-item .qval { color: var(--muted); }
.overview-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.overview-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.note-cell { max-width: 300px; }

.pricing-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.pricing-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.pricing-table tr.total td { border-bottom: none; padding-top: 12px; font-size: 16px; }

/* Plan cards on /billing/setup */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card {
  position: relative; cursor: pointer; padding: 18px;
  background: var(--card); border: 2px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  display: flex; flex-direction: column; gap: 10px;
}
.plan-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:hover { border-color: #93C5FD; }
.plan-card.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.plan-badge {
  position: absolute; top: -10px; right: 12px;
  background: var(--ok); color: #fff;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.plan-head { display: flex; flex-direction: column; gap: 4px; }
.plan-name { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.plan-price { font-size: 22px; font-weight: 700; color: var(--text); }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text); }
.plan-feats li::before { content: '·'; color: var(--muted); margin-right: 6px; }
.plan-foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.plan-foot.ok { color: var(--ok); font-weight: 600; }
@media (max-width: 720px) { .plan-grid { grid-template-columns: 1fr; } }

/* Photo row in employee form */
.photo-row { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.photo-current .avatar { font-size: 22px; }

/* === Org chart (Personio-style) === */
.org-wrap { overflow-x: auto; padding: 24px 8px 8px; }
.org-tree, .org-children { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; gap: 24px; position: relative; }
.org-tree { padding-top: 0; }
.org-children { padding-top: 36px; }
.org-node { position: relative; display: flex; flex-direction: column; align-items: center; }

/* Connector down to children (vertical line under parent card) */
.org-node.has-children::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 2px; height: 36px; background: var(--border);
  bottom: -36px; bottom: auto;
  top: calc(100% - 0px);
}
/* Vertical line up from each child */
.org-children > .org-node::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  top: -18px; width: 2px; height: 18px; background: var(--border);
}
/* Horizontal connector across siblings */
.org-children::before {
  content: ''; position: absolute; top: 18px; left: 0; right: 0; height: 2px;
  background: var(--border);
}
/* Single child has no horizontal line */
.org-children:has(> .org-node:only-child)::before { display: none; }
/* Trim horizontal line at each end (don't extend past first/last child) */
.org-children > .org-node:first-child::after,
.org-children > .org-node:last-child::after {
  content: ''; position: absolute; top: 18px; height: 2px; background: var(--card);
  width: 50%;
}
.org-children > .org-node:first-child::after { left: 0; }
.org-children > .org-node:last-child::after { right: 0; }

.org-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-width: 220px; max-width: 280px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.org-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,.08); }
.org-meta { flex: 1; min-width: 0; }
.org-name { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-pos  { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-reports { font-size: 11px; color: var(--primary); margin-top: 4px; font-weight: 600; }

@media (max-width: 720px) {
  .org-tree, .org-children { flex-direction: column; align-items: center; gap: 12px; }
  .org-children { padding-top: 12px; padding-left: 24px; border-left: 2px solid var(--border); align-items: stretch; }
  .org-node.has-children::after,
  .org-children > .org-node::before,
  .org-children::before,
  .org-children > .org-node:first-child::after,
  .org-children > .org-node:last-child::after { display: none; }
  .org-card { min-width: 0; max-width: none; width: 100%; }
}

/* Empty state hero (used on /shifts when no employees) */
.empty-hero {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 40px 32px; text-align: center; box-shadow: var(--shadow);
}
.empty-hero-icon {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  margin: 0 auto 16px; display: grid; place-items: center;
}
.empty-hero h3 { font-size: 20px; margin-bottom: 6px; }
.empty-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; margin: 24px auto 0; text-align: left; }
@media (max-width: 720px) { .empty-options { grid-template-columns: 1fr; } }
.empty-option {
  display: block; padding: 18px;
  background: var(--card); border: 2px solid var(--border); border-radius: 12px;
  color: var(--text); transition: border-color .15s, background .15s;
}
.empty-option:hover { text-decoration: none; border-color: var(--primary); background: var(--primary-soft); }
.empty-option-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.empty-option p { font-size: 13px; color: var(--muted); margin: 0; }
.empty-option.highlight { border-color: var(--primary); background: var(--primary-soft); }

/* Yearly upsell card */
.upsell-card {
  position: relative;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-color: #BFDBFE;
}
[data-theme="dark"] .upsell-card { background: linear-gradient(135deg, #1E2C50 0%, #1B2A4A 100%); border-color: #2C3E72; }
.upsell-badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--ok); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}

.plan-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.mobile-only { display: none; }

/* === Mobile === */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding-bottom: 84px; }
  .menu-btn { display: inline-flex; flex-direction: column; gap: 4px; padding: 8px; background: transparent; border: none; cursor: pointer; }
  .menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
  .topbar-logo { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-title { display: none; }
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 24px 16px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 6px 4px env(safe-area-inset-bottom, 6px); z-index: 20;
  }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; min-height: 56px; color: var(--muted); font-size: 11px; }
  .bn-item.active { color: var(--primary); }
  .bn-item .nav-icon { width: 22px; height: 22px; }

  .mobile-only { display: block; }
  .calendar { min-width: 100%; }
  .calendar td.day-cell, .calendar th.day-head { display: none; }
  .calendar td.day-cell.show, .calendar th.day-head.show { display: table-cell; }
  .calendar .sticky-col { min-width: 140px; }

  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { border-bottom: 1px solid var(--border); padding: 12px 0; }
  .data-table td { border: none; padding: 4px 12px; }
  .data-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }

  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn-primary { width: 100%; }

  .topbar-user { display: none; }
  .topbar-logout .logout-label { display: none; }
  .topbar-logout { padding: 8px 10px; min-height: 38px; }
}
