/* ── Reset & Variables ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0: #f3f1f8;
  --bg-1: #ffffff;
  --bg-2: #ece7f5;
  --bg-3: #e0d9f0;
  --bg-4: #d0c6e8;
  --border: #e1d9f0;
  --border-2: #c4b6de;
  --text-0: #1c1a2e;
  --text-1: #3d3a54;
  --text-2: #5c5875;
  --text-3: #8a85a0;
  --accent: #4f6be0;
  --accent-dim: #dde4fa;
  --cyan: #2aa8b0;
  --cyan-dim: #cff0f2;
  --green: #38a169;
  --green-dim: #c6f6d5;
  --yellow: #b7861a;
  --yellow-dim: #fef3c7;
  --red: #d95050;
  --red-dim: #fed7d7;
  --purple: #8b6ed4;
  --font-body: 'Barlow', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-cond: 'Barlow Condensed', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --sidebar-w: 220px;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-0);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  font-size: 20px;
  color: var(--cyan);
  line-height: 1;
}

.logo-title {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--text-0);
}

.logo-sub {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 16px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover { background: var(--bg-3); color: var(--text-0); }
.nav-item.active { color: var(--cyan); background: rgba(42,168,176,0.1); }

.nav-item .nav-icon { font-size: 12px; opacity: 0.7; }

.nav-project-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
  border-left: 2px solid transparent;
}

.nav-project-item:hover { background: var(--bg-3); }
.nav-project-item.active { border-left-color: var(--cyan); background: rgba(42,168,176,0.07); }

.nav-proj-name {
  font-size: 12px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.nav-project-item.active .nav-proj-name { color: var(--text-0); }

.nav-proj-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-left: 6px;
}

.nav-btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 32px);
  margin: 8px 16px;
  padding: 6px 10px;
  background: rgba(79,107,224,0.07);
  border: 1px dashed var(--accent-dim);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}
.nav-btn-new:hover { background: rgba(79,107,224,0.13); border-color: var(--accent); }

.sidebar-footer {
  padding: 8px 0 12px;
  border-top: 1px solid var(--border);
}

/* Main */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
  background: var(--bg-0);
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* ── Page header ──────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.page-title {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--text-0);
  line-height: 1.1;
}

.page-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary.small { padding: 5px 10px; font-size: 12px; }

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text-0); border-color: var(--border-2); }
.btn-ghost.small { padding: 4px 10px; font-size: 12px; }

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: opacity var(--transition);
}
.btn-danger:hover { opacity: 0.85; }

.btn-icon {
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius);
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}
.btn-icon:hover { color: var(--text-0); background: var(--bg-4); }

/* ── Dashboard stat grid ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--accent));
  opacity: 0.5;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-cond);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

.stat-card-clickable {
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card-clickable:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}
.stat-card-hint {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* ── Deadline calendar snapshot (dashboard) ───────────────────────────── */
.deadline-calendar {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 16px;
  margin-bottom: 32px;
  align-items: start;
}
@media (max-width: 880px) {
  .deadline-calendar { grid-template-columns: 1fr; }
}

.cal-panel, .cal-upcoming {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-month-label {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-0);
}
.cal-nav-btn {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.cal-nav-btn:hover { background: var(--bg-3); color: var(--text-0); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding-bottom: 4px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  color: var(--text-1);
}
.cal-day-blank { visibility: hidden; }
.cal-day.is-today {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}
.cal-day.has-events {
  cursor: pointer;
  border: 1px solid var(--border);
}
.cal-day.has-events:hover { background: var(--bg-3); }

.cal-dots { display: flex; gap: 2px; }
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}
.cal-dot.dd     { background: var(--purple); }
.cal-dot.permit { background: var(--cyan); }
.cal-dot.ifc    { background: var(--accent); }

