/* Vyom — PRD §8 palette, desktop-first (≥1024px) */

:root {
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --primary: #0F3460;
  --accent: #00B4D8;
  --danger: #DC2626;
  --text: #1A1A2E;
  --muted: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 1px 3px rgba(15, 52, 96, 0.08), 0 1px 2px rgba(15, 52, 96, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 52, 96, 0.18);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute must always win, even over display: flex/inline-flex rules */
[hidden] { display: none !important; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ---------- Top navigation ---------- */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  /* evolved: cosmic hairline along the bottom edge */
  background-image: linear-gradient(90deg, #00B4D8, #7C3AED 55%, transparent 85%);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: bottom left;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav .brand-wrap { display: flex; align-items: center; gap: 8px; }
.topnav .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 19px;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.topnav .brand .dot { color: var(--accent); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.topnav .brand-by {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-links { display: flex; gap: 8px; }
.nav-links a, .nav-right a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
}
.nav-links a:hover, .nav-right a:hover { background: var(--bg); color: var(--text); }
.nav-links a.active, .nav-right a.active { color: var(--primary); background: rgba(0, 180, 216, 0.10); }

/* ---------- Layout ---------- */
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-header .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #14507e 60%, #0E7490 100%); color: #fff; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(15, 52, 96, 0.28); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid transparent; }
.btn-danger:hover { background: rgba(220, 38, 38, 0.08); }
.btn-danger.confirming { background: var(--danger); color: #fff; }

/* ---------- Toggle / checkbox label ---------- */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

/* ---------- Dashboard: project cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;
}
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project-card .accent-bar { height: 5px; }
.project-card .card-body { padding: 18px 20px 16px; }
.project-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; padding-right: 30px; }
.project-card .desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 20px;
}
.project-card .meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.project-card .meta .overdue-count {
  color: var(--danger);
  font-weight: 600;
  background: rgba(220, 38, 38, 0.08);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12.5px;
}
.project-card .edit-btn {
  position: absolute;
  top: 16px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
}
.project-card .edit-btn:hover { background: var(--bg); color: var(--primary); }
.project-card.archived { opacity: 0.65; }
.archived-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 2px;
}
.project-type-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-type-tag.internal { background: #F3F4F6; color: #6B7280; }
.project-type-tag.client   { background: rgba(0, 180, 216, 0.12); color: #0891B2; }
.project-type-tag.hr       { background: rgba(124, 58, 237, 0.12); color: #7C3AED; }
.type-toggle { display: flex; gap: 12px; }
.type-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; font-weight: 500; }

.ghost-card {
  border: 2px dashed #D3DAE3;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ghost-card:hover { border-color: var(--accent); color: var(--accent); }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 80px 20px;
}
.empty-state h2 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ---------- Kanban board ---------- */
.board-wrap {
  overflow-x: auto;
  padding: 0 32px 32px;
}
.board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-height: 60vh;
}
.kanban-col {
  background: #EEF1F5;
  border-radius: var(--radius);
  width: 300px;
  min-width: 300px;
  padding: 12px;
  transition: background 0.15s ease, outline 0.15s ease;
  outline: 2px solid transparent;
}
.kanban-col.drag-over { background: #DCEEF5; outline: 2px solid var(--accent); }
.kanban-col.removed-status { background: #F3F0F0; }
.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 10px;
}
.col-header .col-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); }
.col-header .col-title .removed-note { color: var(--danger); font-weight: 600; text-transform: none; letter-spacing: 0; }
.col-header .col-count {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 0 8px;
  min-width: 24px;
  text-align: center;
}
.col-tasks { display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.add-task-btn {
  width: 100%;
  margin-top: 8px;
  background: none;
  border: 1px dashed #C3CAD5;
  color: var(--muted);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
}
.add-task-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 180, 216, 0.05); }

.task-card {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  cursor: grab;
  border: 1px solid transparent;
}
.task-card:hover { border-color: var(--accent); }
.task-card.dragging { opacity: 0.45; cursor: grabbing; }
.task-card .task-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; word-break: break-word; }
.task-card .task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.task-card .assignee { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.task-card .assignee .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar.unassigned { background: #C3CAD5; }
.due { white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 600; }
/* On kanban cards the due date reads as a soft pill */
.task-card .due {
  background: #F3F4F6;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
}
.task-card .due.overdue { background: rgba(220, 38, 38, 0.09); }
.notes-ind {
  display: inline-flex;
  vertical-align: -1px;
  margin-left: 6px;
  color: #A8B0BC;
}
.zapier-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 6px;
}

/* ---------- Tables (Team View, Settings) ---------- */
.data-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #FBFCFD;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: #F4FBFD; }
.status-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(15, 52, 96, 0.07);
  border-radius: 999px;
  padding: 2px 10px;
}
.inactive-row { opacity: 0.55; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input[type="text"], .form-group input[type="date"],
.form-group input[type="email"],
.form-group textarea, .form-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}
.form-group textarea { min-height: 90px; resize: vertical; }
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}
.form-group .invalid { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* Status tag editor */
.tag-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #fff;
}
.tag-editor .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 52, 96, 0.07);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 8px;
}
.tag-editor .tag button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  opacity: 0.6;
}
.tag-editor .tag button:hover { opacity: 1; color: var(--danger); }
.tag-editor input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 130px;
  padding: 4px;
  font-size: 13px;
}
/* Chips reorder by drag; the read-only variant shows inherited columns */
.tag-editor .tag[draggable="true"] { cursor: grab; }
.tag-editor .tag.dragging { opacity: 0.5; }
.tag-editor.readonly { background: var(--bg); border-style: dashed; }

