/* ─── Gotham (primary font) ────────────────────────────────────────────── */
@font-face {
  font-family: 'Gotham';
  src: url('/fonts/gotham_book.woff2?v=1') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('/fonts/gotham_bold.woff2?v=1') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Variables — Light theme (design) ──────────────────────────────────── */
:root {
  --primary: #8E1B3B;
  --primary-dark: #6B1020;
  --primary-hover: #B4234C;
  --primary-light: rgba(142,27,59,.10);
  --primary-border: rgba(142,27,59,.22);

  --bg: #F1F1F4;
  --surface: #FFFFFF;
  --surface-2: #F4F4F7;
  --surface-3: #FAFAFB;
  --sidebar-bg: #FFFFFF;
  --sidebar-hover: var(--surface-2);
  --sidebar-active-bg: rgba(142,27,59,.10);
  --sidebar-active-color: #8E1B3B;
  --sidebar-text: #6E6E7C;
  --card-bg: #FFFFFF;

  --accent: #3B82F6;
  --accent-light: #EFF6FF;

  --text: #16161D;
  --text-secondary: #454552;
  --text-muted: #6E6E7C;
  --text-light: #9B9BA8;

  --border: rgba(17,17,26,.07);
  --border-strong: rgba(17,17,26,.13);

  --success: #16A34A;
  --success-light: #ECFDF5;
  --warning: #D9822B;
  --warning-light: rgba(217,130,43,.12);
  --danger: #E5484D;
  --danger-light: #FEF2F2;

  --glass: rgba(255,255,255,.72);
  --glass-border: rgba(17,17,26,.06);
  --shadow-clr: rgba(17,17,26,.16);

  --ring-track: #E9E9ED;
  --check-border: rgba(17,17,26,.18);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(17,17,26,.06), 0 1px 2px rgba(17,17,26,.04);
  --shadow-md: 0 4px 14px rgba(17,17,26,.08);
  --shadow-lg: 0 16px 40px rgba(17,17,26,.14);
  --transition: 0.17s ease;
  --sidebar-width: 256px;
}

/* ─── Dark theme ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0B0B0F;
  --surface: #15151B;
  --surface-2: #1E1E27;
  --surface-3: #121218;
  --sidebar-bg: rgba(16,16,22,.95);
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active-bg: rgba(226,75,103,.15);
  --sidebar-active-color: #E24B67;
  --sidebar-text: #B8B8C4;
  --card-bg: #15151B;

  --primary-light: rgba(142,27,59,.15);
  --primary-border: rgba(226,75,103,.30);

  --text: #F3F3F6;
  --text-secondary: #B8B8C4;
  --text-muted: #8B8B98;
  --text-light: #63636F;

  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);

  --glass: rgba(16,16,22,.68);
  --glass-border: rgba(255,255,255,.07);
  --shadow-clr: rgba(0,0,0,.6);

  --ring-track: #26262F;
  --check-border: rgba(255,255,255,.22);

  --success-light: rgba(22,163,74,.15);
  --warning-light: rgba(217,130,43,.16);
  --danger-light: rgba(229,72,77,.15);
  --accent-light: rgba(59,130,246,.15);
  --danger: #E24B67;
  --warning: #F5A524;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
img { outline: none; border: none; }
html, body {
  height: 100%;
  font-family: 'Gotham', system-ui, -apple-system, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ─── Login Screen ──────────────────────────────────────────────────────── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #0F172A 0%, #1E1E2E 60%, #2D1B2E 100%);
}

.login-card {
  background: white; border-radius: 18px; padding: 48px 40px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 34px;
}
.login-logo-icon {
  width: 42px; height: 42px; background: var(--primary);
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: white;
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

.login-card h2 { font-size: 19px; font-weight: 700; margin-bottom: 5px; }
.login-card p { color: var(--text-muted); margin-bottom: 28px; font-size: 13.5px; }

.form-group { margin-bottom: 15px; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition);
  outline: none; background: #FAFAFA;
}
.form-group input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(136,19,55,0.08); }

.btn-primary {
  width: 100%; padding: 12px; background: var(--primary); color: white;
  border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 700;
  transition: var(--transition); margin-top: 8px; letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.99); }

.login-error {
  background: var(--danger-light); color: var(--danger); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
  display: none; border: 1px solid #FCA5A5;
}
.forgot-link {
  background: none; border: none; color: var(--primary); font-size: 13px;
  cursor: pointer; text-decoration: underline; padding: 0; font-family: inherit;
}
.forgot-link:hover { opacity: 0.75; }

/* ─── App Layout ────────────────────────────────────────────────────────── */
#app-screen { display: flex; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto; overflow-x: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}
[data-theme="dark"] #sidebar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-header {
  padding: 0 16px;
  min-height: 64px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(140deg, var(--primary), var(--primary-hover));
  box-shadow: 0 6px 16px -6px var(--primary);
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white;
}
.sidebar-logo-text {
  font-size: 15px; font-weight: 800; color: var(--text);
  letter-spacing: -0.02em;
}
.sidebar-logo-sub {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  margin-top: 1px;
}

.sidebar-nav { padding: 12px 10px 4px; }
.sidebar-section-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-light); padding: 14px 10px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 600;
  transition: var(--transition); cursor: pointer; width: 100%;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color, var(--primary)); font-weight: 700;
}
.nav-item .icon {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 20px; color: inherit; opacity: 0.85;
}
.nav-item.active .icon { opacity: 1; }
.nav-item .label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .badge {
  background: var(--danger); color: white; border-radius: 10px;
  font-size: 9.5px; font-weight: 700; padding: 1px 6px;
}

.sidebar-projects { padding: 0 10px 8px; }
.project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Collapsible projects header */
.sidebar-projects-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: var(--transition); user-select: none;
}
.sidebar-projects-header:hover { background: var(--sidebar-hover); color: var(--text); }
.sidebar-projects-header .icon {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 20px; opacity: 0.75;
}
.sidebar-projects-header .label { flex: 1; }
.projects-chevron { display: flex; align-items: center; opacity: 0.55; transition: transform 0.22s ease; }
.sidebar-projects-header.collapsed .projects-chevron { transform: rotate(180deg); }

/* Collapsible wrapper */
#sidebar-projects-wrapper {
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.22s ease;
  max-height: 1200px; opacity: 1;
}
#sidebar-projects-wrapper.collapsed { max-height: 0; opacity: 0; }

/* Tree structure */
.projects-tree {
  position: relative;
  padding-left: 8px;
}
.projects-tree::before {
  content: '';
  position: absolute;
  left: 21px; top: 8px; bottom: 14px;
  width: 1px;
  background: var(--border-strong);
}
.project-tree-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 34px;
  border-radius: 10px;
  color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  cursor: pointer; position: relative; transition: var(--transition);
}
.project-tree-item::before {
  content: '';
  position: absolute;
  left: 21px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 1px;
  background: var(--border-strong);
}
.project-tree-item:hover { background: var(--sidebar-hover); color: var(--text); }
.project-tree-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color, var(--primary)); font-weight: 600;
}
.project-count { font-size: 11px; color: var(--text-light); flex-shrink: 0; }

/* Feedback block at sidebar bottom */
.sidebar-feedback {
  margin: 8px 14px;
  padding: 14px 12px;
  background: var(--surface-2);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.sidebar-feedback-title {
  font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.sidebar-feedback-desc {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.45;
}
.feedback-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  width: 100%; padding: 10px 14px; border-radius: 12px;
  background: var(--primary); color: white;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: none; transition: var(--transition);
  font-family: inherit; box-sizing: border-box;
  text-align: left; line-height: 1.35;
}
.feedback-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.feedback-btn svg { flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto; padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; cursor: pointer; transition: var(--transition); outline: none;
}
.user-info:hover { background: var(--sidebar-hover); }
.user-info:focus { outline: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: white; flex-shrink: 0; outline: none;
}
.avatar img { outline: none; display: block; }
.user-info .user-name { color: var(--text); font-size: 13px; font-weight: 600; }
.user-info .user-role { color: var(--text-muted); font-size: 11px; margin-top: 1px; }

/* ─── Theme toggle button ────────────────────────────────────────────────── */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: var(--transition);
  font-size: 16px; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--sidebar-hover); color: var(--text); }

/* ─── Main Content ──────────────────────────────────────────────────────── */
#main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); }

.topbar {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  padding: env(safe-area-inset-top, 0px) 24px 0 24px;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex-shrink: 0;
}
.topbar-brand { min-width: 0; }
.topbar-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  white-space: nowrap; line-height: 1.2;
}
.topbar-subtitle {
  font-size: 12px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; font-weight: 400;
}
.topbar-search-wrap { flex: 1; display: flex; justify-content: center; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-family: inherit;
  cursor: pointer; transition: var(--transition);
  width: 100%; max-width: 320px;
}
.topbar-search:hover { border-color: var(--border-strong); background: var(--surface); }
.topbar-search span { flex: 1; text-align: left; }
.topbar-search kbd {
  font-size: 10px; font-family: inherit; color: var(--text-light);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; letter-spacing: 0.02em;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

.page-content { padding: 22px 24px; flex: 1; }
/* Любой grid внутри page-content получает боковой отступ чтобы тени не обрезались */
.page-content [style*="grid"],
.page-content .b2c-courses-grid,
.page-content .projects-grid,
.page-content .team-grid,
.page-content .report-grid,
.page-content .ih-grid { overflow: visible; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; transition: var(--transition);
  white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-blue {
  background: linear-gradient(140deg, var(--primary), var(--primary-hover));
  color: white; border-radius: 20px;
  box-shadow: 0 0 16px -2px rgba(142,27,59,.35), 0 6px 18px -6px var(--primary);
  padding: 10px 18px; font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.01em;
}
.btn-blue:hover { transform: translateY(-1px); box-shadow: 0 0 24px -2px rgba(142,27,59,.5), 0 10px 22px -6px var(--primary); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text-secondary); background: var(--surface); }
.btn.btn-primary { border: 1.5px solid transparent; background: var(--primary); color: white; width: auto; padding: 8px 16px; margin-top: 0; font-size: 13px; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #FCA5A5; }
.btn-danger:hover { background: #FEE2E2; }
.btn-danger-solid { background: #DC2626; color: white; border: none; }
.btn-danger-solid:hover { background: #B91C1C; }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-notif {
  position: relative; width: 38px; height: 38px; border-radius: 11px;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.btn-notif:hover { border-color: var(--primary); color: var(--primary); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; background: var(--danger); border-radius: 50%;
  border: 2px solid white;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px; box-shadow: var(--shadow);
}

/* ─── Stats Grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid transparent;
  flex-shrink: 0;
}
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* ─── Clickable stat cards ──────────────────────────────────────────────── */
.stat-clickable { cursor: pointer; transition: var(--transition); }
.stat-clickable:hover {
  border-color: var(--primary); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(142,27,59,0.12);
}
.stat-clickable:active { transform: translateY(0); }

/* ─── Dashboard Summary Banner ───────────────────────────────────────────── */
.dash-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: var(--radius-lg); padding: 16px 24px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 0; color: white;
  overflow: hidden; position: relative;
}
.dash-summary::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.dash-summary-item {
  flex: 1; padding: 0 20px; border-right: 1px solid rgba(255,255,255,0.12);
}
.dash-summary-item:first-child { padding-left: 0; }
.dash-summary-item:last-child { border-right: none; }
.dash-summary-label { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }
.dash-summary-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.dash-summary-sub { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.dash-summary-accent { color: #FCA5A5; }
.dash-summary-green { color: #6EE7B7; }

/* ─── New Dashboard Stat Cards ───────────────────────────────────────────── */
.dash-stat-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px;
}
@media (max-width: 1200px) { .dash-stat-cards { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1000px) { .dash-stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dash-stat-cards { grid-template-columns: 1fr; } }

.dash-stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px 22px;
  position: relative; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
}
.dash-stat-card--done {
  background: linear-gradient(145deg, #8E1B3B 0%, #B4234C 100%) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 8px 24px -8px rgba(142,27,59,.5);
  overflow: hidden;
}
.dsc-orb {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
}
.dsc-orb--1 {
  width: 130px; height: 130px;
  right: 30px; top: -10px;
  background: rgba(255,255,255,.30);
  filter: blur(22px);
}
.dsc-orb--2 {
  width: 100px; height: 100px;
  left: 10px; bottom: -10px;
  background: rgba(255,170,170,.32);
  filter: blur(28px);
}
.dash-stat-card--done > *:not(.dsc-orb) { position: relative; z-index: 1; }
.dash-stat-card--click { cursor: pointer; }
.dash-stat-card--click:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(17,17,26,.12); }
.dash-stat-card--danger .dsc-value { color: var(--danger); }

.dsc-top-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}
.dsc-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--surface-2); color: var(--text-muted);
}
.dsc-icon--orange { background: rgba(217,130,43,.12); color: #D9822B; }
.dsc-icon--red    { background: rgba(229,72,77,.12); color: #E5484D; }
.dsc-icon--stack  { background: var(--surface-2); color: var(--text-muted); }
.dash-stat-card--done .dsc-icon { background: rgba(255,255,255,.18); color: white; }

.dsc-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.dash-stat-card--done .dsc-label { color: rgba(255,255,255,.70); }

.dsc-value {
  font-size: 42px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px;
  letter-spacing: -0.03em;
}
.dash-stat-card--done .dsc-value { color: white; font-size: 46px; }
.dsc-value--green { color: var(--success); }
.dsc-value--red   { color: var(--danger); }

.dsc-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.dsc-sub--link { color: var(--primary); font-weight: 600; }
.dash-stat-card--done .dsc-sub { color: rgba(255,255,255,.65); }

.dsc-new-badge {
  display: inline-flex; align-items: center; gap: 4px;
  color: #3B82F6; font-size: 12px; font-weight: 600; margin-right: 4px;
}
.dsc-separator { color: var(--text-light); font-size: 11px; margin: 0 2px; }

/* Progress bar on "done" card */
.dsc-progress {
  margin-top: 14px;
}
.dsc-progress-bar {
  height: 5px; border-radius: 4px;
  background: rgba(255,255,255,.25);
  overflow: hidden;
}
.dsc-progress-fill {
  height: 100%; border-radius: 4px;
  background: rgba(255,255,255,.85);
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
}
.dsc-progress-label {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: rgba(255,255,255,.65); margin-top: 5px;
}

/* ─── Stat Bar Rows ──────────────────────────────────────────────────────── */
.stat-bar-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 11px;
}
.stat-bar-row:last-of-type { margin-bottom: 0; }
.stat-bar-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--text);
  width: 88px; flex-shrink: 0;
}
.stat-bar-track {
  flex: 1; height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden;
}
.stat-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
}
.stat-bar-count {
  font-size: 12px; color: var(--text-muted);
  width: 70px; text-align: right; flex-shrink: 0; white-space: nowrap;
}
.stat-bar-footer {
  display: flex; align-items: center; gap: 7px;
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.stat-bar-footer-pct { color: #059669; font-weight: 700; font-size: 13px; }

/* ─── My Tasks Summary ───────────────────────────────────────────────────── */
.mytasks-charts {
  display: grid; grid-template-columns: 180px 1fr; gap: 14px; margin-bottom: 16px;
}
.mytasks-charts .chart-panel { max-height: 260px; }

/* My Tasks — Project Cards */
.mytasks-proj-section { margin-bottom: 16px; }
.mytasks-proj-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 12px;
}
.mytasks-proj-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.mytasks-proj-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
}
.mytasks-proj-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(17,17,26,.12); }