.cal-upcoming-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 10px;
}
.cal-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
.cal-upcoming-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-upcoming-item:hover { background: var(--bg-2); }
.cal-upcoming-item .cal-dot { width: 7px; height: 7px; flex-shrink: 0; }
.cal-upcoming-main { flex: 1; min-width: 0; }
.cal-upcoming-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-upcoming-phase {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
}
.cal-upcoming-date {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  white-space: nowrap;
}
.cal-upcoming-rel {
  font-size: 10px;
  color: var(--text-2);
}
.cal-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: 12px 4px;
}

/* ── Project cards (dashboard) ────────────────────────────────────────── */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: var(--border-2);
  background: var(--bg-2);
  transform: translateY(-1px);
}

.proj-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.proj-card-name {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-0);
  line-height: 1.2;
}

.proj-card-client {
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 12px;
}

.proj-card-progress {
  height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.proj-card-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.proj-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
}

.proj-card-pct {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--green);
  font-size: 11px;
}

/* ── Progress section ─────────────────────────────────────────────────── */
.progress-section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.progress-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-4);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  min-width: 36px;
}

.phase-pills {
  display: flex;
  gap: 8px;
}

.phase-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 64px;
}

.phase-pill-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.05em;
}

.phase-pill-count {
  font-family: var(--font-cond);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.2;
}