/* Transition mapping rows (project modal): "N tasks in X → [destination]" */
#status-remap #remap-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.remap-row { display: flex; align-items: center; gap: 10px; }
.remap-row .remap-label { font-size: 13px; }
.remap-row .remap-note { color: var(--muted); font-size: 12px; }
.remap-row .remap-arrow { color: var(--muted); }
.remap-row .remap-select { max-width: 220px; flex: 1; }

/* Colour swatches */
.swatches { display: flex; gap: 8px; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}
.swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }

/* Warning box inside modals */
.warn-box {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #92400E;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 52, 96, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 20px;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-overlay.open .modal { animation: modal-in 0.16s ease; }
@keyframes modal-in {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 84vh;
  overflow-y: auto;
  padding: 24px;
}
.modal h2 { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.modal-actions .right { display: flex; gap: 10px; margin-left: auto; }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed;
  top: 74px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  animation: toast-in 0.2s ease;
}
.toast-error { background: var(--danger); }
.toast-success { background: #15803D; }
.toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
  padding: 0;
}
.toast-close:hover { opacity: 1; }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Offline banner ---------- */
#offline-banner {
  background: var(--danger);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 60;
}

/* ---------- Settings ---------- */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.settings-card h2 { font-size: 16px; margin-bottom: 16px; }
.inline-form { display: flex; gap: 10px; align-items: flex-start; }
.inline-form .form-group { margin-bottom: 0; flex: 1; }

/* Switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #C3CAD5;
  border-radius: 999px;
  transition: 0.15s;
  cursor: pointer;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }

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

/* ---------- Integration snippets ---------- */
.snippet-label {
  font-size: 13px;
  font-weight: 700;
  margin: 16px 0 6px;
  color: var(--primary);
}
.code-block {
  position: relative;
  background: #F5F7FA;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}
.code-block pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  color: var(--text);
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
}
.copy-btn:hover { color: var(--primary); border-color: var(--muted); }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 20px;
}
.filter-bar .filter-icon {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  margin-right: 2px;
}
.filter-select, .filter-search {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 36px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.filter-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
/* A filter that's actively narrowing gets the accent treatment */
.filter-select.on {
  border-color: var(--accent);
  background-color: rgba(0, 180, 216, 0.06);
  color: var(--primary);
  font-weight: 600;
}
.filter-search { min-width: 230px; cursor: text; font-weight: 400; }
.filter-select:hover, .filter-search:hover { border-color: #B9C2CE; }
.filter-select:focus, .filter-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 13.5px;
  padding: 6px 6px;
  border-radius: 6px;
}
.btn-link:hover { text-decoration: underline; }
.filter-count { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }

/* Custom date range inputs (shown when the due filter = Custom range) */
.range-inputs { display: inline-flex; align-items: center; gap: 6px; }
.range-inputs[hidden] { display: none; }
.range-inputs .filter-date {
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 36px;
  padding: 0 12px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.range-inputs .filter-date:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}
.range-inputs .range-arrow { color: var(--muted); font-size: 13px; }

/* ---------- Styled dropdowns (replace native selects) ---------- */
.dd { position: relative; display: inline-block; }
.dd-btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  padding: 9px 34px 9px 12px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.12s ease;
}
.dd-pill .dd-btn {
  border-radius: 999px;
  height: 36px;
  padding: 0 34px 0 14px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.dd-btn:hover { border-color: #B9C2CE; }
.dd.open .dd-btn, .dd-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}
.dd-btn.on {
  border-color: var(--accent);
  background-color: rgba(0, 180, 216, 0.06);
  color: var(--primary);
  font-weight: 600;
}
.dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 290px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 90;
}
.dd.open .dd-menu { display: block; animation: dd-in 0.12s ease; }
@keyframes dd-in {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
/* Field editor modal: the Type picker lists 14 kinds. The shared .modal has
   overflow-y:auto, which clips this dropdown when the modal is short. Scope an
   override to the field modal only — let the dropdown open freely and give the
   overlay the scroll instead when the modal itself is tall (formula editor). */
#field-modal.modal-overlay { overflow-y: auto; }
#field-modal .modal { overflow: visible; max-height: none; }
#field-modal .dd-menu { max-height: 60vh; }
.dd-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-size: 13.5px;
  color: var(--text);
  padding: 8px 30px 8px 12px;
  border-radius: 7px;
  white-space: nowrap;
  position: relative;
}
.dd-item:hover, .dd-item:focus-visible { background: rgba(0, 180, 216, 0.09); outline: none; }
.dd-item.selected {
  font-weight: 600;
  color: var(--primary);
}
.dd-item.selected::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 5px;
  height: 9px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-62%) rotate(45deg);
}

