:root {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-secondary: #f0f1f3;
  --bg-hover: #f8f9fa;
  --border: #e3e5e8;
  --border-strong: #c8ccd2;
  --text: #1a1d23;
  --text-secondary: #4a5060;
  --text-muted: #8b90a0;
  --primary: #3b5bdb;
  --primary-hover: #2a4ac4;
  --primary-light: #eef2ff;
  --danger: #e03131;
  --danger-light: #fff5f5;
  --success: #2f9e44;
  --success-light: #ebfbee;
  --warning: #e67700;
  --warning-light: #fff9db;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; line-height: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d3da; border-radius: 3px; }

/* ─── APP SHELL ─────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.header {
  flex-shrink: 0;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  z-index: 50;
  position: relative;
}
/* Thin brand-red accent line at the very bottom */
.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #d71920 0%, #ff6b6b 40%, transparent 80%);
  opacity: 0.55;
}

.header-brand { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.header-brand em { color: #d71920; font-style: normal; }

/* Date chip in the header */
.header-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: .02em;
}

.header-spacer { flex: 1; }
.header-right { display: flex; align-items: center; gap: 8px; }

/* Refresh icon */
.header-right .btn-icon {
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px;
  transition: background .15s, color .15s;
}
.header-right .btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

/* Logout button */
.header-right > .btn-ghost {
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.header-right > .btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

/* Workload strip */
.wl-strip {
  flex-shrink: 0;
  background: #f8f9ff;
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}
.wl-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; white-space: nowrap; }
.wl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .1s, opacity .1s;
  border: 1px solid transparent;
  user-select: none;
}
.wl-chip:hover { transform: translateY(-1px); opacity: .85; }
.wl-chip .wl-count {
  background: rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
}
.wl-overdue-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }
.wl-chip.wl-free { opacity: .45; }