/* ── Proj stats row ───────────────────────────────────────────────────── */
.proj-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.pstat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pstat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pstat-value {
  font-family: var(--font-cond);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

/* ── Filters bar ──────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filters-left, .filters-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  padding: 5px 28px 5px 10px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a0aab8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition);
}
select:hover { border-color: var(--border-2); }
select:focus { outline: none; border-color: var(--accent); }

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 4px;
}

.selection-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
}

.bulk-actions { gap: 6px; flex-wrap: wrap; }
.bulk-actions select { font-size: 11px; }

/* ── Task table ───────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
  user-select: none;
}

th[onclick] { cursor: pointer; }
th[onclick]:hover { color: var(--text-0); }
th .sort-icon { opacity: 0.3; font-style: normal; }

td {
  padding: 9px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background var(--transition);
}
tbody tr:hover { background: var(--bg-2); }
tbody tr.selected { background: rgba(79,107,224,0.07); }

.col-check { width: 36px; padding-right: 4px; }
.col-task { min-width: 220px; }
.col-phase { width: 80px; }
.col-owner { width: 70px; }
.col-priority { width: 80px; }
.col-status { width: 120px; }
.col-hours { width: 60px; text-align: right; }
.col-due { width: 110px; }
.col-notes { min-width: 120px; }
.col-actions { width: 70px; text-align: right; }

.task-desc-cell {
  color: var(--text-0);
  font-size: 13px;
  line-height: 1.4;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-phase-DD    { background: rgba(139,110,212,0.12); color: var(--purple); border: 1px solid rgba(139,110,212,0.22); }
.badge-phase-PERMIT { background: rgba(42,168,176,0.1); color: var(--cyan); border: 1px solid rgba(42,168,176,0.22); }
.badge-phase-IFC   { background: rgba(79,107,224,0.1); color: var(--accent); border: 1px solid rgba(79,107,224,0.22); }

.badge-pri-High   { background: rgba(217,80,80,0.1); color: var(--red); }
.badge-pri-Normal { background: var(--bg-4); color: var(--text-2); }
.badge-pri-Low    { background: var(--bg-3); color: var(--text-3); }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}
.badge-status:hover { opacity: 0.8; }

.badge-status-ns   { background: var(--bg-4); color: var(--text-2); border: 1px solid var(--border); }
.badge-status-ip   { background: rgba(183,134,26,0.12); color: var(--yellow); border: 1px solid rgba(183,134,26,0.25); }
.badge-status-cmp  { background: rgba(56,161,105,0.1); color: var(--green); border: 1px solid rgba(56,161,105,0.22); }

.badge-status::before { content: '●'; font-size: 7px; }

.owner-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--accent-dim);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0;
}

.hours-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  color: var(--text-2);
}

.due-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

.due-date.overdue { color: var(--red); }
.due-date.soon { color: var(--yellow); }

.notes-cell {
  font-size: 12px;
  color: var(--text-2);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity var(--transition); }
tbody tr:hover .row-actions { opacity: 1; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 40px;
  color: var(--text-3);
  display: block;
}

/* ── Overdue table ────────────────────────────────────────────────────── */
.overdue-table {
  background: var(--bg-1);
  border: 1px solid rgba(217,80,80,0.22);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.overdue-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.overdue-row:hover { background: var(--bg-2); }
.overdue-row:last-child { border-bottom: none; }

.overdue-project { color: var(--text-3); font-size: 11px; min-width: 100px; }
.overdue-task { flex: 1; color: var(--text-1); }
.overdue-date { font-family: var(--font-mono); font-size: 11px; color: var(--red); }
.overdue-owner .owner-chip { width: 22px; height: 22px; font-size: 9px; }

/* ── Modals ───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-in 200ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-wide { max-width: 680px; }
.modal-sm { max-width: 360px; }
.modal-xl { max-width: 960px; width: 95vw; max-height: 85vh; }
.modal-body-scroll { max-height: 68vh; overflow-y: auto; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-4); color: var(--text-0); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-0);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  width: 100%;
  transition: border-color var(--transition);
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input[type="date"]::-webkit-calendar-picker-indicator { filter: opacity(0.5); cursor: pointer; }

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

.form-row.tight { grid-template-columns: 80px 1fr auto; align-items: end; }
.form-row .form-group.flex-grow { flex: 1; }
.form-row .form-group.self-end { align-self: end; }

.checkbox-group {}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-1);
  font-size: 13px;
  font-family: var(--font-body);
}
.checkbox-label input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }

/* ── Members list ─────────────────────────────────────────────────────── */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }

.member-initials-chip {
  width: 32px;
  height: 32px;
  background: var(--accent-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
}

.member-name { flex: 1; font-size: 13px; }
.member-initials { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

.members-add-form {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}

/* ── Scrollbars ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ── Inline edit ──────────────────────────────────────────────────────── */
.inline-edit-select {
  background: var(--bg-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-0);
  padding: 2px 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  appearance: none;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-0);
  animation: toast-in 250ms ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Checkbox ─────────────────────────────────────────────────────────── */
input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

/* ── Delete ghost button ──────────────────────────────────────────────── */
.btn-danger-ghost {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(217,80,80,0.3);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-danger-ghost:hover { background: rgba(217,80,80,0.08); border-color: var(--red); }

/* ── Phase milestone dates (project view) ─────────────────────────────── */
.milestone-dates { display: flex; align-items: center; }

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

.milestone-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 76px;
}

.milestone-item.overdue { border-color: rgba(217,80,80,0.35); background: rgba(217,80,80,0.06); }
.milestone-item.soon    { border-color: rgba(183,134,26,0.35); background: rgba(183,134,26,0.06); }

.milestone-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.milestone-date {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.3;
}

.milestone-item.overdue .milestone-date { color: var(--red); }
.milestone-item.soon    .milestone-date { color: var(--yellow); }

/* Phase pill color variants */
.phase-pill-dd     { border-color: rgba(139,110,212,0.22); }
.phase-pill-permit { border-color: rgba(42,168,176,0.22); }
.phase-pill-ifc    { border-color: rgba(79,107,224,0.22); }
.phase-pill-dd     .phase-pill-label { color: var(--purple); }
.phase-pill-permit .phase-pill-label { color: var(--cyan); }
.phase-pill-ifc    .phase-pill-label { color: var(--accent); }

/* ── Dashboard card milestone chips ───────────────────────────────────── */
.card-milestones {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.card-milestone {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid;
}

.card-milestone.dd     { color: var(--purple); background: rgba(139,110,212,0.1); border-color: rgba(139,110,212,0.2); }
.card-milestone.permit { color: var(--cyan);   background: rgba(42,168,176,0.1);  border-color: rgba(42,168,176,0.2); }
.card-milestone.ifc    { color: var(--accent); background: rgba(79,107,224,0.1);  border-color: rgba(79,107,224,0.2); }

/* ── Owner breakdown ──────────────────────────────────────────────────── */
.owner-breakdown-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.owner-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.owner-breakdown-header:hover { background: var(--bg-2); }

.breakdown-toggle {
  font-size: 11px;
  color: var(--text-2);
  transition: transform var(--transition);
}

.owner-breakdown-body { padding: 0 16px 14px; }

.owner-table { font-size: 12px; width: 100%; }

.owner-table-header {
  display: grid;
  grid-template-columns: 48px 56px 90px 90px 90px 72px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-items: center;
}

.owner-table-row {
  display: grid;
  grid-template-columns: 48px 56px 90px 90px 90px 72px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.owner-table-row:last-child { border-bottom: none; }

.owner-chip-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-dim);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
}

.owner-stat-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.owner-stat-num.ns   { color: var(--text-2); }
.owner-stat-num.ip   { color: var(--yellow); }
.owner-stat-num.done { color: var(--green); }
.owner-stat-num.total { color: var(--cyan); font-weight: 500; }

.owner-bar-col {}
.owner-bar-wrap {
  height: 8px;
  background: var(--bg-4);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.owner-bar-seg {
  height: 100%;
  transition: width 0.4s ease;
  min-width: 0;
}
.seg-done { background: var(--green); }
.seg-ip   { background: var(--yellow); }
.seg-ns   { background: var(--bg-4); }

/* ── Discipline checkboxes (project modal) ────────────────────────────── */
.discipline-grid {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.discipline-grid-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.discipline-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}

.disc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-1);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.disc-checkbox-label:hover { background: var(--bg-3); }
.disc-checkbox-label input { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Category section header rows ─────────────────────────────────────── */
.category-header-row td {
  background: var(--bg-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.cat-header-name {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-0);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 10px;
}

.cat-header-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

/* ── form-row-3 and form-row-4 ────────────────────────────────────────── */
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Scheduling view ──────────────────────────────────────────────────── */
.sched-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sched-view-toggle {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sched-toggle-btn {
  background: none;
  border: none;
  color: var(--text-2);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.sched-toggle-btn:hover  { color: var(--text-0); background: var(--bg-3); }
.sched-toggle-btn.active { color: var(--cyan); background: rgba(42,168,176,0.1); }

.sched-nav { display: flex; gap: 4px; }

.sched-legend {
  margin-bottom: 12px;
}
.sched-legend-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* Table wrapper — horizontal + vertical scroll */
.sched-table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: calc(100vh - 220px);
}

.sched-loading, .sched-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* Table */
.sched-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}

/* Sticky project column */
.sched-proj-th,
.sched-proj-td {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg-1);
  min-width: 160px;
  max-width: 200px;
}

.sched-proj-th {
  background: var(--bg-2);
  z-index: 4;
}

/* Sticky header row */
.sched-table thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Header cells */
.sched-proj-th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  border-right: 2px solid var(--border);
}

.sched-date-th {
  min-width: 88px;
  padding: 6px 8px;
  text-align: center;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
}

.sched-table.month-view .sched-date-th {
  min-width: 38px;
  padding: 4px 3px;
}

.sched-date-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sched-day-name {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sched-day-num {
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.sched-table.month-view .sched-day-num { font-size: 11px; }

/* Today column highlight */
.sched-date-th.today { background: rgba(42,168,176,0.08); border-bottom-color: var(--cyan); }
.sched-date-th.today .sched-day-name { color: var(--cyan); }
.sched-date-th.today .sched-day-num  { color: var(--cyan); }

/* Weekend dim */
.sched-date-th.weekend { background: var(--bg-1); }
.sched-date-th.weekend .sched-day-name,
.sched-date-th.weekend .sched-day-num { color: var(--text-3); }

/* Project rows */
.sched-proj-td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 2px solid var(--border);
  vertical-align: top;
}

.sched-proj-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}

.sched-proj-client {
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
  margin-top: 1px;
}

.sched-proj-milestone {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.sched-proj-milestone-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  min-width: 34px;
}
.sched-proj-dl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
}
.sched-proj-dl.overdue { color: var(--red); }
.sched-proj-dl.soon    { color: var(--yellow); }

/* Data cells */
.sched-cell {
  min-width: 88px;
  height: 52px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.sched-table.month-view .sched-cell { min-width: 38px; padding: 3px 3px; height: 46px; }

.sched-cell:hover { background: rgba(42,168,176,0.05); }
.sched-cell.today { background: rgba(42,168,176,0.04); border-right-color: rgba(42,168,176,0.18); }
.sched-cell.today:hover { background: rgba(42,168,176,0.08); }
.sched-cell.weekend { background: rgba(0,0,0,0.025); }
.sched-cell.weekend:hover { background: rgba(42,168,176,0.04); }

.sched-cell-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
}

/* Assignment chips inside cells */
.sched-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity var(--transition);
}
.sched-chip:hover { opacity: 0.75; }

.sched-chip.sm {
  width: 18px;
  height: 18px;
  font-size: 8px;
}

/* Deadline badges inside cells */
.sched-cell.has-deadline { box-shadow: inset 3px 0 0 var(--accent); }

.sched-deadline-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  white-space: nowrap;
}
.sched-deadline-dd     { background: rgba(139,110,212,0.14); color: var(--purple); border: 1px solid rgba(139,110,212,0.3); }
.sched-deadline-permit { background: rgba(42,168,176,0.12);  color: var(--cyan);   border: 1px solid rgba(42,168,176,0.3); }
.sched-deadline-ifc    { background: rgba(79,107,224,0.12);  color: var(--accent); border: 1px solid rgba(79,107,224,0.3); }