/* ================= Vyom v2: login, users, inbox, mentions, tags ================= */

/* Evolved brand: gradient wordmark (dot keeps its accent) */
.brand-text {
  background: linear-gradient(105deg, var(--primary) 35%, #0E7490 75%, #00B4D8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topnav .brand .dot { -webkit-text-fill-color: var(--accent); }

/* ---------- Login gate ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(0, 180, 216, 0.10), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(124, 58, 237, 0.08), transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 44px 48px 36px;
  width: 380px;
  text-align: center;
  animation: dd-in 0.25s ease;
}
.login-mark { width: 64px; height: 64px; margin-bottom: 10px; }
.login-title { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); }
.login-title .dot { color: var(--accent); }
.login-sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2px 0 26px;
}
.login-card input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15); }
.login-btn { width: 100%; margin-top: 12px; padding: 11px; font-size: 15px; }
.login-hint { color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ---------- Nav user chip ---------- */
.nav-right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.user-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.user-logout { font-size: 12.5px; }
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--primary); }

/* ---------- Inbox bell + panel ---------- */
.inbox-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
}
.inbox-bell:hover { background: var(--bg); color: var(--primary); }
.inbox-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  background: linear-gradient(135deg, #00B4D8, #7C3AED);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
#inbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 90;
}
#inbox-overlay.open { opacity: 1; pointer-events: auto; }
.inbox-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 400px;
  max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(15, 52, 96, 0.15);
  transform: translateX(100%);
  transition: transform 0.24s ease-out;
  z-index: 95;
  display: flex;
  flex-direction: column;
}
.inbox-panel.open { transform: translateX(0); }
.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}
.inbox-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.inbox-head-actions { display: flex; align-items: center; gap: 10px; }
.inbox-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}
.inbox-close:hover { background: var(--bg); color: var(--text); }
.inbox-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.inbox-tab {
  background: none;
  border: none;
  padding: 8px 12px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.inbox-tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.inbox-pane { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
.inbox-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 48px 20px; line-height: 1.7; }

.inbox-item {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}
.inbox-item:hover { background: var(--bg); }
.inbox-item.unread { background: rgba(0, 180, 216, 0.06); }
.inbox-item.unread:hover { background: rgba(0, 180, 216, 0.11); }
.inbox-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.inbox-icon-mention { color: #7C3AED; background: rgba(124, 58, 237, 0.08); border-color: rgba(124, 58, 237, 0.2); }
.inbox-icon-task_assigned { color: #0E7490; background: rgba(0, 180, 216, 0.08); border-color: rgba(0, 180, 216, 0.25); }
.inbox-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-text { font-size: 13.5px; color: var(--text); line-height: 1.45; }
.inbox-msg {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-time { font-size: 11.5px; color: var(--muted); }

.inbox-group { margin-bottom: 14px; }
.inbox-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 12px 4px;
}
.inbox-group-label.overdue { color: var(--danger); }
.inbox-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}
.inbox-task:hover { background: var(--bg); }
.inbox-task-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.inbox-task-title { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-task-meta { font-size: 12px; color: var(--muted); flex: none; }

/* ---------- @mention autocomplete ---------- */
.mention-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 5px;
  z-index: 20;
  animation: dd-in 0.12s ease;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.mention-item:hover, .mention-item:focus { background: var(--bg); outline: none; }
.mention-item .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Project tags ---------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 52, 96, 0.06);
  color: var(--primary);
  border: 1px solid rgba(15, 52, 96, 0.12);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  line-height: 1.6;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.tag-picker { display: flex; flex-direction: column; gap: 10px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; align-items: center; }
.tag-chip.picked button,
.tag-chip.managed button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  cursor: pointer;
}
.tag-chip.picked button:hover, .tag-chip.managed button:hover { color: var(--danger); }
.tag-chip.managed button.confirming { color: #fff; background: var(--danger); border-radius: 50%; width: 16px; height: 16px; }

/* ---------- Client tags (tasks.fields.client) ---------- */
.client-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 180, 216, 0.1);
  color: #0E7490;
  border: 1px solid rgba(0, 180, 216, 0.25);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 20px;
  line-height: 1.6;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card .task-client { margin: -4px 0 8px; }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip.managed { font-size: 12.5px; padding: 4px 11px; }
.tag-usage {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  border-radius: 10px;
  padding: 0 6px;
}

/* ---------- Users & access (settings) ---------- */
.you-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid rgba(0, 180, 216, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
}
.login-code-input {
  width: 110px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13.5px;
  background: transparent;
}
.login-code-input:hover { border-color: var(--border); }
.login-code-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.12); }
.access-popover {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 260px;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  z-index: 80;
  animation: dd-in 0.12s ease;
}
.access-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  cursor: pointer;
}
.access-row:hover { background: var(--bg); }
.access-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* Per-notification read/unread toggle */
.inbox-item { position: relative; }
.inbox-toggle {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 50%;
  margin-left: auto;
  align-self: flex-start;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.inbox-item:hover .inbox-toggle, .inbox-toggle:focus-visible { opacity: 1; }
.inbox-item.unread .inbox-toggle { opacity: 1; }
.inbox-toggle .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
}
.inbox-item.unread .inbox-toggle .dot { background: var(--accent); }
.inbox-toggle:hover .dot { box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18); }