/* Tabs */
.tabs {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}
.tab {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  font-weight: 400;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* Utility tab group (Activity, Archived) — right-aligned, low emphasis */
.tabs-util-spacer { flex: 1; min-width: 16px; }
.tabs-util-group {
  display: flex;
  align-items: center;
  gap: 0;
  border-left: 1px solid var(--border);
  padding-left: 8px;
  margin-left: 4px;
}
.tab.tab-util {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.65;
  border-bottom: 2px solid transparent;
  font-weight: 400;
  letter-spacing: .01em;
}
.tab.tab-util svg { flex-shrink: 0; }
.tab.tab-util:hover { color: var(--text-secondary); opacity: 1; }
.tab.tab-util.active { color: var(--text-secondary); opacity: 1; border-bottom-color: var(--border-strong); font-weight: 500; }

#main-content { flex: 1; overflow-y: auto; padding: 18px; }

/* ─── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  transition: background .1s, opacity .1s;
  line-height: 1; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-ghost   { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-secondary); }
.btn-outline { border: 1px solid var(--border-strong); background: #fff; color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-secondary); }
.btn-sm  { padding: 4px 9px; font-size: 12px; }
.btn-xs  { padding: 2px 7px; font-size: 11px; }
.btn-icon {
  width: 28px; height: 28px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px;
}
.btn-icon:hover { background: var(--bg-secondary); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-light); color: var(--danger); }

/* ─── BADGES ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 12px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.s-todo        { background: #f0f1f3; color: #555; }
.s-in_progress { background: #dbeafe; color: #1e3a8a; }
.s-blocked     { background: #fee2e2; color: #991b1b; }
.s-done        { background: #dcfce7; color: #14532d; }
.p-high   { background: #fee2e2; color: #991b1b; }
.p-medium { background: #fef3c7; color: #78350f; }
.p-low    { background: #f0fdf4; color: #14532d; }

.status-btn {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  cursor: pointer; transition: opacity .15s, transform .1s;
}
.status-btn:hover { opacity: .75; transform: scale(1.04); }
.status-btn:active { transform: scale(.97); }

/* ─── FORMS ─────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,91,219,.12);
}
.form-textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ─── MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body   { padding: 16px 20px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ─── TOAST ─────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .2s ease; max-width: 320px;
}
.toast-success { background: #1a3a1e; color: #fff; }
.toast-error   { background: #3a1a1a; color: #fff; }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── STANDUP VIEW ──────────────────────────────────── */
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.view-title { font-size: 17px; font-weight: 700; }
.view-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.view-actions { display: flex; gap: 6px; align-items: center; }

.person-row { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.person-row-header {
  padding: 9px 14px;
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.person-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.person-name { font-size: 13px; font-weight: 600; flex: 1; }
.person-meta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.meta-pill {
  font-size: 10px; padding: 1px 7px; border-radius: 10px;
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
}
.meta-pill.overdue { background: var(--danger-light); border-color: #fca5a5; color: var(--danger); }
.meta-pill.hi-pri  { background: var(--danger-light); border-color: #fca5a5; color: var(--danger); }
.meta-pill.done    { background: var(--success-light); border-color: #86efac; color: var(--success); }

.task-item {
  padding: 8px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg-hover); }

/* Click-to-edit rows across views */
.task-clickable { cursor: pointer; }
.task-clickable:hover { background: var(--bg-hover) !important; }
.task-clickable:active { background: var(--primary-light) !important; }
.task-item.is-done { opacity: .6; }
.task-item.is-done .task-text { text-decoration: line-through; color: var(--text-muted); }

.task-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; word-break: break-word; }
.task-meta { display: flex; align-items: center; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.task-proj-tag { font-size: 10px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.proj-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.task-due { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.task-due.overdue { color: var(--danger); font-weight: 600; }
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.task-item:hover .task-actions { opacity: 1; }
.task-act-btn {
  width: 22px; height: 22px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 4px; color: var(--text-muted); font-size: 12px;
}
.task-act-btn:hover { background: var(--border); color: var(--text); }
.task-act-btn.del:hover { background: var(--danger-light); color: var(--danger); }

/* ─── PROJECTS VIEW ─────────────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.filter-row { display: flex; gap: 4px; flex-wrap: wrap; }
.pf-btn {
  font-size: 11px; padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  color: var(--text-secondary); cursor: pointer; transition: all .12s;
}
.pf-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; }
.pf-btn:hover:not(.active) { background: var(--bg-secondary); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.proj-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.proj-card-hd {
  padding: 10px 13px; display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid var(--border);
}
.proj-card-hd:hover .proj-card-actions { opacity: 1; }
.proj-name { font-size: 13px; font-weight: 600; flex: 1; }
.proj-count { font-size: 11px; color: var(--text-muted); background: var(--bg-secondary); border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }
.proj-card-actions { display: flex; gap: 1px; opacity: 0; transition: opacity .15s; }
.proj-task-row {
  padding: 7px 13px; display: flex; align-items: flex-start; gap: 8px;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.proj-task-row:last-of-type { border-bottom: none; }
.proj-task-row:hover { background: var(--bg-hover); }
.proj-task-text { flex: 1; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.on-hold-note { padding: 8px 13px; font-size: 12px; color: var(--text-muted); font-style: italic; }
.btn-add-task {
  width: 100%; padding: 7px 13px; text-align: left;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px dashed var(--border);
  transition: background .1s, color .1s;
}
.btn-add-task:hover { background: var(--bg-secondary); color: var(--primary); }

/* ─── PEOPLE VIEW ───────────────────────────────────── */

/* Filter bar */
.people-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pf-group { display: flex; align-items: center; gap: 7px; }
.pf-group-sort { margin-left: auto; }
.pf-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pf-pills { display: flex; gap: 4px; }
.pf-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.pf-pill:hover { background: var(--bg-hover); color: var(--text); }
.pf-pill.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.pf-sort-sel { font-size: 12px; padding: 3px 8px; height: auto; }
.pf-reset { font-size: 11px; color: var(--text-muted); }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.people-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.people-card-hd {
  padding: 11px 13px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.people-name { font-size: 13px; font-weight: 600; }
.people-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.people-stats { margin-left: auto; display: flex; gap: 4px; }
.people-task-row {
  padding: 6px 13px; display: flex; align-items: flex-start; gap: 8px;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.people-task-row:last-of-type { border-bottom: none; }
.people-task-row:hover { background: var(--bg-hover); }
.proj-pill {
  font-size: 10px; padding: 1px 7px 1px 5px;
  border-radius: 0 4px 4px 0;
  border-left: 2px solid;
  background: var(--bg-secondary);
  color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.people-task-text { flex: 1; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.next-free-row { padding: 6px 13px; font-size: 11px; color: var(--text-muted); border-top: 1px dashed var(--border); }

.avail-panel {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 16px;
}
.avail-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.avail-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.avail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; border: 1px solid var(--border); background: #fff;
}
.avail-rank { font-weight: 700; font-size: 10px; color: var(--text-muted); }
.avail-chip.rank-1 { border-color: #86efac; background: var(--success-light); }
.avail-chip.rank-2 { border-color: #fde68a; background: var(--warning-light); }

/* ─── KANBAN VIEW ───────────────────────────────────── */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: start; }
@media (max-width: 960px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
.kanban-col { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 120px; }
.kanban-col-hd {
  padding: 8px 11px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-secondary);
}
.col-stripe { width: 3px; height: 12px; border-radius: 2px; margin-right: 6px; display: inline-block; flex-shrink: 0; }
.kanban-col-count { font-size: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1px 6px; }
.kanban-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; margin: 8px; transition: box-shadow .15s, opacity .15s, transform .15s;
  cursor: grab;
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card:active { cursor: grabbing; }
/* Card being dragged */
.kanban-card.dragging {
  opacity: 0.35;
  transform: scale(0.97);
  box-shadow: none;
}
/* Column receiving a drop */
.kanban-col.drag-over {
  background: var(--primary-light);
  border-color: var(--primary);
  outline: 2px dashed var(--primary);
  outline-offset: -3px;
}
.kanban-card-proj { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; display: flex; align-items: center; gap: 3px; }
.kanban-card-text { font-size: 12px; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 4px; }

/* ─── ACTIVITY VIEW ─────────────────────────────────── */
.activity-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.activity-list { display: flex; flex-direction: column; gap: 3px; }
.activity-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 13px; display: flex; align-items: flex-start; gap: 10px;
}
.act-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; font-weight: 500; margin-top: 1px; }
.act-create  { background: var(--success-light); color: var(--success); }
.act-update  { background: #dbeafe; color: #1e3a8a; }
.act-delete  { background: var(--danger-light); color: var(--danger); }
.act-restore { background: var(--warning-light); color: var(--warning); }
.act-login   { background: var(--success-light); color: var(--success); }
.act-login_failed { background: var(--danger-light); color: var(--danger); }
.act-logout  { background: var(--bg-secondary); color: var(--text-muted); }
.act-body { flex: 1; min-width: 0; }
.act-desc { font-size: 12px; color: var(--text); line-height: 1.4; }
.act-ts   { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.act-diff { margin-top: 4px; font-size: 11px; color: var(--text-secondary); background: var(--bg-secondary); border-radius: var(--radius-sm); padding: 4px 8px; }

/* ─── ARCHIVED VIEW ─────────────────────────────────── */
.archived-section { margin-bottom: 22px; }
.archived-section-title {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.archived-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 13px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px; opacity: .75; transition: opacity .15s;
}
.archived-item:hover { opacity: 1; }
.archived-text { flex: 1; font-size: 13px; color: var(--text-secondary); }
.archived-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ─── LEAVES VIEW ───────────────────────────────────── */
.leaves-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) { .leaves-layout { grid-template-columns: 1fr; } }

.leave-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.leave-section:last-child { margin-bottom: 0; }
.leave-section-hd {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.leave-empty {
  padding: 14px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Today chips */
.leave-today-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.leave-today-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 4px 10px 4px 4px;
  font-size: 12px; font-weight: 500;
  color: var(--warning);
}
.leave-today-chip .person-avatar {
  width: 22px; height: 22px; font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; flex-shrink: 0;
}

/* Summary table */
.leave-summary-table { padding: 4px 0; }
.leave-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.leave-summary-row:last-child { border-bottom: none; }
.leave-summary-header {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--bg);
}
.leave-summary-person { display: flex; align-items: center; gap: 7px; }
.leave-summary-person .person-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; flex-shrink: 0;
}
.leave-summary-days { font-weight: 600; color: var(--primary); }

/* Leave list rows */
.leave-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.leave-row:last-child { border-bottom: none; }
.leave-row-active { background: var(--warning-light); }
.leave-row .person-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; flex-shrink: 0;
}
.leave-row-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.leave-row-name { font-weight: 600; color: var(--text); }
.leave-row-range { color: var(--text-secondary); }
.leave-row-reason { color: var(--text-muted); font-style: italic; }
.leave-row-days {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-secondary); border-radius: 10px;
  padding: 2px 7px; white-space: nowrap;
}

/* Standup leave banner */
.standup-leave-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--warning);
}
.leave-banner-icon { font-size: 16px; }
.leave-banner-label { font-weight: 600; }

/* Workload strip leave indicators */
.wl-chip.wl-on-leave {
  opacity: 0.65;
  text-decoration: none;
  position: relative;
}
.wl-leave-tag {
  font-size: 9px; font-weight: 700;
  background: rgba(0,0,0,0.18);
  border-radius: 8px; padding: 0 5px;
  letter-spacing: .04em;
}
.wl-leave-note {
  font-size: 10px; color: var(--warning);
  font-weight: 600; margin-left: 4px; white-space: nowrap;
}

/* Header leave button — calendar-green tint to distinguish from task/project/person */
.header-leave-btn {
  background: rgba(47,158,68,0.18) !important;
  border-left: 1px solid rgba(255,255,255,0.18) !important;
  color: #d8f5e0 !important;
}
.header-leave-btn:hover { background: rgba(47,158,68,0.32) !important; color: #fff !important; }

/* ─── EMPTY STATE ───────────────────────────────────── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-icon  { font-size: 32px; margin-bottom: 8px; opacity: .5; }
.empty-text  { font-size: 14px; font-weight: 500; }
.empty-sub   { font-size: 12px; margin-top: 4px; }

/* ─── LOGIN PAGE ────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md);
}
.login-logo  { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.login-logo em { color: var(--primary); font-style: normal; }
.login-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.login-error {
  font-size: 12px; color: var(--danger); background: var(--danger-light);
  border: 1px solid #fca5a5; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 12px;
}

/* ─── HEADER QUICK-ADD ──────────────────────────────── */
.header-quick-add {
  display: flex;
  align-items: center;
  background: var(--primary);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(59,91,219,0.4);
}
.header-quick-add .btn-outline {
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.18);
  border-radius: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  white-space: nowrap;
  letter-spacing: .02em;
  transition: background .12s;
}
.header-quick-add .btn-outline:last-child {
  border-right: none;
}
.header-quick-add .btn-outline:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ─── MULTI-ASSIGNEE CHECKBOX LIST ──────────────────── */
.assignee-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  max-height: 130px;
  overflow-y: auto;
}
.assignee-check-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: border-color .12s, background .12s;
  user-select: none;
}
.assignee-check-item:hover { border-color: var(--primary); background: var(--primary-light); }
.assignee-check-item input[type="checkbox"] { display: none; }
.assignee-check-item:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── UTIL ──────────────────────────────────────────── */
.flex      { display: flex; }
.items-center { align-items: center; }
.gap-1     { gap: 4px; }
.gap-2     { gap: 8px; }
.ml-auto   { margin-left: auto; }
.mt-1      { margin-top: 4px; }
.mt-2      { margin-top: 8px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 10px; }
.font-600    { font-weight: 600; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider   { height: 1px; background: var(--border); margin: 12px 0; }