.sched-table.month-view .sched-deadline-badge { font-size: 7px; padding: 1px 3px; }

/* ── Scheduling popover ───────────────────────────────────────────────── */
.sched-popover {
  position: fixed;
  z-index: 5000;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 200px;
  animation: modal-in 150ms cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

.sched-pop-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.sched-pop-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.sched-pop-proj {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sched-pop-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 0 0 0 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
.sched-pop-close:hover { color: var(--text-0); }

.sched-pop-members {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}

.sched-pop-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 12px;
}
.sched-pop-member:hover { background: var(--bg-3); }
.sched-pop-member.active { background: rgba(79,107,224,0.08); color: var(--text-0); }
.sched-pop-member.active .owner-chip { background: var(--accent); color: #fff; }

.sched-pop-name { flex: 1; }

.sched-pop-check {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

/* ── Team sidebar items ───────────────────────────────────────────────── */
.nav-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
  border-left: 2px solid transparent;
}
.nav-member-item:hover { background: var(--bg-3); }
.nav-member-item.active { border-left-color: var(--purple); background: rgba(139,110,212,0.07); }

.nav-member-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(139,110,212,0.12);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--purple);
  flex-shrink: 0;
}

.nav-member-name {
  font-size: 12px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.nav-member-item.active .nav-member-name { color: var(--text-0); }

/* ── Employee snapshot view ───────────────────────────────────────────── */
.emp-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.emp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(139,110,212,0.12);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--purple);
  flex-shrink: 0;
  border: 1px solid rgba(139,110,212,0.22);
}