/* Header zone — neutral surface, project color used only as accent */
.mpc-header {
  padding: 1.25rem 1.25rem 1rem;
}
.mpc-header-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem;
}
.mpc-title-row { display: flex; align-items: center; gap: 8px; }
.mpc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--proj-color); flex-shrink: 0; }
.mpc-proj-name { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
.mpc-date-badge {
  font-size: 11.5px; color: var(--text-muted);
  background: var(--surface-2); padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
}
.mpc-big-count { display: flex; align-items: baseline; gap: 3px; }
.mpc-big-done  { font-size: 50px; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.mpc-big-total { font-size: 20px; font-weight: 500; color: var(--text-light); }
.mpc-count-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.mpc-prog-track {
  margin-top: 1.1rem; background: var(--surface-2);
  border-radius: 6px; height: 4px; overflow: hidden;
}
.mpc-prog-fill { height: 100%; background: var(--proj-color); border-radius: 6px; transition: width 0.8s cubic-bezier(0.22,1,0.36,1); }

/* Stats grid */
.mpc-stats-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 0; background: var(--border);
}
.mpc-sgrid-cell {
  background: var(--surface); padding: 0.9rem 0.5rem; text-align: center;
}
.mpc-sgrid-mid { border-left: 0.5px solid var(--border); border-right: 0.5px solid var(--border); }
.mpc-sgrid-num { font-size: 22px; font-weight: 500; color: var(--text); line-height: 1; }
.mpc-sgrid-lbl { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.04em; }
.mpc-sgrid-cell--done .mpc-sgrid-num { color: var(--success); }
.mpc-sgrid-cell--done .mpc-sgrid-lbl { color: var(--success); }
.mpc-sgrid-cell--overdue .mpc-sgrid-num { color: var(--danger); }
.mpc-sgrid-cell--overdue .mpc-sgrid-lbl { color: var(--danger); }

/* Footer */
.mpc-footer {
  padding: 0.85rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border-top: 0.5px solid var(--border);
}
.mpc-prog-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mpc-prog-circle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--proj-color); color: var(--proj-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: -0.03em; flex-shrink: 0;
}
.mpc-prog-label { font-size: 13px; color: var(--text-muted); }
.mpc-ov-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  background: var(--danger-light); color: var(--danger);
}
.mpc-ov-pill svg { width: 15px; height: 15px; flex-shrink: 0; }
.mpc-inp-pill {
  background: var(--warning-light); color: var(--warning);
  padding: 5px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.mpc-ok-pill {
  background: var(--success-light); color: var(--success);
  padding: 5px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}

/* My Tasks — Upcoming Block */
.upc-block {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 16px;
}

/* Mini calendar */
.upc-cal-header {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 12px;
}
.upc-cal-month {
  font-size: 14px; font-weight: 700; color: var(--text); min-width: 140px; text-align: center;
}
.upc-cal-arrow {
  width: 26px; height: 26px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.upc-cal-arrow:hover { background: var(--bg); color: var(--text); }
.upc-cal-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 4px;
}
.upc-cal-daynames > div {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  padding: 3px 0;
}
.upc-cal-date {
  font-size: 13px; color: var(--text-secondary);
  padding: 5px 0; border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; transition: background 0.15s;
}
.upc-cal-dim { color: var(--text-light); }
.upc-cal-today {
  background: var(--text); color: white;
  font-weight: 700;
}

/* Section title */
.upc-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin: 16px 0 10px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Task cards */
.upc-cards-list {
  max-height: 280px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  display: flex; flex-direction: column; gap: 8px;
}
.upc-cards-list::-webkit-scrollbar { width: 4px; }
.upc-cards-list::-webkit-scrollbar-track { background: transparent; }
.upc-cards-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.upc-card {
  background: var(--bg); border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 14px; cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}
.upc-card:hover { background: var(--surface); box-shadow: var(--shadow-md); }
.upc-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.upc-card-title {
  font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.35;
}
.upc-card-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white; flex-shrink: 0;
}
.upc-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.upc-card-deadline {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.upc-card-deadline.upc-days-urgent { color: #DC2626; }
.upc-card-deadline.upc-days-soon   { color: #D97706; }
.upc-card-proj {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted);
}
.upc-empty { font-size: 12.5px; color: #94A3B8; padding: 6px 0; }

/* ─── Dashboard Charts ───────────────────────────────────────────────────── */
.dash-charts {
  display: grid; grid-template-columns: 1fr 1.5fr 1.5fr; gap: 14px; margin-bottom: 22px;
}
.chart-panel {
  background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.dash-charts .chart-panel {
  max-height: 340px;
}

/* Big percent in status panel */
.dash-pct-big {
  font-size: 46px; font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1;
  margin-bottom: 4px;
}
.dash-pct-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }

/* Segmented single-row bar */
.dash-seg-bar {
  display: flex; gap: 4px; height: 14px; border-radius: 5px; overflow: hidden;
  background: var(--surface-2);
}
.dash-seg-fill {
  height: 100%; border-radius: 5px;
  transition: width 0.9s cubic-bezier(0.2,0.7,0.3,1);
  min-width: 0;
}
.chart-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 14px; flex-shrink: 0;
}
.chart-scroll {
  overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chart-scroll::-webkit-scrollbar { width: 4px; }
.chart-scroll::-webkit-scrollbar-track { background: transparent; }
.chart-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; overflow: visible; }
.donut-wrap svg { max-width: 100%; height: auto; display: block; }
.donut-legend { width: 100%; margin-top: 10px; }
.donut-legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; padding: 3px 0; color: var(--text-secondary);
}
.donut-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-val { margin-left: auto; font-weight: 700; color: var(--text); }

.proj-bar-row { margin-bottom: 11px; border-radius: 6px; padding: 4px 6px; margin-left: -6px; margin-right: -6px; transition: background 0.15s; }
.proj-bar-row:last-child { margin-bottom: 0; }
.proj-bar-row:hover { background: var(--bg); }
.proj-bar-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}
.proj-bar-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
}
.proj-bar-count { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.proj-bar-track { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.proj-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

.emp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; border-radius: 6px; padding: 4px 6px; margin-left: -6px; margin-right: -6px; transition: background 0.15s; }
.emp-row:last-child { margin-bottom: 0; }
.emp-row:hover { background: var(--bg); }
.emp-avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-bar-track { height: 5px; background: var(--bg); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.emp-bar-fill { height: 100%; border-radius: 3px; }
.emp-pct { font-size: 11px; font-weight: 700; color: var(--text-muted); min-width: 32px; text-align: right; }

/* ─── Period filter ─────────────────────────────────────────────────────── */
.period-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.period-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text-muted); background: var(--surface);
  transition: var(--transition); cursor: pointer; white-space: nowrap;
}
.period-btn.active {
  border-color: transparent; color: white;
  background: linear-gradient(140deg, var(--primary), var(--primary-hover));
  font-weight: 600;
  box-shadow: 0 4px 12px -4px var(--primary);
}
.period-btn:hover:not(.active) { border-color: var(--border-strong); color: var(--text-secondary); background: var(--surface-2); }
.period-now-badge {
  font-size: 10px; font-weight: 700; background: rgba(255,255,255,.25);
  padding: 1px 6px; border-radius: 10px; letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ─── Task Cards ─────────────────────────────────────────────────────────── */
.tasks-list { display: flex; flex-direction: column; gap: 8px; }

.tasks-show-more {
  display: flex; justify-content: center; padding: 12px 0 4px;
}
.tasks-show-more-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-secondary); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow);
}
.tasks-show-more-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tasks-show-more-count {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  background: var(--bg); padding: 2px 7px; border-radius: 10px;
}
.tasks-all-shown {
  text-align: center; padding: 14px; font-size: 12.5px; color: var(--text-muted);
}
.tasks-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 16px 0 8px; flex-wrap: wrap;
}
.page-btn {
  min-width: 34px; height: 34px; padding: 0 8px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-dots { color: var(--text-muted); font-size: 13px; padding: 0 4px; }
.page-total { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

.task-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 16px 20px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex; align-items: flex-start; gap: 14px;
}
.task-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.task-card.done { opacity: 0.55; }

.task-card-left { flex: 1; min-width: 0; }
.task-card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.task-title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text); }
.task-card.done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-meta { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 11.5px; flex-wrap: wrap; margin-top: 5px; }
.task-meta-item { display: flex; align-items: center; gap: 3px; }
.task-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex-shrink: 0; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-priority-high { background: #FEE2E2; color: #B91C1C; }
.badge-priority-medium { background: #FEF3C7; color: #B45309; }
.badge-priority-low { background: var(--success-light); color: #065F46; }

.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.status-new { background: var(--accent-light); color: #1D4ED8; }
.status-in_progress { background: var(--warning-light); color: #92400E; }
.status-done { background: var(--success-light); color: #065F46; }
.status-pending_review { background: #f3f0ff; color: #6d28d9; }

.project-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── Deadline colors ───────────────────────────────────────────────────── */
.deadline-overdue { color: var(--danger); font-weight: 600; }
.deadline-soon { color: var(--warning); font-weight: 600; }
.deadline-ok { color: var(--text-muted); }

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; font-weight: 700; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; font-weight: 700; }
.avatar-lg { width: 42px; height: 42px; font-size: 16px; }

/* ─── Section header ─────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* ─── Urgent section ────────────────────────────────────────────────────────── */
.urgent-section { margin-bottom: 28px; }
.urgent-section-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.urgent-section-title { font-size: 15px; font-weight: 700; color: #DC2626; display: inline-flex; align-items: center; gap: 6px; }
.urgent-total-badge { background: #DC2626; color: #fff; font-size: 11px; font-weight: 800; border-radius: 20px; padding: 2px 9px; }
.urgent-pill { font-size: 11px; font-weight: 600; border-radius: 20px; padding: 2px 9px; }
.urgent-pill-overdue  { background: #FEE2E2; color: #B91C1C; }
.urgent-pill-today    { background: #FFEDD5; color: #C2410C; }
.urgent-pill-tomorrow { background: #FEF9C3; color: #A16207; }
.urgent-group-hdr { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 8px; margin-bottom: 8px; margin-top: 4px; }
.urgent-overdue-hdr  { background: #FEF2F2; color: #DC2626; }
.urgent-today-hdr    { background: #FFF7ED; color: #EA580C; }
.urgent-tomorrow-hdr { background: #FEFCE8; color: #CA8A04; }
.urgent-tasks-list   { margin-bottom: 10px; }

/* ─── Filters ─────────────────────────────────────────────────────────────── */
.filters { display: flex; align-items: center; gap: 7px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text-muted); background: var(--surface);
  transition: var(--transition); cursor: pointer;
}
.filter-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }
.filter-btn:hover:not(.active) { border-color: var(--border-strong); color: var(--text-secondary); }

.search-input {
  padding: 6px 14px 6px 34px; border: 1.5px solid var(--border);
  border-radius: 20px; font-size: 13px; outline: none; background: var(--surface);
  transition: var(--transition); width: 200px;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(136,19,55,0.07); }
.search-wrap { position: relative; }
.search-wrap::before {
  content: ''; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; opacity: 0.4;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230F172A' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* ─── Project Cards ─────────────────────────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: var(--transition);
}
.project-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card-header { height: 5px; }
.project-card-body { padding: 16px 18px 18px; }
.project-card-name { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.project-card-desc { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; min-height: 18px; }
.progress-bar { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.project-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

.add-project-card {
  background: var(--surface); border-radius: var(--radius);
  border: 2px dashed var(--border); padding: 32px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; transition: var(--transition); color: var(--text-muted);
}
.add-project-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ─── Team Grid ──────────────────────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.member-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 20px 16px; display: flex; flex-direction: column; align-items: center;
  gap: 9px; box-shadow: var(--shadow); text-align: center; transition: var(--transition);
  position: relative;
}
.member-card.clickable { cursor: pointer; }
.member-card.clickable:hover { box-shadow: var(--shadow-md); border-color: var(--primary-border); transform: translateY(-2px); }
.member-card .member-name { font-size: 14px; font-weight: 700; color: var(--text); }
.member-card .member-email { font-size: 11.5px; color: var(--text-muted); }
.member-card .member-role { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; }
.role-admin { background: var(--primary-light); color: var(--primary); }
.role-employee { background: var(--bg); color: var(--text-muted); }
.role-manager { background: #FEF3C7; color: #92400E; }

.perm-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.perm-tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 10px; background: var(--success-light); color: #065F46;
  border: 1px solid #A7F3D0;
}

.perm-checkboxes {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 12px 14px; border: 1.5px solid var(--border);
  max-height: 280px; overflow-y: auto;
}
.perm-checkbox-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 4px 4px; border-radius: 6px; transition: var(--transition);
}
.perm-checkbox-row:hover { background: var(--surface); }
.perm-checkbox-row input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}
.perm-checkbox-icon { font-size: 15px; }
.perm-checkbox-text { font-size: 13.5px; font-weight: 500; }
.perm-checkbox-disabled { opacity: 0.5; cursor: default; }
.perm-checkbox-disabled:hover { background: transparent; }
.member-tg { font-size: 11.5px; color: var(--success); font-weight: 500; }
.member-actions { display: flex; gap: 7px; margin-top: 2px; }

/* ─── Employee Profile Page ─────────────────────────────────────────────── */
.emp-profile-header {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 24px 28px; display: flex; align-items: center; gap: 22px;
  box-shadow: var(--shadow);
}
.emp-profile-avatar {
  width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: white;
}
.emp-profile-info { flex: 1; min-width: 0; }
.emp-profile-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.emp-profile-email { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.emp-profile-eff { text-align: right; flex-shrink: 0; min-width: 200px; }
.emp-profile-eff-val { font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.emp-profile-eff-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; margin-bottom: 8px; }
.emp-profile-eff-bar { width: 100%; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.emp-profile-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }

/* ─── Team member progress ───────────────────────────────────────────────── */
.member-progress { width: 100%; text-align: center; }
.member-task-counts { display: flex; justify-content: center; gap: 16px; }
.member-task-count { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.member-task-count-val { font-size: 16px; font-weight: 800; line-height: 1; }
.member-task-count-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.member-progress-bar { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.member-progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px; animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%;
  max-width: 520px; max-height: 90vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg); animation: slideUp 0.2s ease;
}
.modal-lg { max-width: 680px; }
.modal-header {
  padding: 22px 24px 0;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 7px; display: flex;
  align-items: center; justify-content: center; color: var(--text-muted);
  font-size: 17px; transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 0 24px 22px; }
.modal-footer {
  display: flex; gap: 9px; justify-content: flex-end;
  padding: 14px 24px; border-top: 1px solid var(--border);
}

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13.5px; outline: none;
  transition: var(--transition); background: var(--surface); color: var(--text);
  font-family: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.field select option, select option {
  font-family: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(136,19,55,0.07);
}
.field textarea { resize: vertical; min-height: 80px; }

/* ─── Status select ─────────────────────────────────────────────────────── */
.status-select { display: flex; gap: 7px; flex-wrap: wrap; }
.status-option {
  padding: 5px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; transition: var(--transition);
}
.status-option.new { background: var(--accent-light); color: #1D4ED8; }
.status-option.in_progress { background: var(--warning-light); color: #92400E; }
.status-option.done { background: var(--success-light); color: #065F46; }
.status-option.selected { border-color: currentColor; }

/* ─── Task Detail ────────────────────────────────────────────────────────── */
.task-detail-header { padding: 22px 24px 0; }
.task-detail-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  background: var(--bg); border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0;
}
.task-detail-meta-item .label {
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}
.task-detail-meta-item .value { font-size: 13.5px; font-weight: 500; }

/* ─── Comments ──────────────────────────────────────────────────────────── */
.comments-section { margin-top: 18px; }
.comments-title {
  font-size: 11px; font-weight: 700; margin-bottom: 10px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { display: flex; gap: 9px; }
.comment-body { flex: 1; }
.comment-author { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.comment-text { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.comment-time { font-size: 10.5px; color: var(--text-muted); }
.comment-input-row { display: flex; gap: 8px; }
.comment-input {
  flex: 1; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none; transition: var(--transition);
}
.comment-input:focus { border-color: var(--primary); }

/* ─── Notifications Panel ───────────────────────────────────────────────── */
.notif-panel {
  position: fixed; top: 55px; right: 16px;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); width: 340px; max-height: 460px;
  overflow-y: auto; z-index: 50; animation: slideUp 0.15s ease;
}
.notif-panel-header {
  padding: 13px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.notif-panel-title { font-size: 13.5px; font-weight: 700; }
.notif-item {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #FFE4E8; }
.notif-item-msg { font-size: 12.5px; line-height: 1.4; margin-bottom: 3px; }
.notif-item-time { font-size: 11px; color: var(--text-muted); }
.notif-item-clickable { cursor: pointer; }
.notif-item-clickable:hover .notif-item-link { opacity: 1; }
.notif-item-link { font-size: 11px; color: var(--primary); font-weight: 600; opacity: 0; transition: opacity 0.15s; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ─── Project Tabs ───────────────────────────────────────────────────────── */
.proj-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.proj-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; border-radius: 0;
}
.proj-tab:hover { color: var(--text); }
.proj-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.proj-tab-count {
  background: var(--border); color: var(--text-muted); font-size: 10px;
  font-weight: 700; padding: 1px 5px; border-radius: 10px;
}

/* ─── Content Plan ───────────────────────────────────────────────────────── */
.cp-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.cp-nav { display: flex; align-items: center; gap: 8px; }
.cp-nav-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background 0.15s;
}
.cp-nav-btn:hover { background: var(--bg); }
.cp-nav-title { font-size: 15px; font-weight: 700; min-width: 180px; text-align: center; }

.cp-scroll-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 14px; }
.cp-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.cp-table thead th {
  background: #0F172A; color: white; font-size: 11px; font-weight: 600;
  text-align: center; padding: 9px 6px; letter-spacing: 0.05em; text-transform: uppercase;
}
.cp-week-col { width: 68px; }
.cp-table tbody tr { border-bottom: 1px solid var(--border); }
.cp-week-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted); text-align: center;
  vertical-align: top; padding: 8px 4px; background: #F8FAFC;
  border-right: 1px solid var(--border); white-space: nowrap;
}
.cp-cell {
  vertical-align: top; padding: 6px; min-width: 90px; min-height: 80px;
  border-right: 1px solid var(--border); background: var(--surface);
}
.cp-cell:last-child { border-right: none; }
.cp-empty { background: #F8FAFC; }
.cp-weekend { background: #FAFAFA; }
.cp-today .cp-day-num {
  background: var(--primary); color: white; border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
}
.cp-has-items { background: #FDFEFF; }
.cp-day-num {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between;
}
.cp-chip {
  margin-bottom: 4px; padding: 3px 5px; border-radius: 4px;
  font-size: 10.5px; line-height: 1.3;
}
.cp-chip-type { font-weight: 700; display: block; }
.cp-chip-title { color: #374151; display: block; margin-top: 1px; }
.cp-chip-has-desc {
  display: block; height: 2px; border-radius: 2px; margin-top: 3px;
  background: currentColor; opacity: 0.35; width: 60%;
}
.cp-chip[draggable] { cursor: grab; transition: opacity .15s, box-shadow .15s; }
.cp-chip[draggable]:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.cp-chip.cp-dragging { opacity: .4; cursor: grabbing; }
.cp-cell.cp-drag-over { background: #EFF6FF !important; outline: 2px dashed #3B82F6; }
.cp-add-btn {
  display: none; background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; color: #6366f1; font-weight: 700;
  padding: 0 2px; border-radius: 4px; transition: background .15s;
}
.cp-cell:hover .cp-add-btn { display: inline-flex; }
.cp-add-btn:hover { background: #E0E7FF; }

.cp-add-popup {
  position: absolute; z-index: 9999;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.13);
  min-width: 220px;
}
.cp-add-popup-title { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 8px; }

/* Content plan publication modal */
.cp-pub-modal { max-width: 560px; }
.cp-pub-type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-pub-type-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid #e2e8f0; font-size: 13px; font-weight: 600;
  color: #374151; transition: all .15s; user-select: none;
  background: #f8fafc;
}
.cp-pub-type-btn:hover { border-color: #94a3b8; background: #f1f5f9; }
.cp-pub-type-btn.active { border-color: currentColor; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.06); }
.cp-pub-type-btn[data-val="post"].active { border-color: #6366f1; color: #6366f1; background: #eef2ff; }
.cp-pub-type-btn[data-val="reel"].active { border-color: #f59e0b; color: #d97706; background: #fffbeb; }
.cp-pub-type-btn[data-val="story"].active { border-color: #10b981; color: #059669; background: #ecfdf5; }
.cp-pub-type-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cp-pub-desc-area {
  min-height: 140px; resize: vertical; font-size: 14px;
  line-height: 1.6; font-family: inherit;
}
.cp-pub-desc-view {
  font-size: 14px; line-height: 1.7; color: #374151;
  max-height: 60vh; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.cp-pub-type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}

.cp-footer {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 14px; background: #0F172A; border-radius: var(--radius);
  font-size: 12px;
}
.cp-stat { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.cp-stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cp-stat-total { margin-left: auto; color: #94A3B8; font-size: 11px; }

/* ─── Multi-Assignee ────────────────────────────────────────────────────── */
.assignee-picker {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 160px; overflow-y: auto; padding: 2px 0;
}
.assignee-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 5px; border-radius: 20px;
  border: 1.5px solid var(--border); cursor: pointer; font-size: 12.5px;
  font-weight: 500; transition: all .15s; background: var(--bg-card); color: var(--text);
}
.assignee-chip:hover { border-color: var(--primary); }
.assignee-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.ma-avatars { display: inline-flex; align-items: center; }
.ma-avatar-wrap { margin-left: -6px; position: relative; }
.ma-avatar-wrap:first-child { margin-left: 0; }
.ma-avatar-wrap.ma-done .avatar { opacity: .55; }
.ma-avatar-wrap.ma-done::after {
  content: '✓'; position: absolute; bottom: -2px; right: -2px;
  width: 12px; height: 12px; border-radius: 50%; background: #22c55e;
  color: white; font-size: 8px; display: flex; align-items: center;
  justify-content: center; border: 1.5px solid white; font-weight: 700;
}
.ma-extra {
  width: 26px; height: 26px; border-radius: 50%;
  background: #e5e7eb; color: #6b7280; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: -6px; border: 2px solid white;
}
.ma-progress {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-left: 5px; white-space: nowrap;
}
.ma-done-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #d1d5db; background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: #d1d5db; transition: all .15s; flex-shrink: 0;
}
.ma-done-btn:hover { border-color: var(--primary); color: var(--primary); }
.ma-done-btn.done { border-color: #22c55e; background: #dcfce7; color: #16a34a; }

.ma-detail-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ma-detail-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; background: var(--bg);
}
.ma-detail-name { font-size: 13px; font-weight: 500; flex: 1; }
.ma-det-check {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px; border: 1.5px solid #d1d5db;
  background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 600;
  color: #6b7280; transition: all .15s; white-space: nowrap;
}
.ma-det-check:hover { border-color: var(--primary); color: var(--primary); }
.ma-det-check.done { border-color: #22c55e; background: #dcfce7; color: #16a34a; }
.ma-det-status { font-size: 12px; color: #9ca3af; }
.ma-det-status.done { color: #16a34a; font-weight: 600; }

/* ─── Project Members ───────────────────────────────────────────────────── */
.proj-members-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.proj-members-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 600; }
.proj-members-avatars { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.proj-member-wrap { position: relative; }
.proj-member-remove {
  display: none; position: absolute; top: -4px; right: -4px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #EF4444; color: white; border: 2px solid white;
  cursor: pointer; font-size: 10px; line-height: 1; padding: 0;
  align-items: center; justify-content: center; font-weight: 700;
}
.proj-member-wrap:hover .proj-member-remove { display: flex; }
.proj-member-types { display: flex; gap: 1px; justify-content: center; margin-top: 2px; }
.proj-member-type-dot {
  width: 11px; height: 11px; border-radius: 3px; font-size: 7px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  background: var(--border, #e5e7eb); color: transparent;
}
.proj-member-type-dot.on { color: white; }
.proj-member-add-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  border: 2px dashed var(--primary); cursor: pointer;
  font-size: 18px; line-height: 1; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; transition: all .15s;
}
.proj-member-add-btn:hover { background: var(--primary); color: white; border-style: solid; }
.proj-member-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px; cursor: pointer;
}
.proj-member-option:hover { background: var(--bg); }

/* ─── Content-plan task badge ────────────────────────────────────────────── */
.cp-task-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; background: #F0FDF4; color: #16A34A;
  border: 1px solid #BBF7D0; white-space: nowrap;
}

/* ─── Settings ──────────────────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  align-items: start;
}
.settings-section--full { grid-column: 1 / -1; }
.settings-section { margin-bottom: 30px; }
.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.settings-section p { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.tg-connect-box {
  background: #F0F9FF; border: 1px solid #BAE6FD; border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 16px;
}
.tg-icon { font-size: 34px; }
.tg-connect-box h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.tg-connect-box p { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.tg-code {
  font-family: monospace; font-size: 22px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--primary); background: var(--primary-light); padding: 8px 16px;
  border-radius: 8px; display: inline-block; margin: 10px 0;
}
.tg-connected { color: var(--success); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 12px; display: flex; justify-content: center; align-items: center; opacity: 0.3; }
.empty-state h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.empty-state p { font-size: 13px; }

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 7px;
}
.toast {
  background: #1E293B; color: white; border-radius: var(--radius-sm);
  padding: 11px 16px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); max-width: 310px;
  animation: slideUp 0.2s ease; display: flex; align-items: center; gap: 9px;
}
.toast.success { background: #064E3B; }
.toast.error { background: #7F1D1D; }

/* ─── Color picker ──────────────────────────────────────────────────────── */
.color-options { display: flex; gap: 7px; flex-wrap: wrap; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: var(--transition);
}
.color-dot.selected, .color-dot:hover { border-color: white; box-shadow: 0 0 0 2px var(--text); transform: scale(1.12); }

/* ─── Reports ───────────────────────────────────────────────────────────── */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.report-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: var(--transition);
}
.report-card:hover { border-color: var(--primary-border); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.report-card-header {
  padding: 14px 16px 12px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.report-card-name { font-size: 14.5px; font-weight: 700; }
.report-card-body { padding: 14px 16px; }
.report-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.report-stat { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.report-stat-val { font-size: 20px; font-weight: 800; line-height: 1; }
.report-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.report-efficiency { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.report-efficiency-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.report-efficiency-bar { flex: 1; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.report-efficiency-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.report-efficiency-pct { font-size: 13px; font-weight: 700; min-width: 36px; text-align: right; }
.report-projects { display: flex; flex-direction: column; gap: 6px; }
.report-project-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.report-project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.report-project-name { flex: 1; color: var(--text-muted); }
.report-project-count { font-weight: 600; }
.report-month-picker { display: flex; align-items: center; gap: 10px; }
.report-month-picker input[type="month"] {
  padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; outline: none; transition: var(--transition);
}
.report-month-picker input[type="month"]:focus { border-color: var(--primary); }

/* ─── Activity Page ──────────────────────────────────────────────────────────── */
.act-mini-stat { text-align: center; }
.act-mini-val  { font-size: 22px; font-weight: 800; color: var(--text); }
.act-mini-lbl  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.act-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

.act-chart { display: flex; align-items: flex-end; gap: 3px; overflow: hidden; }
.act-bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.act-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.act-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 3px; transition: height 0.4s ease; }
.act-bar-lbl { font-size: 9px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; text-align: center; }
.act-bar-today { font-weight: 700; color: var(--text); }
.act-bar-count { font-size: 9px; font-weight: 700; color: var(--text-secondary); text-align: center; width: 100%; line-height: 1; margin-bottom: 2px; }

.act-users-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.act-user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-radius: 8px; transition: background 0.15s;
}
.act-user-row:hover { background: var(--bg); }
.act-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; position: relative;
}
.act-online-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid white;
}
.act-user-info { flex: 1; min-width: 0; }
.act-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.act-user-last { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-user-seen { font-size: 11px; color: var(--text-light); white-space: nowrap; flex-shrink: 0; }

.act-log-list { display: flex; flex-direction: column; }
.act-log-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.act-log-row:last-child { border-bottom: none; }
.act-log-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}
.act-log-body { flex: 1; min-width: 0; }
.act-log-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.act-log-username { font-weight: 700; margin-right: 4px; }
.act-log-entity { font-style: italic; color: var(--primary); margin: 0 3px; }
.act-log-detail {
  display: inline-block; background: var(--bg);
  border-radius: 4px; padding: 1px 6px; font-size: 11.5px;
  color: var(--text-muted); margin-left: 4px;
}
.act-log-time { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.act-log-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* User Activity Page */
.uap-user-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.uap-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: white; position: relative;
}
.uap-user-name { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.uap-user-meta { font-size: 12.5px; color: var(--text-muted); }

.overdue-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--danger-light); color: var(--danger);
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}

/* ─── Recurrence badge ──────────────────────────────────────────────────── */
.recur-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--success-light); color: #065F46;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}

/* ─── Employee filter ───────────────────────────────────────────────────── */
.employee-filter { display: flex; align-items: center; gap: 8px; }
.employee-filter select {
  padding: 5px 12px; border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 12.5px; font-weight: 500; outline: none; cursor: pointer;
  transition: var(--transition); background: var(--surface); color: var(--text);
}
.employee-filter select:focus { border-color: var(--primary); }

/* ─── Google Calendar ───────────────────────────────────────────────────── */
.cal-page { display: flex; flex-direction: column; gap: 16px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.cal-view-select {
  padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text); cursor: pointer; outline: none; transition: var(--transition);
}
.cal-view-select:hover { border-color: var(--primary); }
.cal-view-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(136,19,55,0.07); }
.cal-grid-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cal-head-row { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid var(--border); }
.cal-head-cell { padding: 10px 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell {
  min-height: 100px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s; overflow: visible; position: relative;
}
.cal-cell:hover { background: var(--bg); }
.cal-cell.drag-over { background: rgba(136,18,55,0.08); outline: 2px dashed #881237; outline-offset: -2px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell-other { opacity: 0.4; }
.cal-cell-today { background: rgba(99,102,241,0.04); }
.cal-cell-num { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell-num-today { background: var(--primary); color: #fff; }
.cal-cell-evs { display: flex; flex-direction: column; gap: 2px; position: relative; overflow: visible; }
.cal-ev {
  font-size: 11px; font-weight: 600; color: #fff; border-radius: 4px;
  padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; display: flex; align-items: center; gap: 4px; position: relative;
}
.cal-ev.cal-ev-multi { }
.cal-ev.cal-ev-cont { opacity: 0.75; }
.cal-ev-placeholder { height: 18px; }
.cal-ev:hover { opacity: 0.85; }
.cal-ev span { flex-shrink: 0; opacity: 0.85; }
.cal-ev-more { font-size: 10px; color: var(--text-muted); padding: 1px 4px; }

/* ─── Time-grid views (Day / 4-day / Week) ──────────────────────────────── */
:root { --cal-hour-h: 48px; }
.cal-timegrid-wrap { display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.cal-timegrid-header {
  display: grid; position: sticky; top: 0; z-index: 2;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
}
.cal-hour-gutter-spacer { border-right: 1px solid var(--border); }
.cal-tg-head-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 0; border-right: 1px solid var(--border); gap: 4px;
}
.cal-timegrid-header .cal-tg-head-cell:last-child { border-right: none; }
.cal-tg-head-dow { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-tg-head-num { font-size: 15px; font-weight: 700; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-tg-head-today .cal-tg-head-dow { color: var(--primary); }
.cal-timegrid-allday { display: grid; border-bottom: 1px solid var(--border); }
.cal-allday-col { padding: 3px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.cal-timegrid-allday .cal-day-col:last-child { border-right: none; }
.cal-tg-allday { font-size: 11px; padding: 2px 6px; }
.cal-timegrid-body { display: grid; grid-template-columns: 56px 1fr; overflow-y: auto; flex: 1; }
.cal-hour-gutter { border-right: 1px solid var(--border); }
.cal-hour-label {
  font-size: 11px; color: var(--text-muted); text-align: right; padding-right: 8px;
  transform: translateY(-7px); box-sizing: border-box;
}
.cal-timegrid-cols { display: grid; position: relative; }
.cal-day-col { position: relative; border-right: 1px solid var(--border); }
.cal-timegrid-cols .cal-day-col:last-child { border-right: none; }
.cal-hour-row { border-top: 1px solid var(--border); box-sizing: border-box; cursor: pointer; }
.cal-hour-row:hover { background: var(--bg); }
.cal-day-col.drag-over { background: rgba(136,18,55,0.06); }
.cal-tg-ev {
  position: absolute; overflow: hidden; padding: 3px 6px; box-sizing: border-box;
  flex-direction: column; align-items: flex-start; z-index: 1;
}
.cal-tg-ev span { opacity: 0.85; font-size: 10px; }
.cal-now-line { position: absolute; left: 0; right: 0; height: 2px; background: #e11d48; z-index: 3; pointer-events: none; }
.cal-now-line::before {
  content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px;
  border-radius: 50%; background: #e11d48;
}
.cal-view-select { margin-right: 4px; }

/* ─── Year view ──────────────────────────────────────────────────────────── */
.cal-year-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.cal-year-month { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.cal-year-month-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.cal-year-dow-row { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 4px; }
.cal-year-dow-row span { font-size: 9px; color: var(--text-muted); text-align: center; text-transform: uppercase; }
.cal-year-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-year-day {
  font-size: 10px; text-align: center; padding: 3px 0; border-radius: 4px; cursor: pointer; color: var(--text);
}
.cal-year-day:hover { background: var(--bg); }
.cal-year-day-empty { cursor: default; }
.cal-year-day-empty:hover { background: none; }
.cal-year-day-today { background: var(--primary); color: #fff; font-weight: 700; }

/* ─── Agenda / Schedule view ─────────────────────────────────────────────── */
.cal-agenda-list { padding: 8px 0; }
.cal-agenda-day-group { padding: 4px 0; }
.cal-agenda-date-header { font-size: 13px; font-weight: 700; color: var(--text); padding: 10px 20px 6px; }
.cal-agenda-row {
  display: flex; gap: 16px; padding: 10px 20px; cursor: pointer; align-items: baseline;
  border-left: 3px solid #881237; margin: 0 20px 4px; border-radius: 0 8px 8px 0; background: var(--bg);
}
.cal-agenda-row:hover { background: rgba(136,18,55,0.06); }
.cal-agenda-row-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; min-width: 100px; }
.cal-agenda-row-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cal-agenda-row-loc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.cal-form-row { display: flex; align-items: flex-start; gap: 10px; }
.cal-form-row svg { margin-top: 10px; flex-shrink: 0; }

/* ── Custom DateTimePicker ── */
.dtp-wrap { position: relative; }
.dtp-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text); font-size: 13px; cursor: pointer; text-align: left;
  transition: border-color .15s;
}
.dtp-trigger:hover { border-color: var(--primary); }
.dtp-trigger svg { color: var(--text-muted); flex-shrink: 0; }
.dtp-panel {
  display: none; position: fixed; z-index: 9999;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  overflow: auto; min-width: 280px; max-height: 90vh;
}
.dtp-wrap.dtp-open .dtp-panel { display: flex; flex-direction: column; }
.dtp-cal { padding: 14px 14px 10px; }
.dtp-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-weight: 700; font-size: 14px;
}
.dtp-nav button {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 8px; border-radius: 6px;
}
.dtp-nav button:hover { background: var(--bg); color: var(--text); }
.dtp-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.dtp-grid th { color: var(--text-muted); font-weight: 600; text-align: center; padding: 4px 0; }
.dtp-grid td {
  text-align: center; padding: 5px 0; border-radius: 50%; cursor: pointer;
  width: 32px; height: 32px; color: var(--text);
}
.dtp-grid td:hover { background: var(--bg); }
.dtp-grid td.dtp-today { color: var(--primary); font-weight: 700; }
.dtp-grid td.dtp-sel { background: var(--primary); color: #fff !important; border-radius: 50%; font-weight: 700; }
.dtp-time {
  border-top: 1px solid var(--border); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.dtp-time-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.dtp-time-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.dtp-spin { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dtp-spin button {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  width: 36px; height: 28px; cursor: pointer; color: var(--text); font-size: 11px;
}
.dtp-spin button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.dtp-spin span { font-size: 22px; font-weight: 700; color: var(--text); min-width: 36px; text-align: center; }
.dtp-colon { font-size: 22px; font-weight: 700; color: var(--text); }
.dtp-actions { display: flex; justify-content: space-between; gap: 8px; }

/* Calendar attendee chips */
.cal-attendee-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: all .15s; user-select: none;
}
.cal-attendee-chip span:first-of-type {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.cal-attendee-chip.selected { border-color: var(--primary); background: rgba(99,102,241,.08); color: var(--text); }
.cal-attendee-chip:hover { border-color: var(--primary); }

/* Calendar event modal fields */
.cal-event-modal { max-width: 500px; }
.cal-field-title {
  width: 100%; font-size: 22px; font-weight: 700; color: var(--text);
  border: none; border-bottom: 2px solid var(--primary); border-radius: 0;
  padding: 12px 0 10px; margin-bottom: 16px;
  background: transparent; outline: none;
}
.cal-field-title::placeholder { color: var(--text-muted); font-weight: 400; }
.cal-field-section { padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.cal-field-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cal-field-row:last-child { border-bottom: none; }
.cal-field-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 38px; flex-shrink: 0; color: var(--text-muted);
}
.cal-field-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; color: var(--text); padding: 8px 0; line-height: 1.5;
  font-family: inherit; width: 100%;
}
.cal-field-input::placeholder { color: var(--text-muted); }
.cal-field-input:focus { color: var(--text); }
.cal-field-row select {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; color: var(--text); padding: 8px 0; line-height: 1.5;
  font-family: inherit; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
  padding-right: 22px;
}
@media (max-width: 768px) {
  /* toolbar: stack vertically */
  .cal-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .cal-toolbar-row1 { flex-wrap: wrap; gap: 6px; }
  .cal-nav-group { margin-left: 0 !important; justify-content: space-between; width: 100%; }
  .cal-nav-group span { font-size: 13px !important; min-width: 100px !important; }
  .cal-toolbar > div:last-child { align-self: flex-end; }

  /* grid: tighter cells */
  .cal-grid-wrap { border-radius: 10px; }
  .cal-head-cell { padding: 6px 0; font-size: 10px; letter-spacing: 0; }
  .cal-cell { min-height: 52px; padding: 3px; }
  .cal-cell-num { font-size: 11px; width: 20px; height: 20px; margin-bottom: 2px; }

  /* event chips: no time, truncate title hard */
  .cal-ev { font-size: 9px; padding: 1px 3px; border-radius: 3px; }
  .cal-ev span { display: none; }
  .cal-ev-placeholder { height: 14px; }
  .cal-ev-more { font-size: 9px; }

  /* tab bar inside calendar: scrollable */
  .cal-page { gap: 10px; }

  /* event detail modal fullscreen on mobile handled by global modal rule */
  .cal-event-modal { max-width: 100%; }

  /* time-grid views (day/4day/week): shrink hour rows, hide secondary text, allow horizontal scroll */
  :root { --cal-hour-h: 36px; }
  .cal-tg-ev span { display: none; }
  .cal-tg-ev { font-size: 9px; padding: 2px 4px; }
  .cal-hour-label { font-size: 9px; }
  .cal-tg-head-dow { font-size: 9px; }
  .cal-tg-head-num { font-size: 12px; width: 22px; height: 22px; }
  .cal-tg-head-cell { padding: 4px 0; gap: 1px; }

  /* year view: 2 columns on mobile */
  .cal-year-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .cal-year-month { padding: 8px; }
  .cal-year-month-title { font-size: 11px; }
  .cal-year-day { font-size: 9px; padding: 2px 0; }

  /* agenda view: tighter padding */
  .cal-agenda-row { padding: 8px 12px; margin: 0 12px 4px; gap: 10px; }
  .cal-agenda-date-header { padding: 8px 12px 4px; }
  .cal-agenda-row-time { min-width: 80px; font-size: 11px; }
}

/* ─── Duty Schedule ─────────────────────────────────────────────────────── */
.duty-week {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px;
  transition: box-shadow 0.15s;
}
.duty-week-current {
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(134,239,172,0.18);
}
.duty-week-past { opacity: 0.6; }
.duty-week-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.duty-week-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.duty-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.duty-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; position: relative;
}
.duty-card-info { flex: 1; min-width: 0; }
.duty-card-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duty-card-comment { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.duty-card-actions {
  display: flex; gap: 3px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.15s;
}
.duty-card:hover .duty-card-actions { opacity: 1; }
.duty-action-btn {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px 5px; border-radius: 6px; display: flex; align-items: center;
  transition: background 0.12s, color 0.12s;
}
.duty-action-btn:hover { background: var(--border); color: var(--text); }
.duty-action-btn.duty-del-btn:hover { background: #fee2e2; color: #ef4444; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dash-charts { grid-template-columns: 1fr 1fr; }
  .dash-charts .chart-panel:first-child { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ─── Mobile defaults (hidden until breakpoint) ─────────────────────── */
.mobile-search-btn { display: none; }

/* ─── Mobile (≤768px) ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  /* sidebar — hidden by default, slides in as overlay */
  #sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; z-index: 200;
    width: 260px !important; transition: left 0.25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  #sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,0.35);
  }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 199;
    background: rgba(0,0,0,0.45);
  }
  .sidebar-overlay.active { display: block; }

  /* burger button */
  .mobile-burger {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: none; border: none; cursor: pointer;
    color: var(--text); border-radius: 8px; flex-shrink: 0;
  }
  .mobile-burger:hover { background: var(--bg); }

  /* topbar */
  .topbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 12px;
    min-height: calc(52px + env(safe-area-inset-top, 0px)); gap: 8px;
  }
  .topbar-title { font-size: 14px; }
  .topbar-subtitle { display: none; }
  .topbar-search-wrap { display: none; }
  .topbar-actions { gap: 6px; }
  .btn-notif { width: 32px; height: 32px; }
  .btn.btn-blue#new-task-btn {
    padding: 0; width: 36px; height: 36px; min-width: 36px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  }
  .btn.btn-blue#new-task-btn .new-task-text { display: none; }
  .btn.btn-blue#new-task-btn::after { content: none; }
  .topbar-search-wrap { display: none; }
  .mobile-search-btn { display: inline-flex; }

  /* period filter */
  .period-filter { gap: 4px; margin-bottom: 12px; }
  .period-btn { padding: 5px 10px; font-size: 12px; }

  /* dash stat cards */
  .dash-stat-cards { gap: 10px; }
  .dash-stat-card { padding: 16px; }
  .dsc-value { font-size: 36px; }
  .dash-stat-card--done .dsc-value { font-size: 42px; }

  /* page content */
  .page-content { padding: 12px 12px calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* layout */
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .task-detail-meta { grid-template-columns: 1fr; }
  .dash-charts { grid-template-columns: 1fr; }
  #report-content [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .mytasks-charts { grid-template-columns: 1fr; }
  .dash-summary { flex-direction: column; gap: 10px; }
  .dash-summary-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 8px 0; }

  /* filters */
  .filters { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .filter-btn { padding: 5px 10px; font-size: 12px; }
  .search-wrap { width: 100%; order: -1; }
  .search-input { width: 100%; box-sizing: border-box; }

  /* task cards */
  .task-card { padding: 11px 13px; }
  .task-card-title { font-size: 13px; }
  .task-card-meta { gap: 6px; flex-wrap: wrap; }

  /* modals — slide up from bottom */
  .modal-overlay { align-items: flex-end; padding-bottom: 0; }
  .modal {
    width: 100% !important; max-width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 92vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
  }

  /* login */
  .login-card { padding: 28px 20px; margin: 12px; border-radius: 16px; }

  /* pagination */
  .tasks-pagination { gap: 3px; flex-wrap: wrap; }
  .page-btn { min-width: 30px; height: 30px; font-size: 12px; }

  /* stat cards */
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
}

/* ─── Mobile Bottom Nav ──────────────────────────────────────────────── */
.mobile-nav { display: none; }
.mobile-burger { display: none; }

@media (max-width: 768px) {
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 16px rgba(0,0,0,0.09);
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; cursor: pointer; padding: 4px 2px;
    color: var(--text-muted); font-size: 9px; font-weight: 600;
    transition: color 0.15s;
  }
  .mobile-nav-item.active { color: var(--primary); }
  .mobile-nav-item svg { width: 20px; height: 20px; }
}
[data-theme="dark"] .mobile-nav { background: #1e2130; border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .mobile-nav-item { color: var(--sidebar-text); }
[data-theme="dark"] .mobile-nav-item.active { color: #f9a8d4; }
[data-theme="dark"] .mobile-burger { color: #e2e8f0; }

/* ─── Custom Datepicker ──────────────────────────────────────────────────── */
.cdp-wrap { position: relative; }
.cdp-trigger {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13.5px;
  cursor: pointer; text-align: left; font-family: inherit;
  display: flex; align-items: center; gap: 7px;
  transition: border-color 0.15s, box-shadow 0.15s; box-sizing: border-box;
}
.cdp-trigger:hover { border-color: var(--primary); }
.cdp-trigger.open  { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(136,19,55,0.07); }
.cdp-trigger-text  { flex: 1; }
.cdp-placeholder   { color: var(--text-muted); }
.cdp-chevron       { color: var(--text-muted); transition: transform 0.15s; flex-shrink: 0; }
.cdp-trigger.open .cdp-chevron { transform: rotate(180deg); }

.cdp-dropdown {
  position: fixed; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 44px rgba(0,0,0,0.14); padding: 14px 12px 11px; width: 262px;
}
.cdp-dropdown.hidden { display: none; }

.cdp-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cdp-month-lbl { font-size: 13.5px; font-weight: 700; color: var(--text); }
.cdp-nav-btn {
  background: none; border: 1px solid var(--border); cursor: pointer;
  width: 27px; height: 27px; border-radius: 7px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; padding: 0; transition: all 0.12s;
}
.cdp-nav-btn:hover { border-color: var(--primary); color: var(--primary); }

.cdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cdp-wd { text-align: center; font-size: 9.5px; font-weight: 700; color: var(--text-muted); padding: 2px 0 6px; }
.cdp-day {
  height: 30px; border: none; background: none; border-radius: 6px;
  font-size: 12px; cursor: pointer; color: var(--text); font-family: inherit;
  display: flex; align-items: center; justify-content: center; transition: background 0.1s, color 0.1s;
}
.cdp-day:hover { background: var(--bg); }
.cdp-day.today  { color: var(--primary); font-weight: 700; }
.cdp-day.selected { background: var(--primary); color: white; font-weight: 600; }
.cdp-day.other-m  { opacity: 0.3; }

.cdp-divider { height: 1px; background: var(--border); margin: 10px 0; }

.cdp-time-row { display: flex; align-items: center; gap: 6px; }
.cdp-time-lbl { font-size: 11px; font-weight: 600; color: var(--text-muted); flex: 1; display: flex; align-items: center; gap: 4px; }
.cdp-tctrl { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cdp-tbtn {
  background: none; border: 1px solid var(--border); cursor: pointer;
  width: 24px; height: 18px; border-radius: 5px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; padding: 0; transition: all 0.1s;
}
.cdp-tbtn:hover { border-color: var(--primary); color: var(--primary); }
.cdp-tnum {
  width: 38px; text-align: center; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 15px; font-family: inherit; color: var(--text); background: var(--bg);
  padding: 3px 2px; font-weight: 700; outline: none;
}
.cdp-tnum:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(136,19,55,0.07); }
.cdp-tsep { font-size: 18px; font-weight: 700; color: var(--text-muted); line-height: 1; }

.cdp-foot { display: flex; gap: 6px; margin-top: 10px; }
.cdp-clear-btn {
  flex: 1; background: none; border: 1px solid var(--border); padding: 7px 8px;
  color: var(--text-muted); font-size: 12px; cursor: pointer; border-radius: 7px;
  font-family: inherit; font-weight: 500; transition: all 0.12s;
}
.cdp-clear-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.cdp-ok-btn {
  flex: 1; background: var(--primary); border: none; padding: 7px 8px;
  color: white; font-size: 12px; cursor: pointer; border-radius: 7px;
  font-family: inherit; font-weight: 600; transition: opacity 0.12s;
}
.cdp-ok-btn:hover { opacity: 0.87; }

/* ─── Dark Mode (both [data-theme="dark"] and [data-theme=dark]) ──────────────────────── */
body.dark, [data-theme="dark"] {
  --bg:             #0E0E12;
  --surface:        #18181F;
  --surface-2:      #1F1F28;
  --surface-3:      #25252F;
  --card-bg:        #18181F;
  --sidebar-bg:     #18181F;
  --sidebar-hover:  rgba(255,255,255,.06);
  --sidebar-active-bg: rgba(142,27,59,.22);
  --sidebar-active-color: #F472B6;
  --sidebar-text:   #B4B4BE;
  --text:           #EDEDF0;
  --text-secondary: #B4B4BE;
  --text-muted:     #6E6E7C;
  --text-light:     #454552;
  --border:         rgba(255,255,255,.07);
  --border-strong:  rgba(255,255,255,.13);
  --glass:          rgba(24,24,31,.85);
  --glass-border:   rgba(255,255,255,.06);
  --primary-light:  rgba(142,27,59,.18);
  --primary-border: rgba(142,27,59,.4);
  --accent-light:   rgba(59,130,246,.15);
  --success-light:  rgba(22,163,74,.15);
  --warning-light:  rgba(217,130,43,.15);
  --danger-light:   rgba(229,72,77,.15);
  --shadow:         0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg:      0 16px 40px rgba(0,0,0,0.5);
}
body.dark, [data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] #main-content { background: var(--bg); }
[data-theme="dark"] .topbar { background: var(--glass); border-color: var(--glass-border); }
[data-theme="dark"] .page-content { background: var(--bg); }

/* Cards & panels */
[data-theme="dark"] .task-card,
[data-theme="dark"] .chart-panel,
[data-theme="dark"] .dash-stat-card:not(.dash-stat-card--done),
[data-theme="dark"] .uap-user-card,
[data-theme="dark"] .uap-stat-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .proj-bar-wrap,
[data-theme="dark"] .report-block,
[data-theme="dark"] .content-card,
[data-theme="dark"] .cp-table-wrap,
[data-theme="dark"] .task-detail-panel,
[data-theme="dark"] .notif-dropdown { background: var(--card-bg) !important; border-color: var(--border) !important; }
[data-theme="dark"] .dash-stat-card--done {
  background: linear-gradient(145deg, #8E1B3B 0%, #B4234C 100%) !important;
  border-color: transparent !important;
}

/* Buttons */
[data-theme="dark"] .btn-blue { box-shadow: 0 0 18px -2px rgba(226,75,103,.55), 0 6px 18px -6px rgba(226,75,103,.4) !important; }
[data-theme="dark"] .btn-blue:hover { box-shadow: 0 0 28px -2px rgba(226,75,103,.7), 0 10px 24px -6px rgba(226,75,103,.5) !important; }
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-notif,
[data-theme="dark"] .filter-btn { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text-secondary) !important; }
[data-theme="dark"] .period-btn { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text) !important; }
[data-theme="dark"] .period-btn.active { background: linear-gradient(140deg, #8E1B3B, #B4234C) !important; border-color: transparent !important; color: white !important; }
[data-theme="dark"] .filter-btn.active { background: var(--primary-light) !important; border-color: var(--primary) !important; color: var(--sidebar-active-color) !important; }

/* Inputs */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text) !important; }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: var(--text-light) !important; }

/* Modal */
[data-theme="dark"] .modal { background: var(--card-bg); }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.75); }
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: var(--border); }

/* Urgent section dark adjustments */
[data-theme="dark"] .urgent-overdue-hdr  { background: rgba(220,38,38,0.18); }
[data-theme="dark"] .urgent-today-hdr    { background: rgba(234,88,12,0.18); }
[data-theme="dark"] .urgent-tomorrow-hdr { background: rgba(202,138,4,0.18); }
[data-theme="dark"] .urgent-pill-overdue  { background: rgba(220,38,38,0.25); }
[data-theme="dark"] .urgent-pill-today    { background: rgba(234,88,12,0.25); }
[data-theme="dark"] .urgent-pill-tomorrow { background: rgba(202,138,4,0.25); }

/* Misc */
[data-theme="dark"] .login-box { background: var(--card-bg); }
[data-theme="dark"] .tab-btn { border-color: var(--border); background: var(--card-bg); color: var(--text-secondary); }
[data-theme="dark"] .tab-btn.active { background: var(--primary-light) !important; }
[data-theme="dark"] .notif-item:hover { background: rgba(255,255,255,0.04) !important; }
[data-theme="dark"] .task-card:hover { background: rgba(255,255,255,0.03) !important; }
[data-theme="dark"] .cp-day-card { background: var(--card-bg) !important; border-color: var(--border) !important; }
[data-theme="dark"] .act-log-row { border-color: var(--border); }
[data-theme="dark"] .sidebar-footer { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .comment-input { background: var(--bg) !important; border-color: var(--border) !important; color: var(--text) !important; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #1E293B; }
[data-theme="dark"] .act-online-dot { border-color: var(--card-bg) !important; }
[data-theme="dark"] .dropdown-menu { background: var(--card-bg) !important; border-color: var(--border) !important; }
[data-theme="dark"] .search-input { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text) !important; }
[data-theme="dark"] .upc-card { background: var(--card-bg) !important; }
[data-theme="dark"] .upc-card:hover { background: #263348 !important; }

/* ─── Dark Mode: Comprehensive card/panel overrides ─────────────────────────── */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .mytasks-proj-card,
[data-theme="dark"] .mpc-sgrid-cell,
[data-theme="dark"] .upc-block,
[data-theme="dark"] .upc-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .add-project-card,
[data-theme="dark"] .member-card,
[data-theme="dark"] .emp-profile-header,
[data-theme="dark"] .notif-panel,
[data-theme="dark"] .notif-panel-header,
[data-theme="dark"] .cp-cell,
[data-theme="dark"] .cp-empty,
[data-theme="dark"] .report-card,
[data-theme="dark"] .report-card-header,
[data-theme="dark"] .report-block,
[data-theme="dark"] .cdp-trigger,
[data-theme="dark"] .cdp-dropdown,
[data-theme="dark"] .employee-filter select,
[data-theme="dark"] .task-detail-panel,
[data-theme="dark"] .proj-content-panel,
[data-theme="dark"] .uap-stat-card { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text) !important; }

/* Text colors inside dark cards */
[data-theme="dark"] .member-card *,
[data-theme="dark"] .stat-card *,
[data-theme="dark"] .report-card *,
[data-theme="dark"] .upc-block *,
[data-theme="dark"] .project-card *,
[data-theme="dark"] .emp-profile-header * { color: inherit; }

[data-theme="dark"] .member-card .member-name,
[data-theme="dark"] .member-card .member-email,
[data-theme="dark"] .project-card-name,
[data-theme="dark"] .uap-user-name { color: var(--text) !important; }

[data-theme="dark"] .member-card .member-role-label,
[data-theme="dark"] .project-card-desc,
[data-theme="dark"] .project-stats,
[data-theme="dark"] .uap-user-meta { color: var(--text-muted) !important; }

/* Calendar */
[data-theme="dark"] .cal-wrap,
[data-theme="dark"] .cal-header,
[data-theme="dark"] .cal-day-header,
[data-theme="dark"] .cal-week-row,
[data-theme="dark"] .upc-block,
[data-theme="dark"] .upcoming-header { background: var(--card-bg) !important; border-color: var(--border) !important; }
[data-theme="dark"] .cal-day-num { color: var(--text-secondary) !important; }
[data-theme="dark"] .upcoming-title,
[data-theme="dark"] .upcoming-empty { color: var(--text-muted) !important; }

/* Filters bar */
[data-theme="dark"] .filters,
[data-theme="dark"] .filters-bar { background: transparent !important; }
[data-theme="dark"] .search-wrap { background: var(--card-bg) !important; border-color: var(--border) !important; }

/* Hover states */
[data-theme="dark"] .project-card:hover { background: #263348 !important; }
[data-theme="dark"] .member-card:hover { background: #263348 !important; }
[data-theme="dark"] .report-card:hover { background: #263348 !important; }
[data-theme="dark"] .add-project-card:hover { background: var(--primary-light) !important; }
[data-theme="dark"] .perm-checkbox-row:hover { background: rgba(255,255,255,0.04) !important; }

/* Muted text on dark background — make readable */
[data-theme="dark"] .text-muted,
[data-theme="dark"] [style*="color:#94a3b8"],
[data-theme="dark"] [style*="color: #94a3b8"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"] { color: var(--text-muted) !important; }

/* Progress bar track */
[data-theme="dark"] .progress-bar { background: #334155 !important; }

/* Sticky table header in content plan */
[data-theme="dark"] .cp-th,
[data-theme="dark"] .cp-row-head { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text-secondary) !important; }

/* Notification panel */
[data-theme="dark"] .notif-item { border-color: var(--border) !important; }
[data-theme="dark"] .notif-item.unread { background: rgba(136,19,55,0.1) !important; }

/* Topbar dark */
[data-theme="dark"] .topbar { background: #1E293B !important; }

/* Calendar (mini) correct class names */
[data-theme="dark"] .upc-cal-header,
[data-theme="dark"] .upc-cal-row,
[data-theme="dark"] .upc-cal-daynames { color: var(--text-secondary) !important; }
[data-theme="dark"] .upc-cal-month { color: var(--text) !important; }
[data-theme="dark"] .upc-cal-arrow { background: var(--card-bg) !important; border-color: var(--border) !important; color: var(--text-secondary) !important; }
[data-theme="dark"] .upc-cal-date { color: var(--text-secondary) !important; }
[data-theme="dark"] .upc-cal-dim { color: var(--text-light) !important; }
[data-theme="dark"] .upc-block { background: var(--card-bg) !important; border-color: var(--border) !important; }

/* Member role badge in dark */
[data-theme="dark"] .member-card .member-role { border-color: var(--border) !important; }

/* Report card inner text */
[data-theme="dark"] .report-card-header { color: var(--text) !important; }
[data-theme="dark"] .report-stat-val { color: var(--text) !important; }
[data-theme="dark"] .report-stat-lbl { color: var(--text-muted) !important; }
[data-theme="dark"] .report-card-eff-label { color: var(--text-muted) !important; }

/* Donut chart center text */
.donut-pct-text { fill: #0F172A; }

/* ─── Deadline Countdown ──────────────────────────────────────────────────── */
.countdown {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; padding: 1px 7px;
  border-radius: 20px; margin-left: 2px;
}
.countdown-soon    { background: #fef9c3; color: #854d0e; }
.countdown-urgent  { background: #fee2e2; color: #991b1b; }
.countdown-overdue { background: #dc2626; color: white; }

/* ─── Comment @mentions ───────────────────────────────────────────────────── */
.comment-mention {
  color: var(--primary); font-weight: 700;
  background: var(--primary-light); border-radius: 4px;
  padding: 0 3px;
}

/* Mention dropdown */
.mention-dropdown {
  position: absolute; bottom: calc(100% + 4px); left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 999; overflow: hidden; max-height: 220px; overflow-y: auto;
}
.mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 13px;
  transition: background 0.1s;
}
.mention-item:hover, .mention-item.active { background: var(--hover-bg); }
.mention-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* Emoji picker */
.emoji-picker-panel {
  position: absolute; bottom: calc(100% + 4px); right: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  z-index: 999; padding: 8px;
}
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; max-height: 260px; overflow-y: auto; width: 320px; }
.emoji-item {
  background: none; border: none; cursor: pointer;
  font-size: 20px; padding: 4px; border-radius: 6px;
  transition: background 0.1s; line-height: 1;
}
.emoji-item:hover { background: var(--hover-bg); }

/* Emoji button */
.emoji-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  font-size: 18px; cursor: pointer; padding: 0 8px; height: 34px;
  transition: background 0.1s; flex-shrink: 0;
}
.emoji-btn:hover { background: var(--hover-bg); }

/* ─── Broadcast Modal ────────────────────────────────────────────────────── */
.broadcast-list { display:flex; flex-direction:column; gap:4px; max-height:260px; overflow-y:auto; border:1.5px solid var(--border); border-radius:10px; padding:8px; background:var(--bg); }
.broadcast-item { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; cursor:pointer; transition:background .1s; }
.broadcast-item:hover { background:var(--card-bg); }
.broadcast-item input[type=checkbox] { width:16px; height:16px; flex-shrink:0; cursor:pointer; }
.broadcast-item-notg { opacity:.55; cursor:default; }
.broadcast-item-notg input { cursor:not-allowed; }
.broadcast-av { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; color:white; flex-shrink:0; overflow:hidden; }
.broadcast-info { flex:1; min-width:0; }
.broadcast-name { font-size:13px; font-weight:600; color:var(--text); }
.broadcast-tg   { font-size:11px; margin-top:1px; }

/* ─── Feedback Button (sidebar) ──────────────────────────────────────────── */
.feedback-btn {
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 16px); margin: 0 8px 8px;
  padding: 9px 12px;
  background: var(--primary-light); border: 1.5px solid var(--primary-border);
  border-radius: 9px; color: var(--primary);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-align: left; transition: background 0.15s, border-color 0.15s;
}
.feedback-btn:hover { background: var(--primary-border); border-color: var(--primary); }
[data-theme="dark"] .feedback-btn {
  background: rgba(136,19,55,0.12); border-color: rgba(136,19,55,0.3);
  color: #fca5a5;
}

/* ─── Feedback Modal ──────────────────────────────────────────────────────── */
.fb-modal, .fb-admin-modal {
  max-width: 600px; max-height: 88vh; overflow-y: auto;
}
.fb-body { padding: 0 24px 4px; }
.fb-anon-notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: #eff6ff; border: 1.5px solid #bfdbfe;
  border-radius: 10px; padding: 12px 14px;
  font-size: 13px; color: #1e40af; line-height: 1.5;
  margin-bottom: 16px;
}
.fb-anon-notice svg { flex-shrink: 0; margin-top: 1px; color: #3b82f6; }
.fb-scale-legend {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-bottom: 14px;
  padding: 0 2px;
}
.fb-questions { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.fb-question { padding: 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); transition: border-color 0.15s; }
.fb-question.fb-answered { border-color: var(--primary-border); background: var(--primary-light); }
.fb-q-text { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 12px; }
.fb-q-num { font-weight: 700; color: var(--primary); margin-right: 4px; }
.fb-scale { display: flex; gap: 6px; }
.fb-score-btn {
  flex: 1; padding: 7px 4px; border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--card-bg); color: var(--text-muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.12s;
}
.fb-score-btn:hover { border-color: var(--primary); color: var(--primary); }
.fb-score-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.fb-suggestion-section { margin-top: 4px; }
.fb-suggestion-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.fb-textarea { width: 100%; resize: vertical; font-size: 13px; }
.fb-progress { font-size: 12px; color: var(--text-muted); margin-right: auto; }

/* Admin feedback view */
.fb-admin-modal { max-width: 900px !important; }
.fb-admin-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.fb-admin-questions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.fb-admin-row { display: flex; flex-direction: column; gap: 5px; }
.fb-admin-q { font-size: 12px; color: var(--text); line-height: 1.4; }
.fb-admin-score-wrap { display: flex; align-items: center; gap: 8px; }
.fb-admin-bar-bg { flex: 1; height: 7px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.fb-admin-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.fb-admin-avg { font-size: 13px; font-weight: 800; min-width: 26px; text-align: right; }

/* Two-column layout */
.fb-two-col { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.fb-col-left { min-width: 0; }
.fb-col-right { position: sticky; top: 0; }

/* Per-question chart */
.fb-chart-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.fb-chart-legend-item { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-muted); }

/* Clickable response card */
.fb-response-clickable { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.fb-response-clickable:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }

/* Detail modal */
.fb-detail-modal { max-width: 600px; max-height: 90vh; overflow-y: auto; }
.fb-detail-chart-wrap { background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.fb-detail-row { display: flex; flex-direction: column; gap: 5px; }
.fb-detail-q-header { display: flex; align-items: flex-start; gap: 6px; }
.fb-detail-q-num { font-weight: 700; color: var(--primary); font-size: 13px; flex-shrink: 0; }
.fb-detail-q-text { font-size: 12.5px; color: var(--text); line-height: 1.4; flex: 1; }
.fb-detail-score { font-size: 16px; font-weight: 800; flex-shrink: 0; margin-left: 8px; }
.fb-detail-bar-bg {
  position: relative; height: 8px;
  background: var(--bg); border-radius: 99px; overflow: visible;
  border: 1px solid var(--border);
}
.fb-detail-bar-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 99px; transition: width 0.4s; }
.fb-detail-bar-avg {
  position: absolute; top: -3px; width: 2px; height: 14px;
  background: #6b7280; border-radius: 1px;
  transform: translateX(-50%);
}

[data-theme="dark"] .fb-anon-notice { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #93c5fd; }
[data-theme="dark"] .fb-question.fb-answered { background: rgba(136,19,55,0.08); }

/* Period filter */
.fb-period-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fb-period-btn {
  padding: 4px 12px; border-radius: 20px; border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--card-bg); color: var(--text-muted); transition: all 0.12s;
}
.fb-period-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.fb-period-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Trend chart */
.fb-trend-wrap { margin-bottom: 20px; }
.fb-trend-title { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

.fb-admin-section-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }

/* Individual responses */
.fb-responses-list { display: flex; flex-direction: column; gap: 10px; }
.fb-response-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--bg); }
.fb-response-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.fb-response-num { font-size: 12px; font-weight: 700; color: var(--text); }
.fb-response-date { font-size: 11px; color: var(--text-muted); margin-right: auto; }
.fb-response-overall { font-size: 12px; font-weight: 700; }
.fb-response-scores { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.fb-resp-score {
  display: flex; flex-direction: column; align-items: center;
  width: 34px; padding: 4px 0; border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}
.fb-resp-qi { font-size: 9px; color: #6b7280; font-weight: 600; }
.fb-resp-qv { font-size: 13px; font-weight: 800; }
.fb-response-comment {
  font-size: 12.5px; color: var(--text); line-height: 1.5;
  background: var(--card-bg); border-radius: 7px; padding: 8px 10px;
  border: 1px solid var(--border);
}
.fb-response-comment-lbl { font-weight: 700; color: var(--text-muted); margin-right: 6px; font-size: 11px; }
.fb-archive-btn {
  margin-left: auto; width: 26px; height: 26px; border-radius: 6px;
  border: 1.5px solid #e2e8f0; background: #f8fafc; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all 0.12s;
}
.fb-archive-btn:hover { background: #f59e0b; color: white; border-color: #f59e0b; }
.fb-delete-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1.5px solid #fecaca; background: #fef2f2; color: #dc2626;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all 0.12s;
}
.fb-delete-btn:hover { background: #dc2626; color: white; border-color: #dc2626; }

/* ─── Global Search ──────────────────────────────────────────────────────── */
.gs-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  animation: fadeIn 0.1s ease;
}
.gs-box {
  width: 100%; max-width: 580px; background: var(--surface);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  overflow: hidden; animation: slideUp 0.15s ease;
}
.gs-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1.5px solid #e5e7eb;
}
.gs-icon { color: #9ca3af; flex-shrink: 0; }
.gs-input {
  flex: 1; border: none; outline: none; font-size: 16px;
  color: #0f172a; background: transparent;
}
.gs-esc-hint {
  font-size: 11px; color: #9ca3af; background: #f1f5f9;
  border: 1px solid #e2e8f0; border-radius: 5px;
  padding: 2px 6px; font-family: monospace;
}
.gs-results { max-height: 420px; overflow-y: auto; padding: 8px 0; }
.gs-hint { font-size: 13px; color: #9ca3af; text-align: center; padding: 24px; }
.gs-group-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #94a3b8;
  padding: 8px 18px 4px; display: flex; align-items: center; gap: 5px;
}
.gs-result-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 18px; cursor: pointer; transition: background 0.1s; gap: 12px;
}
.gs-result-item:hover, .gs-result-item.gs-selected { background: #f8fafc; }
.gs-result-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.gs-result-title { font-size: 13.5px; color: #0f172a; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-result-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.gs-result-status { font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.gs-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.gs-user-av { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; color: white; flex-shrink: 0; }
.gs-hl { background: #fef9c3; color: #854d0e; border-radius: 2px; padding: 0 1px; font-style: normal; }

[data-theme="dark"] .gs-box { background: #1e293b; }
[data-theme="dark"] .gs-input { color: #f1f5f9; }
[data-theme="dark"] .gs-input-wrap { border-color: #334155; }
[data-theme="dark"] .gs-result-title { color: #f1f5f9; }
[data-theme="dark"] .gs-result-item:hover, [data-theme="dark"] .gs-result-item.gs-selected { background: #0f172a; }
[data-theme="dark"] .gs-esc-hint { background: #0f172a; border-color: #334155; color: #64748b; }

/* ─── Team Search ─────────────────────────────────────────────────────────── */
.team-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 8px 14px; margin-bottom: 18px;
}
.team-search-input {
  flex: 1; border: none; outline: none; font-size: 13.5px;
  color: var(--text); background: transparent;
}
.team-search-input::placeholder { color: #9ca3af; }

/* ─── My Tasks Stats Header ───────────────────────────────────────────────── */
.dash-stat-cards-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding: 0 2px;
}
.dsc-username { font-size: 16px; font-weight: 800; color: var(--text); }
.dsc-eff-wrap { display: flex; align-items: baseline; gap: 5px; }
.dsc-eff-pct { font-size: 22px; font-weight: 900; }
.dsc-eff-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.dsc-eff-bar-bg { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.dsc-eff-bar-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

/* ─── Reports Workload Chart ──────────────────────────────────────────────── */
.rpt-chart-wrap { background:var(--card-bg); border:1.5px solid var(--border); border-radius:14px; padding:18px 20px; margin-bottom:24px; }
.rpt-chart-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; gap:8px; }
.rpt-chart-title { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); }
.rpt-chart-legend { display:flex; gap:14px; flex-wrap:wrap; }
.rpt-leg { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-muted); }
.rpt-leg-dot { width:10px; height:10px; border-radius:2px; flex-shrink:0; }
.rpt-chart-bars { display:flex; flex-direction:column; gap:6px; }
.rpt-bar-row { display:grid; grid-template-columns:110px 1fr 130px; align-items:center; gap:10px; cursor:pointer; border-radius:8px; padding:4px 6px; transition:background .12s; min-width:0; }
.rpt-bar-row:hover { background:var(--bg); }
.rpt-bar-label { display:flex; align-items:center; gap:7px; min-width:0; }
.rpt-bar-av { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:800; color:white; flex-shrink:0; overflow:hidden; }
.rpt-bar-name { font-size:12px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rpt-bar-track { height:18px; background:var(--bg); border-radius:99px; overflow:hidden; border:1px solid var(--border); min-width:0; }
.rpt-bar-fill { height:100%; display:flex; border-radius:99px; overflow:hidden; max-width:100%; }
.rpt-bar-seg { height:100%; min-width:0; }
.rpt-bar-seg:last-child { border-radius:0 99px 99px 0; }
.rpt-seg-done { background:#16a34a; }
.rpt-seg-inp  { background:#d97706; }
.rpt-seg-ov   { background:#dc2626; }
.rpt-seg-nw   { background:#e2e8f0; }
[data-theme="dark"] .rpt-seg-nw { background:#334155; }
.rpt-bar-nums { display:flex; align-items:center; gap:6px; justify-content:flex-end; flex-wrap:nowrap; white-space:nowrap; }
.rpt-bar-total { font-size:13px; font-weight:800; color:var(--text); min-width:22px; text-align:right; }
.rpt-bar-sub   { font-size:11px; font-weight:600; }
.rpt-bar-pct   { font-size:12px; font-weight:800; min-width:36px; text-align:right; }

/* ─── Task History ─────────────────────────────────────────────────────────── */
.task-history-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.task-history-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
}
.task-history-list { display: flex; flex-direction: column; gap: 8px; }
.task-history-item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--text-secondary);
}
.task-history-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); flex-shrink: 0; margin-top: 5px;
}
.task-history-body { flex: 1; line-height: 1.5; }
.task-history-who { font-weight: 700; color: var(--text); }
.task-history-field { font-weight: 600; }
.task-history-old { color: var(--text-muted); text-decoration: line-through; }
.task-history-new { color: var(--primary); font-weight: 600; }
.task-history-time { display: block; font-size: 11px; color: var(--text-light); margin-top: 1px; }

/* ─── Employee Dashboard ──────────────────────────────────────────────────── */
.emp-dash { padding: 0 0 40px; }
.emp-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; padding: 0 24px 20px;
}
.emp-stat-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px 16px; text-align: center;
}
.emp-stat-num { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; }
.emp-stat-lbl { font-size: 12px; color: var(--text-muted); }
.emp-stat-danger { color: #dc2626; }
.emp-stat-today  { color: #d97706; }
.emp-stat-done   { color: #16a34a; }

.emp-progress-card {
  margin: 0 24px; background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
}
.emp-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.emp-progress-title { font-size: 14px; font-weight: 700; color: var(--text); }
.emp-progress-pct { font-size: 20px; font-weight: 800; color: var(--primary); }
.emp-progress-bar-bg { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.emp-progress-bar-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.5s ease; }
.emp-progress-sub { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ─── Best Employee Page ──────────────────────────────────────────────────── */
.be-page { padding: 0 24px 48px; }
.be-month-bar { display: flex; align-items: center; gap: 5px; margin-bottom: 24px; padding-top: 4px; flex-wrap: nowrap; overflow-x: auto; }
.be-arrow-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--card-bg); color: var(--text); font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.12s; font-weight: 300;
}
.be-arrow-btn:hover:not(.disabled) { border-color: var(--primary); color: var(--primary); }
.be-arrow-btn.disabled { opacity: 0.3; cursor: default; }
.be-month-tab {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--card-bg); color: var(--text-muted); transition: all 0.12s;
}
.be-month-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.be-month-tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.be-tab-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #16a34a; vertical-align: middle; margin-left: 3px; }
.be-month-tab-current { border-color: var(--primary) !important; color: var(--primary) !important; font-weight: 700; }
.be-tab-now {
  display: inline-block; font-size: 9px; font-weight: 700;
  background: var(--primary); color: white;
  border-radius: 8px; padding: 1px 5px; margin-left: 4px;
  vertical-align: middle; text-transform: uppercase; letter-spacing: .03em;
}

.be-top-section { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 32px; }
.be-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 15px; width: 100%; }

/* Champion card */
.be-champion-card {
  background: linear-gradient(135deg, #1a0a0f 0%, #3d0b1a 50%, #1a0a0f 100%);
  border-radius: 18px; padding: 28px 32px;
  display: flex; flex-direction: column; align-items: center;
  min-width: 220px; flex: 1; max-width: 300px;
  box-shadow: 0 8px 32px rgba(136,19,55,0.4);
  position: relative; overflow: hidden;
}
.be-champion-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,200,50,0.12) 0%, transparent 70%);
}
.be-champion-crown { font-size: 32px; margin-bottom: -8px; position: relative; }
.be-champ-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid #fbbf24; margin: 8px 0; }
.be-champ-avatar {
  width: 72px; height: 72px; border-radius: 50%; border: 3px solid #fbbf24;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: white; margin: 8px 0;
}
.be-champ-name { font-size: 17px; font-weight: 800; color: white; text-align: center; margin-bottom: 4px; }
.be-champ-score { font-size: 38px; font-weight: 900; line-height: 1; }
.be-champ-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; margin-bottom: 16px; }
.be-champ-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-bottom: 16px; }
.be-champ-stat { background: rgba(255,255,255,0.07); border-radius: 9px; padding: 8px; text-align: center; }
.be-champ-stat-val { display: block; font-size: 18px; font-weight: 800; color: white; }
.be-champ-stat-lbl { font-size: 10px; color: rgba(255,255,255,0.9); text-transform: uppercase; }
.be-champ-badge {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #1a0a0f; border-radius: 20px; padding: 5px 14px;
  font-size: 11px; font-weight: 800; text-align: center;
}

/* Silver & Bronze */
.be-silver-bronze { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 180px; max-width: 240px; }
.be-sb-card {
  border-radius: 14px; padding: 16px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1.5px solid var(--border);
}
.be-sb-silver { background: linear-gradient(135deg, #f8fafc, #e2e8f0); border-color: #94a3b8; }
.be-sb-bronze { background: linear-gradient(135deg, #fff8f0, #fed7aa); border-color: #fb923c; }
.be-sb-medal { font-size: 22px; }
.be-sb-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.be-sb-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: white; }
.be-sb-name { font-size: 13px; font-weight: 700; color: var(--text); text-align: center; }
.be-sb-score { font-size: 20px; font-weight: 900; }

/* Table */
.be-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px; }
.be-table-section { margin-bottom: 32px; }
.be-table-wrap { overflow-x: auto; border-radius: 12px; border: 1.5px solid var(--border); }
.be-table { width: 100%; border-collapse: collapse; }
.be-table thead tr { background: var(--bg); }
.be-table th { padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); text-align: left; border-bottom: 1.5px solid var(--border); }
.be-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.be-tbl-row:last-child td { border-bottom: none; }
.be-tbl-row:hover { background: var(--bg); }
.be-tbl-top { background: linear-gradient(90deg, rgba(251,191,36,0.06), transparent); }
.be-tbl-rank { font-size: 16px; font-weight: 700; width: 40px; text-align: center; }
.be-tbl-rank .be-rank-num { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.be-tbl-user { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 150px; }
.be-tbl-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: white; flex-shrink: 0; }
.be-tbl-num { font-size: 14px; font-weight: 700; text-align: center; width: 70px; }
.be-green { color: #16a34a; } .be-orange { color: #d97706; } .be-red { color: #dc2626; }
.be-tbl-score { min-width: 160px; display: flex; align-items: center; gap: 10px; }
.be-score-bar-bg { flex: 1; height: 7px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.be-score-bar-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

/* History */
.be-history-section { margin-bottom: 24px; }
.be-history-row { display: flex; gap: 12px; flex-wrap: wrap; }
.be-hist-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: border-color 0.15s, transform 0.15s; min-width: 110px;
  background: var(--card-bg);
}
.be-hist-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.be-hist-month { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.be-hist-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.be-hist-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: white; }
.be-hist-name { font-size: 12px; font-weight: 700; color: var(--text); text-align: center; }
.be-hist-score { font-size: 13px; font-weight: 800; }

.be-formula-note { font-size: 11.5px; color: var(--text-muted); padding: 12px 16px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }

[data-theme="dark"] .be-sb-silver { background: var(--card-bg); border-color: #64748b; }
[data-theme="dark"] .be-sb-bronze { background: var(--card-bg); border-color: #fb923c; }

/* ─── Ideahast Page ─────────────────────────────────────────────────────────── */
.ih-page { padding: 0 24px 48px; }
.ih-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px; }
.ih-page-title { font-size:22px; font-weight:900; color:var(--text); }
.ih-page-sub   { font-size:13px; color:var(--text-muted); margin-top:2px; }

.ih-stats { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:24px; }
.ih-stat { background:var(--card-bg); border:1.5px solid var(--border); border-radius:12px; padding:14px 16px; text-align:center; }
.ih-stat-total { border-color:var(--primary-border); background:var(--primary-light); }
.ih-stat-val { font-size:26px; font-weight:900; color:var(--text); }
.ih-stat-lbl { font-size:11px; color:var(--text-muted); margin-top:3px; }

.ih-section { margin-bottom:28px; }
.ih-section-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:14px; }

/* Timeline */
.ih-timeline { background:var(--card-bg); border:1.5px solid var(--border); border-radius:12px; padding:16px 18px; }
.ih-bar-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.ih-bar-label { width:140px; flex-shrink:0; font-size:12px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right; }
.ih-bar-track { flex:1; height:16px; background:var(--bg); border-radius:99px; position:relative; border:1px solid var(--border); overflow:hidden; }
.ih-bar-fill  { position:absolute; top:0; height:100%; border-radius:99px; transition:width .3s; }
.ih-bar-status { width:18px; font-size:11px; font-weight:800; flex-shrink:0; }
.ih-timeline-axis { display:flex; justify-content:space-between; font-size:10px; color:var(--text-muted); margin-top:8px; padding:0 150px 0 0; }

/* Project cards */
.ih-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.ih-card { border:1.5px solid var(--border); border-radius:14px; overflow:hidden; cursor:pointer; transition:all 0.15s; display:flex; }
.ih-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--border); }
.ih-card-color { width:6px; flex-shrink:0; }
.ih-card-body  { flex:1; padding:14px 16px; }
.ih-card-top   { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; margin-bottom:6px; }
.ih-card-title { font-size:14px; font-weight:700; color:var(--text); flex:1; }
.ih-status-badge { font-size:11px; font-weight:700; padding:2px 9px; border-radius:20px; white-space:nowrap; flex-shrink:0; }
.ih-card-client { font-size:12px; color:var(--text-muted); display:flex; align-items:center; gap:4px; margin-bottom:5px; }
.ih-card-desc   { font-size:12px; color:var(--text-muted); margin-bottom:8px; line-height:1.4; }
.ih-card-dates  { display:flex; align-items:center; justify-content:space-between; font-size:11px; color:var(--text-muted); }
.ih-card-life   { font-weight:700; color:var(--text); }

/* Color picker */
.ih-color-btn { width:22px; height:22px; border-radius:50%; border:2px solid transparent; cursor:pointer; transition:transform .1s; }
.ih-color-btn:hover { transform:scale(1.2); }
.ih-color-btn.selected { border-color:var(--text); transform:scale(1.15); }

/* ─── B2C Finance Page ─────────────────────────────────────────────────────── */
.b2c-page { padding: 0 24px 48px; }
.b2c-courses-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.b2c-courses-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; padding:4px 2px 12px; }
.b2c-course-card { background:var(--card-bg); border:1.5px solid var(--border); border-radius:14px; padding:18px; cursor:pointer; transition:all 0.15s; }
.b2c-course-card:hover { border-color:var(--primary); transform:translateY(-2px); box-shadow:var(--shadow-md); }
.b2c-course-card:focus { outline:none; border-color:var(--border); transform:none; box-shadow:none; }
.b2c-course-title { font-size:15px; font-weight:800; color:var(--text); margin-bottom:8px; }
.b2c-course-meta { font-size:12px; color:var(--text-muted); display:flex; align-items:center; gap:5px; margin-bottom:4px; }
.b2c-course-stats { display:flex; justify-content:space-between; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); font-size:12px; font-weight:600; }
.b2c-course-finance { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:10px; padding:10px; background:var(--bg); border-radius:8px; }
.b2c-cf-item { display:flex; flex-direction:column; align-items:center; gap:2px; }
.b2c-cf-lbl  { font-size:9.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; font-weight:600; }
.b2c-cf-val  { font-size:13px; font-weight:800; color:var(--text); white-space:nowrap; }
.b2c-cf-bar  { height:4px; background:var(--border); border-radius:99px; overflow:hidden; margin-top:6px; }
.b2c-cf-bar-fill { height:100%; background:#16a34a; border-radius:99px; }
.b2c-course-actions { display:flex; gap:6px; margin-top:10px; }

.b2c-filter-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.b2c-month-tabs { display:flex; gap:6px; flex-wrap:wrap; }
.b2c-dashboard { margin-bottom:20px; display:flex; flex-direction:column; gap:12px; }
.b2c-dash-row  { display:flex; gap:12px; flex-wrap:wrap; }
.b2c-dash-card { background:var(--card-bg); border:1.5px solid var(--border); border-radius:12px; padding:14px 16px; display:flex; align-items:center; gap:14px; flex:1; min-width:160px; }
.b2c-dash-wide { flex:1; min-width:0; }
.b2c-dash-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.b2c-dash-val  { font-size:22px; font-weight:900; color:var(--text); }
.b2c-dash-lbl  { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* ─── Review Page ───────────────────────────────────────────────────────── */
.nav-review-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 5px;
  background:#7c3aed; color:#fff; border-radius:99px;
  font-size:10px; font-weight:700; margin-left:auto; flex-shrink:0;
}
.review-tasks-list { display:flex; flex-direction:column; gap:14px; }
.review-task-card {
  background:var(--card-bg); border:1.5px solid #e9d5ff;
  border-radius:14px; padding:18px 20px;
  box-shadow:0 1px 6px rgba(109,40,217,.07);
  transition:box-shadow .15s;
}
.review-task-card:hover { box-shadow:0 4px 16px rgba(109,40,217,.12); }
.review-task-top { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.review-task-badges { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.review-task-title { font-size:15px; font-weight:700; color:var(--text); margin-bottom:8px; line-height:1.4; }
.review-task-title:hover { color:var(--primary); text-decoration:underline; }
.review-task-meta { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.review-task-actions {
  display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap;
  padding-top:14px; border-top:1px solid #f3f0ff;
}
.review-approve-btn { background:#7c3aed; border-color:#7c3aed; }
.review-approve-btn:hover { background:#6d28d9; border-color:#6d28d9; }
.review-reject-btn { color:#dc2626; border-color:#dc2626; }
.review-reject-btn:hover { background:#fef2f2; }

/* ─── B2C Card v2 ───────────────────────────────────────────────────────── */
.b2c-card-v2 { display:flex; flex-direction:column; gap:0; padding:0; overflow:visible; }
.b2c-card-v2-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap:8px;
  padding:16px 16px 0;
}
.b2c-card-v2-title { font-size:15px; font-weight:800; color:var(--text); line-height:1.3; flex:1; }
.b2c-card-v2-actions { display:flex; gap:4px; flex-shrink:0; opacity:0; transition:opacity .15s; }
.b2c-card-v2:hover .b2c-card-v2-actions { opacity:1; }

.b2c-card-v2-status {
  display:inline-flex; align-items:center; gap:4px;
  font-size:10.5px; font-weight:700; padding:3px 8px; border-radius:99px;
  margin:8px 16px 0; align-self:flex-start;
}
.b2c-card-v2-status.active { background:#dcfce7; color:#15803d; }
.b2c-card-v2-status.done   { background:#f3f4f6; color:#6b7280; }

.b2c-card-v2-meta {
  display:flex; align-items:center; gap:5px;
  font-size:12px; color:var(--text-muted); padding:4px 16px 0;
}
.b2c-card-v2-phone { color:#94a3b8; }

.b2c-card-v2-students {
  display:flex; align-items:baseline; gap:5px;
  padding:12px 16px 0;
}
.b2c-card-v2-students-num { font-size:22px; font-weight:800; color:var(--text); line-height:1; }
.b2c-card-v2-students-lbl { font-size:12px; color:var(--text-muted); font-weight:500; }

.b2c-card-v2-finance {
  display:flex; align-items:stretch;
  margin:14px 16px 16px;
  background:var(--bg); border-radius:10px;
  overflow:hidden; border:1px solid var(--border);
}
.b2c-card-v2-fin-item {
  flex:1; display:flex; flex-direction:column; align-items:center;
  gap:3px; padding:10px 6px;
}
.b2c-card-v2-fin-divider { width:1px; background:var(--border); flex-shrink:0; }
.b2c-card-v2-fin-lbl { font-size:9px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; font-weight:700; }
.b2c-card-v2-fin-val { font-size:14px; font-weight:800; color:var(--text); white-space:nowrap; }

.b2c-card-v2-progress-wrap {
  display:flex; align-items:center; gap:8px;
  padding:10px 16px 16px;
}
.b2c-card-v2-progress-bar { flex:1; height:5px; background:var(--border); border-radius:99px; overflow:hidden; }
.b2c-card-v2-progress-fill { height:100%; border-radius:99px; transition:width .3s; }
.b2c-card-v2-pct { font-size:11px; font-weight:700; flex-shrink:0; width:34px; text-align:right; }

/* ─── B2C Course detail header ──────────────────────────────────────────── */
.b2c-course-header { display:flex; align-items:flex-start; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.b2c-course-info { flex:1; }
.b2c-course-title-big { font-size:18px; font-weight:800; color:var(--text); margin-bottom:4px; }
.b2c-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px; }
.b2c-stat { background:var(--card-bg); border:1.5px solid var(--border); border-radius:10px; padding:12px 16px; text-align:center; }
.b2c-stat-val { font-size:22px; font-weight:800; color:var(--text); }
.b2c-stat-lbl { font-size:11px; color:var(--text-muted); margin-top:2px; }

.b2c-table-wrap { overflow-x:auto; border-radius:12px; border:1.5px solid var(--border); }
.b2c-table { width:100%; border-collapse:collapse; font-size:13px; }
.b2c-table thead tr { background:var(--bg); }
.b2c-table th { padding:9px 12px; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); text-align:left; border-bottom:2px solid var(--border); border-right:1px solid var(--border); white-space:nowrap; }
.b2c-table th:last-child { border-right:none; }
.b2c-td { padding:8px 12px; border-bottom:1px solid var(--border); border-right:1px solid var(--border); vertical-align:middle; }
.b2c-td:last-child { border-right:none; }
.b2c-row:hover td { background:var(--bg); }
.b2c-num { width:32px; text-align:center; color:var(--text-muted); font-size:12px; }
.b2c-name { font-weight:600; min-width:140px; }
.b2c-phone { font-size:12px; color:var(--text-muted); white-space:nowrap; }
.b2c-amount { text-align:right; font-weight:700; white-space:nowrap; }
.b2c-date { white-space:nowrap; font-size:12px; color:var(--text-muted); }
.b2c-comment { font-size:12px; color:var(--text-muted); max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.b2c-actions { display:flex; gap:5px; white-space:nowrap; }
.b2c-sel {
  border:none; background:transparent; font-size:12px; font-weight:700;
  cursor:pointer; padding:3px 6px; border-radius:6px; outline:none;
  min-width:80px; -webkit-appearance:none; text-align:center;
}
.b2c-sel:hover { opacity:0.8; }
.b2c-sel-receiver { min-width:70px; }

/* ─── Finance Page ─────────────────────────────────────────────────────────── */
.fin-page { padding: 0 0 48px; }
.fin-header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 18px; gap: 12px; }
.fin-month-nav { display: flex; align-items: center; gap: 12px; }
.fin-nav-btn { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--card-bg); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.12s; }
.fin-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.fin-month-title { font-size: 17px; font-weight: 800; color: var(--text); min-width: 140px; text-align: center; }

/* Summary cards */
.fin-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; padding: 0 24px 20px; }
.fin-sum-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.fin-sum-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.fin-sum-val { font-size: 24px; font-weight: 900; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-sum-sub { font-size: 11.5px; color: var(--text-muted); }
.fin-progress-bar-bg { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 6px; border: 1px solid var(--border); }
.fin-progress-bar-fill { height: 100%; background: #16a34a; border-radius: 99px; }

/* Table */
.fin-table-wrap { padding: 0 24px; overflow-x: auto; border-radius: 12px; }
.fin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden;
}
.fin-table thead tr { background: var(--bg); }
.fin-table th {
  padding: 10px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  text-align: left; border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border); white-space: nowrap;
}
.fin-table th:last-child { border-right: none; }
.fin-td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border); vertical-align: middle;
}
.fin-td:last-child { border-right: none; }
.fin-row:hover td { background: var(--bg); }
.fin-num { color: var(--text-muted); font-size: 12px; width: 36px; text-align: center; }
.fin-project { font-weight: 600; color: var(--text); min-width: 120px; }
.fin-money { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px; }
.fin-comment { color: var(--text-muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-actions { display: flex; gap: 6px; white-space: nowrap; justify-content: center; }
.fin-btn-edit, .fin-btn-del { width: 28px; height: 28px; border-radius: 7px; border: 1.5px solid var(--border); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.12s; color: var(--text-muted); }
.fin-btn-edit:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.fin-btn-del:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.fin-status-badge { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; display: inline-block; }
.fin-type-badge { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; display: inline-block; }
.fin-total-row td { background: var(--bg) !important; border-top: 2px solid var(--border); }
.fin-total-lbl { font-weight: 800; font-size: 12px; text-transform: uppercase; color: var(--text-muted); }
.fin-total { font-size: 14px; font-weight: 800; white-space: nowrap; }

[data-theme="dark"] .fin-sum-card { background: var(--card-bg); }
[data-theme="dark"] .fin-table th { background: var(--card-bg); }

/* Finance extras */
.fin-tabs-bar { display: flex; gap: 6px; padding: 0 24px 14px; border-bottom: 1.5px solid var(--border); margin-bottom: 0; }
.fin-tab { padding: 6px 16px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--card-bg); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.12s; }
.fin-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.fin-tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

.fin-filter-bar { display: flex; align-items: center; gap: 8px; padding: 12px 24px; flex-wrap: wrap; background: var(--bg); border-bottom: 1px solid var(--border); }
.fin-search-wrap { display: flex; align-items: center; gap: 7px; background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 9px; padding: 6px 12px; flex: 1; max-width: 280px; }
.fin-search-input { flex: 1; border: none; outline: none; font-size: 13px; color: var(--text); background: transparent; }
.fin-filter-sel { padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 13px; background: var(--card-bg); color: var(--text); cursor: pointer; }

.fin-cur { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.fin-pmts-badge { display: inline-block; margin-left: 5px; background: #bae6fd; color: #0369a1; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; cursor: pointer; }
.fin-recur-dot { font-size: 10px; color: #d97706; margin-left: 3px; }
.fin-row-recurring { background: #fffbeb !important; }
.fin-row-b2c  { background: #f5f3ff !important; }
.fin-row-kids { background: #f0fdf4 !important; }
[data-theme="dark"] .fin-row-b2c  { background: rgba(99,102,241,0.08) !important; }
[data-theme="dark"] .fin-row-kids { background: rgba(22,163,74,0.08) !important; }
[data-theme="dark"] .fin-row-recurring { background: rgba(180,83,9,0.08) !important; }

.fin-chart-wrap {
  margin: 0 24px 20px;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
}

/* ─── Schedule Page ───────────────────────────────────────────────────────── */
.sched-page { padding: 0 0 40px; }
.sched-toolbar {
  padding: 0 24px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.sched-toolbar-right { display: flex; gap: 8px; flex-shrink: 0; }
.sched-filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.sched-search { max-width: 220px; padding: 7px 12px; font-size: 13px; }
.sched-class-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-cls-btn {
  padding: 5px 12px; border-radius: 20px; border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--card-bg); color: var(--text-muted);
  transition: all 0.15s;
}
.sched-cls-btn.active {
  background: var(--cls-color); border-color: var(--cls-color);
  color: white; opacity: 1;
}
.sched-col-hidden { opacity: 0.25; cursor: default !important; pointer-events: none; }

/* ─── Print / Export ──────────────────────────────────────────────────────── */
@media print {
  @page { size: A4 landscape; margin: 0.6cm; }

  /* ① Force all background colors to print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* ② Hide everything except the schedule */
  aside, .topbar, .sched-toolbar,
  #notif-panel, .toast-container, .modal-overlay { display: none !important; }

  /* ③ Flatten page layout */
  body { background: white !important; margin: 0; }
  #app-screen { display: block !important; }
  #main-content { overflow: visible !important; height: auto !important; }
  .page-content { padding: 0 !important; overflow: visible !important; height: auto !important; }

  /* ④ Schedule wrapper — no scroll, full width */
  .sched-page  { padding: 0 !important; }
  .sched-outer { overflow: visible !important; padding: 0 !important; }
  .sched-scroll-area { min-width: unset !important; width: 100% !important; }

  /* ⑤ Header row — always visible, no sticky */
  .sched-head {
    display: flex !important;
    position: static !important;
    border-bottom: 2px solid #94a3b8 !important;
    background: white !important;
  }
  .sched-day-name  { font-size: 9px !important; font-weight: 700 !important; padding: 4px 2px 3px !important; }
  .sched-class-lbl { font-size: 7.5px !important; padding: 2px 1px !important; }

  /* ⑥ Time column — compact */
  .sched-time-stub,
  .sched-time-col  { width: 38px !important; flex-shrink: 0 !important; }
  .sched-time-cell {
    font-size: 8.5px !important;
    height: 64px !important;   /* keep 64px so events stay aligned */
    padding: 3px 5px 0 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  /* ⑦ Day/class columns */
  .sched-day-group { border-right: 1.5px solid #94a3b8 !important; }
  .sched-class-col {
    border-right: 1px dashed #cbd5e1 !important;
    min-width: 0 !important;
  }
  .sched-hour-line { background: #e2e8f0 !important; opacity: 1 !important; }

  /* ⑧ Events — colors print, text tiny but legible */
  .sched-event {
    box-shadow: none !important;
    border-radius: 3px !important;
    padding: 3px 4px !important;
    left: 1px !important; right: 1px !important;
  }
  .sched-event-title   { font-size: 8px !important; font-weight: 700 !important; color: white !important; }
  .sched-event-time    { font-size: 7px !important; color: rgba(255,255,255,0.9) !important; }
  .sched-event-comment { display: none !important; }
}
.sched-outer { overflow-x: auto; padding: 0 24px; }
.sched-scroll-area { min-width: 900px; }

.sched-head {
  display: flex;
  position: sticky; top: 0; z-index: 10;
  background: var(--card-bg);
  border-bottom: 2px solid var(--border);
}
.sched-time-stub { width: 56px; flex-shrink: 0; border-right: 1px solid var(--border); }
.sched-day-head {
  flex: 1; min-width: 0;
  border-right: 1px solid var(--border);
  padding-bottom: 6px;
}
.sched-day-name {
  text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text); padding: 8px 4px 4px;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.sched-class-labels { display: flex; }
.sched-class-lbl {
  flex: 1; text-align: center;
  font-size: 10px; font-weight: 700; color: white;
  padding: 3px 2px; opacity: 0.9;
}

.sched-body { display: flex; position: relative; }
.sched-time-col { width: 56px; flex-shrink: 0; border-right: 1px solid var(--border); }
.sched-time-cell {
  height: 64px;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 4px 8px 0 0;
  font-size: 11px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.sched-day-group { flex: 1; min-width: 0; display: flex; border-right: 1px solid var(--border); }
.sched-class-col {
  flex: 1; min-width: 0;
  position: relative; cursor: crosshair;
  border-right: 1px dashed var(--border);
}
.sched-class-col:last-child { border-right: none; }

.sched-hour-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--border); opacity: 0.5; pointer-events: none;
}

.sched-event {
  position: absolute; left: 2px; right: 2px;
  border-radius: 5px; padding: 4px 6px;
  cursor: pointer; overflow: hidden; z-index: 2;
  transition: opacity 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sched-event:hover { opacity: 0.85; }
.sched-event-title { font-size: 10.5px; font-weight: 700; color: white; line-height: 1.3; overflow: hidden; }
.sched-event-teacher { font-size: 9.5px; color: rgba(255,255,255,0.9); margin-top: 1px; font-style: italic; }
.sched-event-time { font-size: 9.5px; color: rgba(255,255,255,0.85); margin-top: 2px; }
.sched-event-comment {
  font-size: 9px; color: rgba(255,255,255,0.7);
  margin-top: 3px; line-height: 1.4;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

[data-theme="dark"] .sched-head { background: var(--card-bg); }
/* Dark theme: per-class column backgrounds instead of filter */
[data-theme="dark"] .sched-class-col { filter: none; }
[data-theme="dark"] .sched-class-col:nth-child(1) { background: #1a1f2e !important; }
[data-theme="dark"] .sched-class-col:nth-child(2) { background: #052e16 !important; }
[data-theme="dark"] .sched-class-col:nth-child(3) { background: #2d0a0a !important; }
[data-theme="dark"] .sched-class-col:nth-child(4) { background: #1e0a2d !important; }
[data-theme="dark"] .sched-class-col:nth-child(5) { background: #1c1500 !important; }
[data-theme="dark"] .sched-class-col.sched-col-hidden { opacity: 0.15 !important; }

.sched-dragging { opacity: 0.35 !important; }
.sched-drop-over { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ─── Welcome Modal ────────────────────────────────────────────────────── */
.welcome-modal {
  max-width: 680px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}
.welcome-body {
  padding: 36px 36px 24px;
}
.welcome-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.2;
}
.welcome-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.6;
}
.welcome-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.welcome-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg);
}
.welcome-card-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  color: var(--primary);
  flex-shrink: 0;
}
.welcome-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.welcome-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.welcome-info {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-border);
  border-radius: 12px;
  padding: 16px;
}
.welcome-info-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.welcome-info-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 5px;
}
.welcome-info-desc {
  font-size: 12.5px;
  color: var(--primary);
  line-height: 1.55;
}
.welcome-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 36px;
  border-top: 1.5px solid var(--border);
  gap: 16px;
}
.welcome-footer-text {
  font-size: 13px;
  color: var(--text-muted);
}
.welcome-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 9px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  display: flex; align-items: center; gap: 6px;
}
.welcome-btn:hover { background: var(--primary-hover); }

[data-theme="dark"] .welcome-card { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .welcome-info { background: rgba(136,19,55,0.1); border-color: rgba(136,19,55,0.25); }
[data-theme="dark"] .welcome-info-icon { background: var(--card-bg); }
[data-theme="dark"] .welcome-info-title { color: #fca5a5; }
[data-theme="dark"] .welcome-info-desc { color: #fca5a5; opacity: 0.85; }
[data-theme="dark"] .donut-pct-text { fill: #F1F5F9; }

/* ─── Summary Report Table ─────────────────────────────────────────────────── */
.sr-table { width: 100%; border-collapse: collapse; }
.sr-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.sr-table tbody tr:hover { background: var(--bg); }
.sr-th { text-align: center; padding: 10px 8px; font-size: 12px; color: #6b7280; font-weight: 600; white-space: nowrap; }
.sr-td-num { text-align: center; padding: 10px 8px; font-size: 13px; }

/* ─── Payment Checklist ─────────────────────────────────────────────────────── */
.pcl-wrap { max-width: 680px; margin: 24px auto 0; }
.pcl-header { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; margin-bottom: 12px; }
.pcl-progress-info { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.pcl-progress-nums { font-size: 28px; font-weight: 700; }
.pcl-progress-label { font-size: 14px; color: var(--text-muted); }
.pcl-progress-bar-wrap { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.pcl-progress-bar { height: 100%; border-radius: 99px; transition: width 0.4s ease; }

.pcl-list { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.pcl-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.pcl-row:last-child { border-bottom: none; }
.pcl-row--done { background: #f0fdf4; }
[data-theme="dark"] .pcl-row--done { background: rgba(5,150,105,0.08); }

.pcl-checkbox { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.pcl-checkbox:hover { border-color: var(--primary); }
.pcl-checkbox--checked { background: #059669; border-color: #059669; color: white; }
.pcl-checkbox--checked:hover { background: #047857; border-color: #047857; }

.pcl-name { flex: 1; font-size: 14px; font-weight: 500; }
.pcl-row--done .pcl-name { color: var(--text-muted); text-decoration: line-through; }
.pcl-meta { font-size: 11.5px; color: #059669; display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 120px; }
[data-theme="dark"] .pcl-meta { color: #34d399; }
.pcl-edit-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; display: flex; align-items: center; opacity: 0; transition: opacity 0.15s, color 0.15s; }
.pcl-row:hover .pcl-edit-btn { opacity: 0.5; }
.pcl-edit-btn:hover { opacity: 1 !important; color: var(--primary); }
.pcl-del-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; display: flex; align-items: center; opacity: 0; transition: opacity 0.15s, color 0.15s; }
.pcl-row:hover .pcl-del-btn { opacity: 0.5; }
.pcl-del-btn:hover { opacity: 1 !important; color: #dc2626; }
.pcl-inline-input { flex: 1; border: 1px solid var(--primary); border-radius: 6px; padding: 4px 8px; font-size: 13.5px; background: var(--bg); color: var(--text); outline: none; min-width: 0; margin-right: 6px; }

.pcl-add-row { padding: 12px 16px; }
.pcl-add-btn { background: none; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-muted); font-size: 13px; padding: 10px 16px; width: 100%; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; justify-content: center; }
.pcl-add-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(136,19,55,0.03); }
.pcl-add-form { display: flex; gap: 8px; align-items: center; padding: 12px 16px; }
.pcl-add-input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; background: var(--bg); color: var(--text); outline: none; }
.pcl-add-input:focus { border-color: var(--primary); }
.hidden { display: none !important; }

/* ─── HR Module ──────────────────────────────────────────────────────────────── */
.team-tabs-bar { display: flex; gap: 4px; padding: 0; margin-bottom: 4px; }
.hr-wrap { padding-bottom: 40px; }
.hr-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 20px 0 8px; }
.hr-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.hr-th { padding: 10px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); text-align: left; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.hr-td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.hr-tr:last-child .hr-td { border-bottom: none; }
.hr-tr { cursor: pointer; transition: background .12s; }
.hr-tr:hover { background: var(--bg); }
.hr-name { font-weight: 600; }
.hr-actions { display: flex; gap: 6px; align-items: center; opacity: 0; transition: opacity .15s; }
.hr-tr:hover .hr-actions { opacity: 1; }
.hr-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.hr-badge--active { background: #dcfce7; color: #16a34a; }
.hr-badge--terminated { background: #fee2e2; color: #dc2626; }
[data-theme="dark"] .hr-badge--active { background: rgba(22,163,74,.15); color: #4ade80; }
[data-theme="dark"] .hr-badge--terminated { background: rgba(220,38,38,.15); color: #f87171; }

/* HR view modal */
.hr-view-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; background: var(--bg); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.hr-view-meta-item { display: flex; flex-direction: column; gap: 2px; }
.hr-view-meta-item--full { grid-column: 1/-1; }
.hr-view-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.hr-history-section { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.hr-history-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.hr-history-title { font-size: 13px; font-weight: 700; }

/* Form helpers */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group--full { grid-column: 1/-1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ─── Workload page ─────────────────────────────────────────────────────────── */
.wl-table { width: 100%; }
.wl-row:hover { background: var(--hover-bg); }
.wl-td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wl-user-cell { min-width: 180px; }
.wl-user-inner { display: flex; align-items: center; gap: 10px; }
.wl-user-name { font-size: 13.5px; font-weight: 600; }
.wl-proj-cell { min-width: 200px; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wl-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; font-size: 12px; background: rgba(var(--chip-c-r,99),var(--chip-c-g,102),var(--chip-c-b,241),.1); border: 1px solid rgba(var(--chip-c-r,99),var(--chip-c-g,102),var(--chip-c-b,241),.25); color: var(--text); white-space: nowrap; }
.wl-chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.wl-chip-name { font-weight: 500; }
.wl-chip-count { color: var(--text-muted); font-size: 11px; }
.wl-chip-rm { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 0 0 2px; opacity: 0.6; transition: opacity .15s; }
.wl-chip-rm:hover { opacity: 1; color: #ef4444; }
.wl-add-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--border); background: none; cursor: pointer; font-size: 16px; color: var(--text-muted); transition: border-color .15s, color .15s; }
.wl-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.wl-stats { display: flex; flex-direction: column; gap: 4px; }
.wl-stats-row { display: flex; align-items: center; justify-content: space-between; }
.wl-stats-num { font-size: 13px; font-weight: 600; }
.wl-stats-pct { font-size: 13px; font-weight: 700; }
.wl-stats-sub { font-size: 11px; color: var(--text-muted); }
.wl-bar-bg { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.wl-bar-fill { height: 100%; border-radius: 2px; transition: width .3s ease; }
.wl-proj-pick-btn { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text); text-align: left; transition: background .15s; }
.wl-proj-pick-btn:hover { background: var(--hover-bg); }
.member-proj-chips { display: flex; align-items: center; gap: 4px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.member-proj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.member-proj-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.wl-proj-summary { display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.wl-proj-summary-lbl { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.wl-summary { display: flex; flex-direction: column; gap: 2px; max-width: 620px; }
.wl-sum-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; transition: background .15s; }
.wl-sum-row:hover { background: var(--hover-bg); }
.wl-sum-rank { font-size: 12px; font-weight: 700; width: 18px; text-align: center; flex-shrink: 0; }
.wl-sum-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-sum-dots { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.wl-sum-badge { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; min-width: 72px; text-align: right; }
.wl-sum-bar-wrap { width: 100px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; flex-shrink: 0; }
.wl-sum-bar { height: 100%; border-radius: 2px; background: var(--accent); transition: width .4s ease; }

/* ─── Timesheet (Табель рабочего времени) ─────────────────────────────────── */
.ts-page { display: flex; flex-direction: column; gap: 0; padding: 20px; min-height: 100%; }
.ts-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.ts-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.ts-period { font-size: 14px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.ts-toolbar-btns { display: flex; gap: 8px; align-items: center; }
.ts-toolbar-btns .btn { display: inline-flex; align-items: center; }

/* Table wrapper with horizontal scroll */
.ts-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.ts-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12px; }
.ts-table th, .ts-table td { border: 1px solid var(--border); text-align: center; padding: 0; white-space: nowrap; }

/* Sticky left columns */
.ts-table .ts-hdr-fixed, .ts-table .ts-num-col, .ts-table .ts-name-col, .ts-table .ts-pos-col {
  position: sticky; background: var(--card-bg); z-index: 2;
}
.ts-table .ts-num-col, .ts-table .ts-num-hdr { left: 0; min-width: 36px; width: 36px; }
.ts-table .ts-name-col, .ts-table .ts-name-hdr { left: 36px; min-width: 180px; text-align: left; }
.ts-table .ts-pos-col, .ts-table .ts-pos-hdr { left: 216px; min-width: 120px; text-align: left; padding: 0 8px; }
.ts-table .ts-name-hdr, .ts-table .ts-pos-hdr { padding: 6px 8px; font-weight: 600; font-size: 12px; }
.ts-table .ts-num-hdr { padding: 6px 4px; font-weight: 600; font-size: 12px; }

/* Header rows */
.ts-table thead th { background: var(--card-bg); font-weight: 600; color: var(--text); z-index: 3; }
.ts-day-hdr { min-width: 32px; width: 32px; height: 28px; padding: 4px 2px !important; font-size: 12px; font-weight: 600; }
.ts-dow-hdr { min-width: 32px; width: 32px; height: 20px; padding: 2px !important; font-size: 10px; color: var(--text-muted); font-weight: 400; }
.ts-total-hdr { min-width: 52px; padding: 4px 6px !important; font-size: 11px; font-weight: 600; background: var(--hover-bg); position: sticky; z-index: 2; }

/* Weekend / holiday headers */
.ts-weekend-hdr, .ts-holiday-hdr { color: #ef4444 !important; background: #fff5f5 !important; }
[data-theme="dark"] .ts-weekend-hdr, [data-theme="dark"] .ts-holiday-hdr { background: #3b1a1a !important; color: #f87171 !important; }

/* Employee rows */
.ts-emp-row:hover td.ts-name-col, .ts-emp-row:hover td.ts-pos-col, .ts-emp-row:hover td.ts-num-col { background: var(--hover-bg) !important; }
.ts-num-col { padding: 0 4px; font-size: 12px; color: var(--text-muted); height: 36px; }
.ts-name-col { padding: 0 8px 0 6px; }
.ts-pos-col { padding: 0 8px; font-size: 11px; color: var(--text-muted); }

/* Name cell inner layout */
.ts-name-inner { display: flex; align-items: center; gap: 7px; min-height: 36px; position: relative; padding-left: 6px; padding-right: 4px; }
.ts-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ts-emp-name { font-size: 12px; font-weight: 500; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-emp-actions { display: flex; gap: 2px; flex-shrink: 0; max-width: 0; overflow: hidden; opacity: 0; transition: max-width .15s, opacity .15s; background: var(--card-bg); border-radius: 4px; }
.ts-emp-row:hover .ts-emp-actions { max-width: 60px; opacity: 1; }
.ts-emp-btn { background: none; border: none; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 12px; line-height: 1; transition: background .15s; color: var(--text-muted); }
.ts-emp-btn:hover { background: var(--hover-bg); color: var(--text); }
.ts-emp-btn-del:hover { color: #ef4444; }

/* Day cells */
.ts-cell { min-width: 32px; width: 32px; height: 36px; text-align: center; vertical-align: middle; font-size: 12px; font-weight: 500; cursor: default; transition: background .1s; padding: 0 !important; }
.ts-cell.ts-empty { cursor: pointer; }
.ts-cell.ts-empty:hover { background: var(--hover-bg); }
.ts-cell.ts-work { background: #dcfce7; color: #15803d; cursor: pointer; font-weight: 700; }
.ts-cell.ts-work:hover { background: #bbf7d0; }
.ts-cell.ts-absent { background: #fee2e2; color: #b91c1c; cursor: pointer; font-weight: 700; }
.ts-cell.ts-absent:hover { background: #fecaca; }
.ts-cell.ts-weekend { background: #f3f4f6; color: #9ca3af; font-weight: 600; cursor: default; }
.ts-cell.ts-holiday { background: #fef2f2; color: #ef4444; font-weight: 600; cursor: default; }

[data-theme="dark"] .ts-cell.ts-work { background: #14532d; color: #86efac; }
[data-theme="dark"] .ts-cell.ts-work:hover { background: #166534; }
[data-theme="dark"] .ts-cell.ts-absent { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .ts-cell.ts-absent:hover { background: #7f1d1d; }
[data-theme="dark"] .ts-cell.ts-weekend { background: #1f2937; color: #6b7280; }
[data-theme="dark"] .ts-cell.ts-holiday { background: #3b1a1a; color: #f87171; }

/* Totals columns */
.ts-total-col { min-width: 52px; padding: 4px 6px !important; font-size: 12px; font-weight: 600; background: var(--hover-bg); }
.ts-salary { color: var(--text-muted); }
.ts-earned { color: #15803d; }
[data-theme="dark"] .ts-earned { color: #86efac; }

/* Footer row */
.ts-footer-row { background: var(--hover-bg); border-top: 2px solid var(--border); }
.ts-footer-label { text-align: right; padding: 10px 12px !important; font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: .01em; }
.ts-footer-total { font-size: 15px; font-weight: 800; color: #15803d; min-width: 80px; padding: 10px 8px !important; white-space: nowrap; }
[data-theme="dark"] .ts-footer-total { color: #86efac; }
.ts-weekend-work { background: #d1fae5 !important; color: #065f46 !important; font-weight: 700; }
[data-theme="dark"] .ts-weekend-work { background: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; }

/* Empty state cell */
.ts-empty-msg { padding: 32px !important; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Legend */
.ts-legend { display: flex; align-items: center; gap: 16px; padding: 10px 0; flex-wrap: wrap; }
.ts-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.ts-legend-hint { margin-left: auto; font-style: italic; }
.ts-legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); }
.ts-legend-swatch.ts-work { background: #dcfce7; border-color: #86efac; }
.ts-legend-swatch.ts-absent { background: #fee2e2; border-color: #fca5a5; }
.ts-legend-swatch.ts-weekend { background: #f3f4f6; border-color: #d1d5db; }

/* Holidays modal */
.ts-hol-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ts-hol-row:last-child { border-bottom: none; }
.ts-hol-date { font-family: monospace; font-size: 12px; color: var(--text-muted); flex-shrink: 0; min-width: 90px; }
.ts-hol-name { flex: 1; color: var(--text); }
.ts-hol-sys { font-size: 11px; color: var(--text-muted); background: var(--hover-bg); padding: 2px 6px; border-radius: 4px; }
.ts-hol-del-btn { background: none; border: none; cursor: pointer; color: #ef4444; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 4px; transition: background .15s; }
.ts-hol-del-btn:hover { background: #fee2e2; }

/* Column widths */
.ts-col-num { width: 36px; }
.ts-col-name { min-width: 180px; }
.ts-col-pos { min-width: 120px; }
.ts-col-day { width: 32px; min-width: 32px; }
.ts-col-total { width: 48px; min-width: 48px; }
.ts-salary, .ts-bonus, .ts-advance, .ts-earned { width: 72px; min-width: 72px; text-align: right; }

/* ─── Touch target sizing (mobile) ──────────────────────────────────────── */
@media (max-width: 768px) {
  .btn, .ma-done-btn, .task-card button, .modal-close { min-height: 44px; min-width: 44px; }
}
