/* ============ Design tokens ============ */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #ef4444;
  --success: #16a34a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --font: "Huninn", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
.text-muted { color: var(--text-muted); }
.text-muted.small { font-size: 12px; }

/* ============ Buttons ============ */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  transition: background .12s ease, opacity .12s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f9fafb; }
.btn-primary.small, .btn-secondary.small { padding: 5px 10px; font-size: 13px; }

.icon-btn {
  background: none; border: none; font-size: 16px; padding: 6px;
  border-radius: var(--radius-sm); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.icon-btn:hover { background: #f1f5f9; }
.icon-btn.small { font-size: 14px; padding: 4px; }

/* ============ Login screen ============ */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 60%);
}
.login-box {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md);
  padding: 40px; width: 420px; max-width: 90vw; text-align: center;
}
.login-logo {
  width: 56px; height: 56px; border-radius: 14px; background: var(--primary); color: #fff;
  font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; overflow: hidden;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-box h1 { margin: 0 0 4px; font-size: 22px; }
.login-sub { margin: 0; color: var(--text-muted); }
.login-divider { height: 1px; background: var(--border); margin: 20px 0; }
.btn-google-signin {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text);
}
.btn-google-signin:hover { background: #f9fafb; border-color: var(--primary); }
.google-icon {
  width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.login-loading { font-size: 13px; color: var(--text-muted); margin-top: 14px; }
.login-denied { color: var(--danger); font-size: 13px; margin-top: 14px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #dbeafe; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* ============ App shell / Header ============ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 20px;
  position: sticky; top: 0; z-index: 20;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.org-logo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden;
}
.org-logo img { width: 100%; height: 100%; object-fit: cover; }
.org-name { font-weight: 700; font-size: 15px; }

.header-nav { display: flex; gap: 4px; }
.nav-link {
  background: none; border: none; padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500;
}
.nav-link:hover { background: #f1f5f9; }
.nav-link.active { background: #eff6ff; color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 10px; position: relative; }
.notif-badge {
  position: absolute; top: 2px; inset-inline-end: 2px; background: var(--danger); color: #fff;
  font-size: 10px; border-radius: 999px; padding: 1px 5px; min-width: 15px; text-align: center; line-height: 1.4;
}
.user-menu-wrap { position: relative; }
.notif-wrap { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  padding: 4px 8px; border-radius: var(--radius-sm); font-weight: 500;
}
.user-menu-btn:hover { background: #f1f5f9; }

/* ============ Dropdown panels ============ */
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 260px; max-width: 340px; z-index: 50; padding: 10px;
}
.dropdown-panel-title { font-weight: 700; font-size: 13px; padding: 4px 6px 8px; }
.dropdown-item {
  display: block; width: 100%; text-align: start; background: none; border: none; padding: 8px;
  border-radius: var(--radius-sm); font-size: 14px;
}
.dropdown-item:hover { background: #f1f5f9; }
.user-menu-info { padding: 6px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-name { font-weight: 600; }
.user-menu-role { font-size: 12px; color: var(--text-muted); }

.notif-panel { max-height: 420px; overflow-y: auto; width: 340px; }
.notif-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.notif-item { padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { background: #eff6ff; }
.notif-message { font-size: 13px; }
.notif-time { font-size: 11px; margin-top: 2px; }

.presets-panel { max-height: 460px; overflow-y: auto; width: 300px; }

/* ============ Main content / page ============ */
.main-content { flex: 1; padding: 24px 28px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-title-block { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-title-block h1 { margin: 0; font-size: 22px; }
.page-subtitle { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; }

.view-toggle { display: inline-flex; background: #eef0f3; border-radius: var(--radius-sm); padding: 3px; }
.view-toggle-btn { background: none; border: none; padding: 6px 16px; border-radius: 5px; font-weight: 500; color: var(--text-muted); }
.view-toggle-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============ Summary cards ============ */
.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; text-align: start; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-sm);
}
.summary-card:hover { border-color: var(--primary); }
.summary-value { font-size: 26px; font-weight: 700; }
.summary-label { color: var(--text-muted); font-size: 13px; }

/* ============ Controls bar ============ */
.controls-bar {
  background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fa 100%); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.controls-row { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.controls-row-filters { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.control-block { display: flex; flex-direction: column; gap: 4px; position: relative; }
.control-block > label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

.pill-select {
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text); min-height: 32px;
}
.sort-by-row { display: flex; gap: 8px; }
.sort-dir-select { min-width: 90px; }
.search-block .pill-select { min-width: 220px; }

.filters-block { flex: 1; min-width: 300px; }
.filter-pills-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text);
  min-height: 32px; white-space: nowrap;
}
.filter-pill:hover { border-color: var(--primary); }
.filter-pill.active { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.filter-pill-wrap { position: relative; }
.checkbox-pill { cursor: pointer; }
.checkbox-pill input { margin: 0; }
.pill-badge {
  display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff;
  font-size: 11px; border-radius: 999px; min-width: 17px; height: 17px; padding: 0 4px;
}
.filter-pill.active .pill-badge { background: var(--primary); color: #fff; }
.field-filter-panel { top: calc(100% + 8px); inset-inline-start: 0; inset-inline-end: auto; width: 240px; }

.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.checkbox-label.small { font-size: 12px; }
.presets-group { position: relative; }

/* ============ Filter chips ============ */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #eff6ff; color: var(--primary);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; border: none;
}
.filter-chip-clear { background: #fee2e2; color: var(--danger); font-weight: 600; }
.chip-remove { background: none; border: none; color: inherit; font-size: 11px; padding: 0; }

/* ============ Chips (status/priority/workplan) ============ */
.chip {
  --chip-color: #94a3b8;
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--chip-color) 15%, white); color: color-mix(in srgb, var(--chip-color) 70%, black);
}

/* ============ Filter / preset panel bodies ============ */
.filter-options { display: flex; flex-direction: column; gap: 4px; }
.filter-option { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.preset-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.preset-row { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); }
.preset-row.active { background: #eff6ff; }
.preset-load-btn { flex: 1; text-align: start; background: none; border: none; padding: 8px; font-size: 13px; border-radius: var(--radius-sm); }
.preset-load-btn:hover { background: #f1f5f9; }
.preset-save-row { border-top: 1px solid var(--border); padding-top: 8px; }
.radio-row { display: flex; align-items: center; gap: 8px; padding: 8px; font-size: 14px; }
.radio-list { display: flex; flex-direction: column; }

/* ============ Table view ============ */
.view-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tasks-table, .clients-table { width: 100%; border-collapse: collapse; }
.tasks-table th, .clients-table th {
  text-align: start; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafafa;
}
.tasks-table td, .clients-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tasks-table tr:last-child td, .clients-table tr:last-child td { border-bottom: none; }
.tasks-table tbody tr:hover, .clients-table tbody tr:hover { background: #fafbfc; }
.col-view { width: 34px; }
.col-actions { white-space: nowrap; width: 90px; }
.task-name-cell .task-name-link { cursor: pointer; font-weight: 500; }
.task-name-cell .task-name-link:hover { color: var(--primary); text-decoration: underline; }

.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--text); }
.th-sortable.active-sort { color: var(--primary); }
.sort-arrow { display: inline-block; margin-inline-start: 4px; font-size: 11px; }

.group-header-row td { background: #f8fafc; padding: 8px 14px; }
.group-toggle { display: flex; align-items: center; gap: 8px; background: none; border: none; width: 100%; text-align: start; font-weight: 600; }
.group-caret { width: 12px; color: var(--text-muted); }
.group-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.group-count { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.editable-cell { cursor: pointer; }
.editable-cell:hover { background: #f8fafc; }
.editable-cell.editing { background: #fffbeb; }
.editable-cell.saving { opacity: .6; }
.cell-edit-wrap { display: flex; align-items: center; gap: 4px; }
.cell-edit-input { border: 1px solid var(--primary); border-radius: 5px; padding: 4px 6px; font-size: 13px; max-width: 150px; }
.cell-edit-confirm, .cell-edit-cancel { border: none; background: none; padding: 2px 4px; font-size: 13px; border-radius: 4px; }
.cell-edit-confirm { color: var(--success); }
.cell-edit-cancel { color: var(--danger); }
.cell-edit-confirm:hover, .cell-edit-cancel:hover { background: #f1f5f9; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state p { margin-bottom: 12px; }
.empty-state-inline { text-align: center; color: var(--text-muted); padding: 20px; font-size: 13px; }

/* ============ Kanban view ============ */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding: 4px; background: transparent; border: none; }
.view-container:has(#kanban-board) { background: transparent; border: none; }
.kanban-column {
  background: #f1f5f9; border-radius: var(--radius); min-width: 270px; max-width: 270px;
  display: flex; flex-direction: column; max-height: calc(100vh - 320px);
}
.kanban-column-header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-weight: 600; font-size: 13px; }
.kanban-column-name { flex: 1; }
.kanban-column-body { flex: 1; overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-column-body.drag-over { background: #e2e8f0; border-radius: var(--radius-sm); }

.kanban-card {
  --card-color: #94a3b8;
  background: color-mix(in srgb, var(--card-color) 20%, white);
  border-inline-start: 5px solid var(--card-color);
  border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .4; }
.kanban-card-client { font-size: 11px; color: color-mix(in srgb, var(--card-color) 75%, black); font-weight: 700; text-transform: uppercase; }
.kanban-card-title { font-weight: 600; font-size: 13.5px; }
.kanban-card-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kanban-card-footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============ Modals ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-box { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-md); width: 100%; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-md { max-width: 620px; }
.modal-lg { max-width: 780px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 22px 0; }
.modal-header-actions { display: flex; gap: 8px; align-items: center; }
.modal-client-name { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.modal-task-name { font-size: 19px; font-weight: 700; }
.modal-chips { display: flex; gap: 8px; padding: 10px 22px 0; }
.modal-tabs { display: flex; gap: 4px; padding: 14px 22px 0; border-bottom: 1px solid var(--border); }
.modal-tab { background: none; border: none; padding: 10px 6px; margin-inline-end: 16px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; }
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.modal-tab-content { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.modal-footer.inline-footer { border-top: none; padding: 14px 0 0; }

.details-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.detail-field label { display: block; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 3px; }
.detail-section { margin-bottom: 14px; }
.detail-section-title { font-size: 12px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.detail-brief { white-space: pre-wrap; background: #f8fafc; padding: 12px; border-radius: var(--radius-sm); font-size: 13.5px; }
.detail-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; flex-wrap: wrap; gap: 4px; }
.detail-link-static { font-size: 13px; color: var(--text-muted); align-self: center; }
.link-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn {
  display: inline-block; padding: 5px 10px; border-radius: var(--radius-sm); background: #eff6ff; color: var(--primary);
  font-size: 12.5px; font-weight: 500;
}
.link-btn:hover { background: #dbeafe; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; resize: vertical;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }

.team-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.team-pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; background: var(--surface); user-select: none;
}
.team-pill:hover { border-color: var(--primary); }
.team-pill:has(input:checked) { background: #eff6ff; border-color: var(--primary); color: var(--primary); font-weight: 600; }
.team-pill input { margin: 0; }

/* ---- Updates tab ---- */
.update-compose { position: relative; margin-bottom: 16px; }
.update-compose textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; resize: vertical; }
.update-compose-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.mention-dropdown {
  position: absolute; top: 100%; inset-inline-start: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); width: 220px; max-height: 160px; overflow-y: auto; margin-top: 4px;
  z-index: 10;
}
.mention-option { padding: 8px 10px; font-size: 13px; }
.mention-option:hover { background: #f1f5f9; }
.updates-list { display: flex; flex-direction: column; gap: 12px; }
.update-item { display: flex; gap: 10px; }
.update-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #dbeafe; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 13px;
}
.update-body { flex: 1; }
.update-meta { font-size: 13px; margin-bottom: 3px; }
.update-content { font-size: 13.5px; background: #f8fafc; padding: 8px 10px; border-radius: var(--radius-sm); }

/* ---- Activity tab ---- */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.activity-icon { font-size: 15px; }
.activity-desc { font-size: 13.5px; }
.activity-time { font-size: 11.5px; margin-top: 2px; }

/* ============ Clients page ============ */
.logo-row { display: flex; align-items: center; gap: 10px; }

/* ============ Settings page ============ */
.settings-layout { display: flex; gap: 20px; align-items: flex-start; }
.settings-tabs { display: flex; flex-direction: column; gap: 2px; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.settings-tab { text-align: start; background: none; border: none; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text); }
.settings-tab:hover { background: #f1f5f9; }
.settings-tab.active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.settings-content { flex: 1; min-width: 0; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.settings-card-header { margin-bottom: 12px; }
.settings-card-title { font-weight: 700; font-size: 15px; margin-bottom: 14px; }

.add-user-form { background: #f8fafc; border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }

.dropdown-value-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.dropdown-value-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f8fafc; border-radius: var(--radius-sm);
}
.dropdown-value-row.dragging { opacity: .4; }
.drag-handle { cursor: grab; color: var(--text-muted); }
.dv-name-input { flex: 1; border: 1px solid transparent; background: none; padding: 5px 6px; border-radius: 4px; }
.dv-name-input:hover, .dv-name-input:focus { border-color: var(--border); background: var(--surface); }
.dv-color-input { width: 34px; height: 28px; padding: 0; border: none; background: none; }
.add-dv-row { display: flex; gap: 8px; align-items: center; }
.add-dv-row input[type=text] { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; }
.add-dv-row input[type=color] { width: 34px; height: 32px; padding: 0; border: none; }

/* ============ Toasts ============ */
.toast-container { position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13.5px;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: #991b1b; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { flex-direction: column; }
  .settings-tabs { flex-direction: row; flex-wrap: wrap; min-width: 0; width: 100%; }
  .view-container { overflow-x: auto; }
  .tasks-table, .clients-table { min-width: 760px; }
}

@media (max-width: 640px) {
  .main-content { padding: 16px; }
  .app-header { padding: 0 12px; }
  .header-nav { position: fixed; bottom: 0; inset-inline-start: 0; inset-inline-end: 0; background: var(--surface);
    border-top: 1px solid var(--border); justify-content: space-around; padding: 6px; z-index: 30; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .controls-bar { flex-direction: column; align-items: stretch; }
  .form-grid { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr; }
  .modal-box { max-height: 100vh; height: 100%; border-radius: 0; }
  .modal-backdrop { padding: 0; }
  .kanban-column { min-width: 240px; }
}