.emp-project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.emp-project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
}
.emp-project-card:hover {
  border-color: var(--border-2);
  background: var(--bg-2);
  transform: translateY(-1px);
}

.emp-proj-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.emp-proj-name {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-0);
  line-height: 1.2;
}

.emp-proj-client {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

.emp-proj-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  flex-shrink: 0;
}

.emp-proj-progress {
  height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.emp-proj-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.emp-proj-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.emp-proj-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.emp-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid;
}
.emp-badge-overdue { color: var(--red);    background: rgba(217,80,80,0.08);   border-color: rgba(217,80,80,0.22); }
.emp-badge-ip      { color: var(--yellow); background: rgba(183,134,26,0.08);  border-color: rgba(183,134,26,0.22); }
.emp-badge-ns      { color: var(--text-2); background: var(--bg-4);            border-color: var(--border); }
.emp-badge-done    { color: var(--green);  background: rgba(56,161,105,0.08);  border-color: rgba(56,161,105,0.22); }
.emp-badge-due     { color: var(--cyan);   background: rgba(42,168,176,0.08);  border-color: rgba(42,168,176,0.22); }
.emp-badge-due.overdue { color: var(--red); background: rgba(217,80,80,0.08);  border-color: rgba(217,80,80,0.22); }
.emp-badge-due.soon    { color: var(--yellow); background: rgba(183,134,26,0.08); border-color: rgba(183,134,26,0.22); }