/* "Show all / Show less" expander inside My Tasks groups */
.inbox-more {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  text-align: left;
  border-radius: 8px;
}
.inbox-more:hover { background: rgba(0, 180, 216, 0.07); }

/* ============ Sub-client projects (sql/08) ============ */
.subclient-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(124, 58, 237, 0.10);
  color: #7C3AED;
  white-space: nowrap;
}
h1 .subclient-tag { font-size: 12px; margin-left: 10px; }
a.subclient-tag { text-decoration: none; cursor: pointer; }
a.subclient-tag:hover { background: rgba(124, 58, 237, 0.18); }
.project-card.sub-project { border-left: 3px solid rgba(124, 58, 237, 0.35); }

/* Sub-client navigation. Two shapes from one markup:
   - board header: inline pill chips (base styles)
   - dashboard project card: stacked full-width rows (.project-card overrides) */
.sub-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.sub-list-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #7C3AED;
  margin-right: 2px;
}
.sub-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #D3DAE3;
  background: #fff;
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.sub-link:hover { border-color: #00B4D8; color: #0891B2; }
.sub-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted, #6B7280);
  white-space: nowrap;
}
.sub-edit { color: #B4BCC8; padding-left: 2px; line-height: 1; }
.sub-edit:hover { color: #0891B2; }

/* Dashboard card variant: a tidy stacked list under a divider */
.project-card .sub-list {
  display: block;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #E2E7EE;
}
.project-card .sub-list-label {
  display: block;
  margin: 0 0 4px;
}
.project-card .sub-link {
  display: flex;
  align-items: center;
  width: calc(100% + 16px);
  margin: 0 -8px;
  border: none;
  border-radius: 8px;
  background: none;
  padding: 7px 8px;
  font-size: 13px;
  text-align: left;
}
.project-card .sub-link:hover { background: rgba(0, 180, 216, 0.08); color: inherit; }
.project-card .sub-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card .sub-link .overdue-count { margin-right: 8px; }
.project-card .sub-edit { opacity: 0; transition: opacity 0.12s; }
.project-card .sub-link:hover .sub-edit { opacity: 1; }
.sub-more {
  display: block;
  width: 100%;
  border: none;
  background: none;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -8px;
  width: calc(100% + 16px);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted, #6B7280);
  text-align: left;
  cursor: pointer;
}
.sub-more:hover { background: rgba(0, 180, 216, 0.08); color: #0891B2; }

/* ---------- Board tabs (HR projects) ---------- */
.board-tabs {
  display: flex;
  gap: 4px;
  padding: 0 32px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.board-tab {
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
}
.board-tab:hover { background: var(--bg); color: var(--text); }
.board-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- HR Roles summary card ---------- */
.hr-roles-card {
  margin: 0 32px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.hr-roles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.hr-roles-header h3 { font-size: 15px; font-weight: 700; }
.hr-roles-actions { display: flex; gap: 6px; }
.hr-roles-table-scroll { overflow-x: auto; }
.hr-roles-table { width: 100%; }
.hr-roles-table th {
  position: relative;
  white-space: nowrap;
}
.hr-roles-table th .col-remove-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 14px;
  color: var(--muted);
  opacity: 0;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: opacity 0.12s;
}
.hr-roles-table th:hover .col-remove-btn { opacity: 1; }
.hr-roles-table th .col-remove-btn:hover { color: var(--danger); }
.editable-cell {
  cursor: text;
  min-width: 80px;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.12s;
}
.editable-cell:hover { background: rgba(0, 180, 216, 0.06); }
.editable-cell.editing { padding: 2px; }
.cell-edit-input {
  width: 100%;
  padding: 4px 6px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  background: var(--surface);
}
.row-actions { white-space: nowrap; }

/* ---------- SLA indicators on task cards ---------- */
.task-card.sla-warning {
  border-left: 3px solid #F59E0B;
}
.task-card.sla-breach {
  border-left: 3px solid var(--danger);
  background: rgba(220, 38, 38, 0.04);
}

/* ---------- Feature toggles (project modal) ---------- */
.feature-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.feature-toggles .toggle-label {
  font-size: 13.5px;
}

/* ---------- Table projects: grid, sidebar, record panel (table.html) ---------- */
.tbl-page { display: flex; height: calc(100vh - 64px); }
.tbl-sidebar { width: 230px; min-width: 230px; border-right: 1px solid var(--border, #E2E8F0); padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--panel, #fff); overflow-y: auto; }
.tbl-project-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tbl-project-head h1 { font-size: 17px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-back { text-decoration: none; font-size: 18px; color: var(--muted, #64748B); }
.tbl-tables { display: flex; flex-direction: column; gap: 2px; }
.tbl-table-item { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; }
.tbl-table-item:hover { background: var(--hover, #F1F5F9); }
.tbl-table-item.active { background: var(--accent-soft, #E0F2FE); font-weight: 600; }
.tbl-table-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-table-edit { opacity: 0; font-size: 12px; }
.tbl-table-item:hover .tbl-table-edit { opacity: .7; }
.tbl-add-table { margin-top: 8px; }
.tbl-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tbl-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border, #E2E8F0); flex-wrap: wrap; }
.tbl-toolbar .btn { padding: 6px 10px; font-size: 13px; }
.tbl-count { font-size: 12px; color: var(--muted, #64748B); }
.tbl-filterbar { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border, #E2E8F0); flex-wrap: wrap; }
.tbl-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft, #E0F2FE); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.tbl-chip button { border: none; background: none; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.tbl-grid-wrap { flex: 1; overflow: auto; position: relative; }
.tbl-grid { display: inline-block; min-width: 100%; font-size: 13px; }
.tbl-row { display: flex; height: 34px; border-bottom: 1px solid var(--border, #EDF2F7); background: #fff; position: relative; width: max-content; min-width: 100%; }
.tbl-body { width: max-content; min-width: 100%; position: relative; }
.tbl-body .tbl-row { position: absolute; }
.tbl-row.tbl-head { position: sticky; top: 0; z-index: 5; background: var(--panel, #F8FAFC); font-weight: 600; height: 36px; border-bottom: 2px solid var(--border, #E2E8F0); }
.tbl-cell { flex: 0 0 auto; padding: 0 8px; display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; border-right: 1px solid var(--border, #F1F5F9); }
.tbl-cell.computed { background: #FAFBFF; color: #475569; font-style: italic; }
.tbl-head .tbl-cell.computed { font-style: normal; }
.tbl-rowhead { width: 64px; min-width: 64px; justify-content: space-between; color: var(--muted, #94A3B8); font-size: 11px; position: sticky; left: 0; background: inherit; z-index: 2; }
.tbl-expand { border: none; background: none; cursor: pointer; opacity: 0; font-size: 13px; }
.tbl-row:hover .tbl-expand { opacity: .8; }
.tbl-col-head { position: relative; user-select: none; }
.tbl-col-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tbl-col-edit { border: none; background: none; cursor: pointer; opacity: 0; font-size: 12px; }
.tbl-col-head:hover .tbl-col-edit { opacity: .7; }
.tbl-col-resize { position: absolute; right: -3px; top: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.tbl-col-add { width: 44px; min-width: 44px; justify-content: center; cursor: pointer; color: var(--muted, #64748B); font-size: 17px; }
.tbl-col-add:hover { background: var(--hover, #F1F5F9); }
.tbl-add-row { display: block; border: none; background: none; cursor: pointer; padding: 9px 14px; color: var(--muted, #64748B); font: inherit; font-size: 13px; text-align: left; width: 100%; }
.tbl-add-row:hover { background: var(--hover, #F1F5F9); }
.tbl-editor { width: 100%; border: 2px solid var(--accent, #00B4D8); border-radius: 4px; padding: 4px 6px; font: inherit; font-size: 13px; }
.tbl-selchip, .tbl-linkchip { background: var(--accent-soft, #E0F2FE); border-radius: 999px; padding: 2px 8px; font-size: 12px; white-space: nowrap; }
.tbl-linkchip { background: #EDE9FE; }
.tbl-blank { opacity: .35; }
.tbl-filechip { font-size: 13px; }
.tbl-thumb { width: 22px; height: 22px; border-radius: 4px; background: #CBD5E1; display: inline-block; }
.tbl-popover { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--border, #E2E8F0); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .15); padding: 10px; min-width: 240px; max-width: 320px; }
.tbl-popover .dd-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.tbl-popover .dd-item:hover { background: var(--hover, #F1F5F9); }
.tbl-popover .dd-item.danger { color: #DC2626; }
.tbl-popover .dd-item.danger:hover { background: #FEF2F2; }
.tbl-lp-list { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.fx-ok { color: #15803D !important; }
.fx-bad { color: #DC2626 !important; }
/* formula editor help (js/fields.js) */
.fx-help { margin-top: 10px; font-size: 12.5px; }
.fx-help > summary { cursor: pointer; color: var(--primary, #1F6FEB); user-select: none; }
.fx-help-body { margin-top: 8px; line-height: 1.55; color: var(--text-muted, #475569); }
.fx-help-body p { margin: 8px 0 4px; }
.fx-help-body code { background: var(--hover, #F1F5F9); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.fx-chip { border: 1px solid var(--border, #E2E8F0); background: var(--surface, #fff); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.fx-chip:hover { background: var(--hover, #F1F5F9); }
.fx-examples { margin: 4px 0 6px 0; padding-left: 18px; }
.fx-examples li { margin: 3px 0; }

/* record slide-over panel — full-width on phones (the mobile answer) */
.tbl-panel-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 50; }
.tbl-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; background: #fff; box-shadow: -12px 0 40px rgba(15, 23, 42, .18); display: flex; flex-direction: column; }
.tbl-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border, #E2E8F0); }
.tbl-panel-head h2 { margin: 0; font-size: 17px; }
.tbl-panel-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.tbl-panel-fields .form-group { margin-bottom: 10px; }
.tbl-panel-value { min-height: 32px; border: 1px solid var(--border, #E2E8F0); border-radius: 8px; padding: 6px 8px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tbl-panel-value.computed { background: #FAFBFF; cursor: default; }
.tbl-ro-tag { font-size: 10px; background: #EDE9FE; border-radius: 6px; padding: 1px 6px; font-weight: 500; }
.tbl-panel-section { margin-top: 18px; }
.tbl-panel-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748B); margin: 0 0 8px; }
.tbl-file-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.tbl-file-img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.tbl-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tbl-audit-row { font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--border, #EDF2F7); }
.tbl-audit-when { color: var(--muted, #94A3B8); margin-left: 6px; font-size: 11px; }
.project-type-tag.table { background: #EDE9FE; color: #6D28D9; }

@media (max-width: 760px) {
  .tbl-page { flex-direction: column; height: auto; }
  .tbl-sidebar { width: auto; min-width: 0; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border, #E2E8F0); }
  .tbl-tables { flex-direction: row; }
  .tbl-panel { width: 100vw; }
  .tbl-grid-wrap { max-height: 70vh; }
}