.emp-empty {
  color: var(--text-2);
  font-size: 13px;
  padding: 20px 0;
}

/* ── Member all-tasks modal table ─────────────────────────────────────── */
.member-tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.member-tasks-table thead th {
  text-align: left;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--border);
}
.member-tasks-group-row td {
  padding: 16px 10px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.member-tasks-group-count {
  background: var(--bg-3);
  border-radius: 20px;
  padding: 0 6px;
  font-size: 10px;
  color: var(--text-2);
  margin-left: 6px;
}
.member-tasks-row {
  cursor: pointer;
  transition: background var(--transition);
}
.member-tasks-row:hover { background: var(--bg-2); }
.member-tasks-row td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.member-tasks-desc {
  max-width: 300px;
  color: var(--text-0);
}
.member-tasks-proj {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.clickable-status { cursor: pointer; }
.clickable-status:hover { opacity: 0.8; }

.member-tasks-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.member-tasks-nav-btn:hover {
  background: var(--bg-3);
  color: var(--text-0);
  border-color: var(--border-2);
}

/* ── Project tab bar ──────────────────────────────────────────────────── */
.proj-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  gap: 0;
}

.proj-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 18px;
  margin-bottom: -1px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
}

.proj-tab:hover { color: var(--text-0); }
.proj-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* ── Notes two-column layout ──────────────────────────────────────────── */
.notes-layout {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  min-height: 65vh;
}

/* ── Meetings sidebar ─────────────────────────────────────────────────── */
.notes-sidebar {
  width: 210px;
  min-width: 140px;
  max-width: 480px;
  flex-shrink: 0;
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-sidebar-resize {
  position: absolute;
  top: 0; right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
}
.notes-sidebar-resize:hover,
.notes-sidebar-resize.dragging {
  background: var(--cyan);
  opacity: 0.35;
}

.notes-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notes-sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.notes-sidebar-new-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 9px;
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.notes-sidebar-new-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.notes-meeting-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.notes-meeting-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

.notes-meeting-item {
  position: relative;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--transition);
}
.notes-meeting-item:hover { background: var(--bg-3); }
.notes-meeting-item.active {
  background: rgba(42,168,176,0.08);
  border-left-color: var(--cyan);
}

.notes-meeting-item-title {
  cursor: text;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 22px;
  margin-bottom: 2px;
  line-height: 1.3;
}
.notes-meeting-item.active .notes-meeting-item-title { color: var(--text-0); }

.notes-meeting-title-edit {
  display: block;
  width: calc(100% - 22px);
  background: var(--bg-1);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-0);
  outline: none;
  line-height: 1.3;
  margin-bottom: 2px;
  box-sizing: border-box;
}

.notes-meeting-item-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}

.notes-meeting-delete-btn {
  position: absolute;
  top: 50%; right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 10px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: all var(--transition);
  line-height: 1;
}
.notes-meeting-item:hover .notes-meeting-delete-btn { opacity: 1; }
.notes-meeting-delete-btn:hover { color: var(--red); background: rgba(217,80,80,0.1); }

/* ── Notes main area ──────────────────────────────────────────────────── */
.notes-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.notes-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-2);
  font-size: 13px;
  padding: 40px;
}

.notes-empty-icon {
  font-size: 30px;
  color: var(--text-3);
  line-height: 1;
}

#notes-editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Meeting toolbar: title input + date + save status */
.notes-meeting-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  gap: 12px;
  flex-shrink: 0;
}

.notes-meeting-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.notes-meeting-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 3px 0;
  font-family: var(--font-cond);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color var(--transition);
  width: auto;
}
.notes-meeting-title-input:focus { border-bottom-color: var(--accent); }
.notes-meeting-title-input::placeholder { color: var(--text-3); font-weight: 400; }

.notes-meeting-date-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-1);
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: border-color var(--transition);
  width: auto;
}
.notes-meeting-date-input:focus { border-color: var(--accent); }

.notes-status-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.notes-last-updated {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.notes-save-indicator {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  min-width: 50px;
  text-align: right;
  transition: color var(--transition);
}

.notes-save-indicator.saving { color: var(--yellow); }
.notes-save-indicator.saved  { color: var(--green); }
.notes-save-indicator.error  { color: var(--red); }

/* ── Meeting lock banner ──────────────────────────────────────────────── */
.notes-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  background: var(--yellow-dim);
  border-bottom: 1px solid var(--yellow);
  color: var(--yellow);
  font-size: 12px;
}

.notes-editor-panel.read-only .notes-format-bar {
  opacity: 0.4;
  pointer-events: none;
}

.notes-editor-panel.read-only .notes-editor {
  cursor: default;
  background: var(--bg-2);
}

/* ── Notes format bar ─────────────────────────────────────────────────── */
.notes-format-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  flex-wrap: wrap;
}

.notes-fmt-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

.notes-fmt-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 5px;
  flex-shrink: 0;
}

.notes-fmt-btn {
  background: none;
  border: none;
  border-radius: 5px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
}

.notes-fmt-btn b { font-size: 13px; font-weight: 700; }
.notes-fmt-btn i { font-size: 13px; font-style: italic; }
.notes-fmt-btn u { font-size: 13px; text-decoration: underline; }

.notes-fmt-btn:hover { background: var(--bg-3); color: var(--text-0); }
.notes-fmt-btn.active { background: rgba(42,168,176,0.12); color: var(--cyan); }
.notes-fmt-btn.active:hover { background: rgba(42,168,176,0.2); }

/* ── Notes editor area ────────────────────────────────────────────────── */
.notes-page-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 28px 40px 48px;
}

.notes-editor-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.notes-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0;
  color: var(--text-3);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.85;
  pointer-events: none;
  letter-spacing: 0.01em;
}

.notes-placeholder.hidden { display: none; }

.notes-editor {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-0);
  min-height: 40vh;
  outline: none;
  letter-spacing: 0.01em;
  width: 100%;
  cursor: text;
}

.notes-editor:focus { outline: none; }

/* Rich content styles rendered inside the notes editor */
.notes-editor h2 {
  font-family: var(--font-cond);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-0);
  margin: 22px 0 6px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.notes-editor h3 {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin: 18px 0 4px;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notes-editor p { margin: 0 0 2px; }

.notes-editor ul,
.notes-editor ol {
  margin: 4px 0 4px 22px;
  padding: 0;
}

.notes-editor ul { list-style-type: disc; }
.notes-editor ol { list-style-type: decimal; }

.notes-editor li { padding: 1px 0; line-height: 1.85; }

.notes-editor hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.notes-editor a { color: var(--accent); text-decoration: underline; }

/* ── Login Screen ─────────────────────────────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 44px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.login-heading {
  font-family: var(--font-cond);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}

.login-error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-info {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-submit-btn {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  margin-top: 4px;
}

.login-forgot-link {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
}
.login-forgot-link a {
  color: var(--text-2);
  text-decoration: none;
}
.login-forgot-link a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Sidebar user badge ───────────────────────────────────────────────── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color var(--transition);
}
.sidebar-logout-btn:hover { color: var(--red); }

/* ── Week schedule grid ───────────────────────────────────────────────── */
.emp-week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.emp-week-day {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 72px;
}

.emp-week-today {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.emp-week-day-label {
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
  display: flex;
  gap: 4px;
  align-items: baseline;
}

.emp-week-date {
  font-weight: 400;
  font-family: var(--font-mono);
  font-size: 10px;
}

.emp-week-entry {
  font-size: 11px;
  color: var(--text-0);
  background: var(--bg-2);
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 3px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-week-empty-day {
  color: var(--text-3);
  font-size: 12px;
}

.emp-week-empty {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: 13px;
  padding: 12px 0;
}

/* ── Admin user management ────────────────────────────────────────────── */
.admin-users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-users-hint {
  font-size: 12px;
  color: var(--text-2);
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-1);
  transition: border-color var(--transition);
}
.admin-user-row:hover { border-color: var(--border-2); }

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.admin-user-info {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-email {
  font-size: 11px;
  color: var(--text-2);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.admin-user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-initials-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--bg-3);
  color: var(--text-1);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.06em;
}

.admin-role-badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-role-badge.role-admin {
  background: var(--accent-dim);
  color: var(--accent);
}
.admin-role-badge.role-user {
  background: var(--bg-3);
  color: var(--text-2);
}

.admin-you-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-3);
  border-radius: 4px;
  padding: 1px 5px;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-empty {
  color: var(--text-2);
  font-size: 13px;
  padding: 20px 0;
  text-align: center;
}

.admin-audit-link {
  text-align: right;
  margin-top: 4px;
  font-size: 12px;
}
.admin-audit-link a {
  color: var(--text-3);
  text-decoration: none;
}
.admin-audit-link a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Activity log ──────────────────────────────────────────────────────── */
.audit-log-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.audit-log-row:last-child { border-bottom: none; }

.audit-log-time {
  flex-shrink: 0;
  width: 90px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.audit-log-text {
  color: var(--text-1);
}

.form-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 4px;
}

/* ── Private tasks ────────────────────────────────────────────────────── */
.private-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.private-tasks-empty {
  color: var(--text-3);
  font-size: 13px;
  padding: 10px 0 14px;
}

.private-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.private-task-row:hover { border-color: var(--border-2); }

.private-task-check {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

.private-task-desc {
  flex: 1;
  font-size: 13px;
  color: var(--text-0);
  outline: none;
  border-radius: 4px;
  padding: 1px 4px;
  min-width: 0;
  word-break: break-word;
}
.private-task-desc:focus {
  background: var(--bg-2);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.private-task-done .private-task-desc {
  color: var(--text-3);
  text-decoration: line-through;
}

.private-task-delete {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}
.private-task-delete:hover {
  color: var(--red);
  background: var(--red-dim);
}

.private-task-preview {
  font-size: 14px;
  color: var(--text-0);
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 8px;
  word-break: break-word;
  white-space: pre-wrap;
}

.private-task-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
}

.private-task-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-0);
  outline: none;
  transition: border-color var(--transition);
}
.private-task-input:focus { border-color: var(--accent); }

/* ── Software Licenses ───────────────────────────────────────────────── */
.license-section-desc {
  font-size: 13px;
  color: var(--text-2);
  max-width: 640px;
  margin: -6px 0 18px;
  line-height: 1.5;
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.license-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.license-card.open  { border-color: rgba(56,161,105,0.3); }
.license-card.taken { border-color: var(--border-2); }

.license-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.license-slot-label {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
}

.license-status-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 20px;
}
.license-status-badge::before { content: '●'; font-size: 7px; margin-right: 4px; }
.license-status-badge.open  { background: rgba(56,161,105,0.1);  color: var(--green); border: 1px solid rgba(56,161,105,0.25); }
.license-status-badge.taken { background: rgba(183,134,26,0.12); color: var(--yellow); border: 1px solid rgba(183,134,26,0.25); }

.license-holder {
  display: flex;
  align-items: center;
  gap: 8px;
}

.license-holder-name {
  font-size: 13px;
  color: var(--text-1);
}

.license-since {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: -4px;
}

.license-checkout-row {
  display: flex;
  gap: 8px;
}

.license-initials-select { flex: 1; min-width: 0; }

.license-action { align-self: flex-start; }
.license-checkout-row .license-action { align-self: stretch; }
