
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #f0efe9;
  --border: #dddcd6;
  --border2: #c8c7c0;
  --accent: #1a472a;
  --accent-light: #2d6a42;
  --accent-bg: #e8f0ea;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --muted: #6b6b5e;
  --text: #1c1c17;
  --header-bg: #1a472a;
  --header-text: #ffffff;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Manrope', sans-serif;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── HEADER ─────────────────────────────────────────── */
header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.header-brand h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.header-brand span {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.6;
  font-weight: 400;
  margin-left: 4px;
}

.header-stats {
  display: flex;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.8;
}

.header-stat { display: flex; flex-direction: column; align-items: flex-end; }
.header-stat-val { font-size: 18px; font-weight: 700; opacity: 1; line-height: 1.1; font-family: var(--sans); }

/* ─── LAYOUT ──────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 60px);
}

/* ─── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-section-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  background: var(--surface2);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon { font-size: 32px; margin-bottom: 10px; display: block; }

.drop-zone h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.drop-zone p {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

/* Queue */
.queue { display: flex; flex-direction: column; gap: 6px; }

.queue-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s;
}

.queue-item.processing { border-color: #3b82f6; background: #eff6ff; }
.queue-item.done { border-color: #16a34a; background: #f0fdf4; }
.queue-item.error { border-color: var(--danger); background: var(--danger-bg); }

.queue-icon { font-size: 16px; flex-shrink: 0; }

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

.queue-name {
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 500;
}

.queue-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sidebar actions */
.sidebar-actions { display: flex; flex-direction: column; gap: 8px; }

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-primary:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  width: 100%;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm {
  font-size: 11px;
  padding: 6px 11px;
  border-radius: 6px;
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fca5a5;
}
.btn-danger-outline:hover { background: var(--danger-bg); }

.btn-gcal {
  background: #1a73e8;
  color: white;
}
.btn-gcal:hover { background: #1557b0; }

.btn-ics {
  background: #6d28d9;
  color: white;
}
.btn-ics:hover { background: #5b21b6; }

/* Deadline legend */
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-red { background: #dc2626; }
.dot-yellow { background: #d97706; }
.dot-green { background: #16a34a; }
.dot-gray { background: #9ca3af; }

/* ─── MAIN CONTENT ────────────────────────────────────── */
.main {
  padding: 28px 32px;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--muted);
  gap: 12px;
}

.empty-state-icon { font-size: 64px; opacity: 0.3; }
.empty-state h2 { font-size: 20px; font-weight: 700; color: var(--text); opacity: 0.4; }
.empty-state p { font-family: var(--mono); font-size: 12px; max-width: 320px; }

/* Results header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.results-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-badge {
  background: var(--accent);
  color: white;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

.results-bulk { display: flex; gap: 8px; }

/* ─── CASE CARDS ──────────────────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 14px; }

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}

.case-card:hover { box-shadow: var(--shadow-md); }

.case-card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.case-card-header:hover { background: var(--surface2); }
.case-card.expanded .case-card-header { border-bottom-color: var(--border); }

.deadline-strip {
  width: 4px;
  height: 44px;
  border-radius: 2px;
  flex-shrink: 0;
}

.strip-red { background: #dc2626; }
.strip-yellow { background: #d97706; }
.strip-green { background: #16a34a; }
.strip-gray { background: #9ca3af; }

.case-eh {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface2);
  color: var(--accent);
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

.case-main { flex: 1; min-width: 0; }

.case-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.case-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.deadline-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.pill-red { background: var(--danger-bg); color: var(--danger); }
.pill-yellow { background: var(--warn-bg); color: var(--warn); }
.pill-green { background: #dcfce7; color: #15803d; }
.pill-gray { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.expand-icon {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
}
.case-card.expanded .expand-icon { transform: rotate(180deg); }

/* ─── CARD BODY ───────────────────────────────────────── */
.case-card-body { padding: 20px; display: none; }
.case-card.expanded .case-card-body { display: block; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.field-group { display: flex; flex-direction: column; gap: 4px; }

.field-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.field-value input, .field-value textarea, .field-value select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  resize: vertical;
}

.field-value input:focus, .field-value textarea:focus, .field-value select:focus {
  border-color: var(--accent);
  background: white;
}

.field-full { grid-column: 1 / -1; }

/* Required items */
.items-section { margin-bottom: 18px; }

.items-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}

.item-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: flex-start;
}

.item-bullet {
  margin-top: 8px;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.item-row textarea {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
  resize: none;
  overflow: hidden;
  min-height: 34px;
  transition: border-color 0.15s;
  line-height: 1.4;
}

.item-row textarea:focus { border-color: var(--accent); background: white; }

.item-del {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 15px;
  padding: 6px 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.item-del:hover { color: var(--danger); }

.add-item-btn {
  background: none;
  border: 1px dashed var(--border2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.add-item-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Card actions */
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ─── TOAST ───────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text);
  color: white;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease;
  box-shadow: var(--shadow-md);
  max-width: 340px;
}
.toast.success { background: #15803d; }
.toast.error { background: var(--danger); }
.toast.info { background: #1d4ed8; }

@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Progress */
.progress-wrap { margin-top: 8px; }
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}
.progress-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
}

/* ICS export log */
.export-summary {
  background: var(--accent-bg);
  border: 1px solid #bbdfc8;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 16px;
  display: none;
}

/* ─── DASHBOARD TABLE ─────────────────────────────────── */
.view-toggle { display: flex; gap: 4px; }
.view-toggle .btn-sm { padding: 5px 11px; }

.dash-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.dash-filter-bar input[type="text"] {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 200px;
}
.dash-filter-bar input[type="text"]:focus { border-color: var(--accent); }
.dash-filter-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.dash-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-table th {
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.dash-table th:hover { color: var(--accent); }
.dash-table th.sort-asc::after { content: ' ↑'; color: var(--accent); }
.dash-table th.sort-desc::after { content: ' ↓'; color: var(--accent); }
.dash-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--surface2); }
.dash-strip-cell { width: 4px; padding: 0 2px !important; }
.dash-strip-bar { width: 4px; height: 30px; border-radius: 2px; }

/* ─── RESTORE BANNER ──────────────────────────────────── */
.restore-banner {
  background: var(--accent-bg);
  border: 1px solid #bbdfc8;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.restore-banner-btns { display: flex; gap: 8px; }
.restore-banner .btn { font-size: 11px; padding: 5px 10px; width: auto; }

/* ─── CHECKBOX / ITEM DONE ───────────────────────────── */
.item-check {
  margin-top: 9px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}
.item-done .item-check { accent-color: #0d9488; }
.item-done textarea    { color: #0d9488 !important; background: #f0fdfa !important; }

.strip-done { background: #0d9488; }
.pill-done  { background: #ccfbf1; color: #0f766e; font-weight: 600; }

/* ─── CARD FILTER BAR ─────────────────────────────────── */
.card-filter-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-filter-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.card-filter-bar .btn-sm { border-radius: 20px; }
.card-filter-bar .active { background: var(--accent); color: white; }
.card-filter-bar select.btn-sm { cursor: pointer; padding: 4px 8px; }

/* ─── NOTES LOG ───────────────────────────────────────── */
.notes-section { margin-top: 4px; }
.notes-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.note-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
}
.note-ts { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.note-text { flex: 1; color: var(--text); word-break: break-word; }
.note-del { background:none; border:none; color:#d1d5db; cursor:pointer;
  font-size:13px; padding:0 2px; transition:color .15s; flex-shrink:0; }
.note-del:hover { color: var(--danger); }
.note-add-row { display: flex; gap: 6px; }
.note-add-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
}
.note-add-row input:focus { border-color: var(--accent); background: white; }
.note-add-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.note-add-btn:hover { background: var(--accent-bg); }

/* ─── CALENDAR ────────────────────────────────────────── */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  min-width: 160px;
}
.cal-view-tabs { display: flex; gap: 4px; }

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day-header {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 6px 0 4px;
}
.cal-day-cell {
  min-height: 76px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s;
  overflow: hidden;
}
.cal-day-cell:hover { border-color: var(--accent-light); }
.cal-day-cell.today { border-color: var(--accent); background: var(--accent-bg); }
.cal-day-cell.other-month { opacity: 0.38; }
.cal-day-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
  font-weight: 500;
}
.cal-today-num { color: var(--accent); font-weight: 700; }
.cal-chip {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.cal-more {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  padding: 1px 2px;
}
.cal-chip-mid {
  background: #ccfbf120 !important;
  color: #0d9488 !important;
  border: 1px solid #0d948860 !important;
  font-style: italic;
}
.cal-chip-todo {
  background: #ede9fe30 !important;
  color: #7c3aed !important;
  border: 1px solid #7c3aed60 !important;
}
.cal-week-mid { border-left-color: #0d9488 !important; background: #ccfbf110; }
.cal-week-todo { border-left-color: #7c3aed !important; background: #ede9fe10; }

.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-week-col {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}
.cal-week-col.today { border-color: var(--accent); }
.cal-week-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--surface2);
}
.cal-week-day-num { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-week-cases { padding: 4px; display: flex; flex-direction: column; gap: 4px; min-height: 60px; }
.cal-week-case {
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--surface2);
  cursor: pointer;
  transition: background .15s;
}
.cal-week-case:hover { background: var(--accent-bg); }

.cal-day-list { display: flex; flex-direction: column; gap: 10px; }
.cal-day-case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.cal-day-case:hover { box-shadow: var(--shadow-md); }
.cal-day-case-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }

/* ─── PRINT ───────────────────────────────────────────── */
@media print {
  .sidebar, header .header-stats, .card-actions, .add-item-btn,
  .item-del, .note-del, .note-add-row, .btn, .toast-wrap,
  .pdf-modal-overlay, .results-bulk, .card-filter-bar { display: none !important; }
  header { position: static; box-shadow: none; }
  .layout { grid-template-columns: 1fr; }
  .case-card-body { display: block !important; }
  .case-card { break-inside: avoid; margin-bottom: 12px; box-shadow: none; border: 1px solid #ccc; }
  body { font-size: 11px; }
  @page { margin: 1.5cm; size: A4 landscape; }
}

/* ─── NOTIFICATION BTN ────────────────────────────────── */
.btn-notif {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  width: 100%;
}
.btn-notif:hover { border-color: #7c3aed; color: #7c3aed; }
.btn-notif.granted { border-color: #16a34a; color: #15803d; background: #f0fdf4; }

/* ─── HAMBURGER GOMB + SIDEBAR DRAWER ────────────────────── */
.btn-menu-toggle {
  display: none;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--header-text);
  width: 40px; height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
  transition: background .15s;
  line-height: 1;
}
.btn-menu-toggle:hover { background: rgba(255,255,255,0.28); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 10px; right: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all .15s;
  z-index: 1;
  flex-shrink: 0;
}
.sidebar-close-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* ─── RESPONSIVE (768px) ──────────────────────────────────── */
@media (max-width: 768px) {
  .btn-menu-toggle { display: flex; }
  .sidebar-close-btn { display: flex; }

  header { padding: 0 14px; height: 54px; }
  .header-brand h1 { font-size: 13px; }
  .header-brand span { display: none; }
  .header-stats { display: none; }

  .layout { grid-template-columns: 1fr; }

  /* Sidebar drawer */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: min(310px, 88vw);
    height: 100dvh;
    z-index: 200;
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.25);
    padding-top: 54px;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: 16px 14px; }

  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-full { grid-column: 1 / -1; }

  .case-card-header { padding: 12px 14px; gap: 8px; }
  .case-name { font-size: 13px; }
  .case-right { gap: 6px; }
  .deadline-pill { font-size: 10px; padding: 4px 8px; }

  .results-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .results-bulk { flex-wrap: wrap; }

  .card-actions { gap: 6px; }
  .card-actions .btn { font-size: 11px; padding: 8px 11px; }

  .main-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 9px 14px; font-size: 12px; white-space: nowrap; }

  /* Naptár havi nézet */
  .cal-month-grid { gap: 2px; }
  .cal-day-cell { min-height: 54px; padding: 3px; }
  .cal-day-num { font-size: 10px; }
  .cal-chip { font-size: 8px; padding: 1px 3px; }

  /* Naptár heti nézet vízszintes görgetéssel */
  .cal-week-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; grid-template-columns: repeat(7, minmax(100px, 1fr)); }

  /* Dashboard tábla */
  .dash-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dash-table th, .dash-table td { padding: 7px 8px; font-size: 11px; }

  /* ToDo */
  .todo-add-row { flex-wrap: wrap; }
  .todo-title-input { min-width: 0; }

  /* Toast */
  .toast-wrap { bottom: 14px; right: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: 100%; }

  /* Érintési célterületek */
  .btn { min-height: 40px; }
  .item-del, .note-del, .todo-del { min-width: 32px; min-height: 32px; }

  /* Modálok teljes képernyő mobilon */
  .settings-modal { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .settings-overlay { padding: 0; }
  .report-modal { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .report-overlay { padding: 0; }
  .pdf-modal { width: 100vw; height: 100dvh; border-radius: 0; }
  .pdf-modal-overlay { padding: 0; }
}

/* ─── RESPONSIVE (480px, kis képernyő) ────────────────────── */
@media (max-width: 480px) {
  .field-grid { grid-template-columns: 1fr; }
  .case-eh { display: none; }
  .case-sub { gap: 5px; font-size: 9px; }
  .header-logo { display: none; }
  .header-brand h1 { font-size: 12px; }

  .cal-day-cell { min-height: 40px; }
  .cal-chip { display: none; }
  .cal-day-num { font-size: 9px; }

  .tab-btn { padding: 8px 10px; font-size: 11px; }

  .dash-filter-bar input[type="text"] { width: 140px; }
}

/* ─── PDF MODAL ───────────────────────────────────────── */
.pdf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.pdf-modal-overlay.open { display: flex; }

.pdf-modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  width: min(92vw, 900px);
  height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.18s ease;
}
@keyframes modalIn {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pdf-modal-title {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-modal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}
.pdf-nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
  color: var(--text);
}
.pdf-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.pdf-nav-btn:disabled { opacity: 0.35; cursor: default; }

.pdf-zoom-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.pdf-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s;
  flex-shrink: 0;
}
.pdf-modal-close:hover { color: var(--danger); }

.pdf-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #525659;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.pdf-page-wrap {
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  background: white;
  line-height: 0;
}

.pdf-page-wrap canvas { display: block; }

.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #ccc;
  font-family: var(--mono);
  font-size: 12px;
  gap: 12px;
}
.pdf-loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-preview {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-preview:hover { border-color: var(--accent); color: var(--accent); }

/* ─── TITKOSÍTÁS – LOCK SCREEN ───────────────────────── */
.lock-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: none; align-items: center; justify-content: center;
}
.lock-overlay.active { display: flex; }
.lock-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px; width: min(400px, 92vw);
  box-shadow: var(--shadow-md); text-align: center;
}
.lock-icon { font-size: 40px; margin-bottom: 16px; }
.lock-box h2 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.lock-box p { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.lock-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border2);
  border-radius: 8px; font-size: 15px; letter-spacing: .1em;
  background: var(--surface2); color: var(--text); margin-bottom: 12px;
  text-align: center;
}
.lock-input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.lock-error { color: var(--danger); font-size: 12px; min-height: 18px; margin-bottom: 8px; }
.lock-hint { font-size: 10px; color: var(--muted); margin-top: 12px; line-height: 1.5; }

/* ─── ÖSSZEFOGLALÓ / MUNKATERV MODAL ─────────────────── */
.report-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 250;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.report-overlay.open { display: flex; }
.report-modal {
  background: var(--surface); border-radius: 14px;
  width: min(780px, 96vw); max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border); display: flex; flex-direction: column;
}
.report-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.report-hdr h2 { font-size: 14px; font-weight: 700; }
.report-body { padding: 20px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }
.report-table th {
  background: var(--surface2); text-align: left;
  padding: 6px 10px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border);
}
.report-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.report-table tr:last-child td { border-bottom: none; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.n8n-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.n8n-url-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.n8n-url-row input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border2);
  border-radius: 6px; background: var(--surface2); color: var(--text);
  font-size: 12px; font-family: var(--mono);
}

/* ─── TÉMÁK (CSS variable overrides) ─────────────────── */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242836;
  --border: #2e3347;
  --border2: #3d4460;
  --accent: #4ade80;
  --accent-light: #86efac;
  --accent-bg: #14291e;
  --warn: #fbbf24;
  --warn-bg: #2a1f08;
  --danger: #f87171;
  --danger-bg: #2a1515;
  --muted: #8899aa;
  --text: #e8eaf0;
  --header-bg: #111827;
  --header-text: #e8eaf0;
  --shadow: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
}
[data-theme="ocean"] {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface2: #e4eef8;
  --border: #bdd0e8;
  --border2: #96b4d8;
  --accent: #1e40af;
  --accent-light: #2563eb;
  --accent-bg: #dbeafe;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --muted: #64748b;
  --text: #0f172a;
  --header-bg: #1e3a8a;
  --header-text: #ffffff;
}
[data-theme="sand"] {
  --bg: #faf7f2;
  --surface: #fffdf9;
  --surface2: #f5f0e8;
  --border: #e4dccb;
  --border2: #cfc2a8;
  --accent: #92400e;
  --accent-light: #b45309;
  --accent-bg: #fef3c7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --muted: #78716c;
  --text: #1c1917;
  --header-bg: #78350f;
  --header-text: #ffffff;
}
[data-theme="contrast"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #eeeeee;
  --border: #333333;
  --border2: #000000;
  --accent: #000000;
  --accent-light: #333333;
  --accent-bg: #e8e8e8;
  --warn: #cc6600;
  --warn-bg: #fff3cc;
  --danger: #cc0000;
  --danger-bg: #ffeeee;
  --muted: #444444;
  --text: #000000;
  --header-bg: #000000;
  --header-text: #ffffff;
}

/* ─── BEÁLLÍTÁSOK MODAL ───────────────────────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.settings-overlay.open { display: flex; }
.settings-modal {
  background: var(--surface);
  border-radius: 14px;
  width: min(700px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.settings-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.settings-hdr h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-hdr-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1;
  padding: 4px 6px; border-radius: 6px;
  transition: background .15s;
}
.settings-hdr-close:hover { background: var(--surface2); color: var(--text); }
.settings-tabs {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 57px;
  z-index: 2;
  overflow-x: auto;
}
.stab {
  font-size: 12px; font-weight: 600;
  padding: 10px 16px;
  border: none; background: none;
  cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s;
}
.stab.active { color: var(--accent); border-bottom-color: var(--accent); }
.stab:hover:not(.active) { color: var(--text); }
.settings-body { padding: 24px; flex: 1; }
.settings-section-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: 14px;
}

/* Téma kártyák */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.theme-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  position: relative;
  user-select: none;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-card.active { border-color: var(--accent); }
.theme-card.active::after {
  content: '✓';
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; font-weight: 800;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  line-height: 18px; text-align: center;
}
.theme-preview { height: 62px; position: relative; overflow: hidden; }
.theme-preview-bar { height: 18px; }
.theme-preview-body { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.theme-preview-line { height: 5px; border-radius: 3px; }
.theme-preview-dot { width: 20px; height: 5px; border-radius: 3px; }
.theme-card-label {
  font-size: 11px; font-weight: 600;
  padding: 6px 8px 7px;
  text-align: center;
  border-top: 1px solid;
}

/* Header ikonos gombok */
.btn-header-icon {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--header-text);
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, opacity .15s;
  flex-shrink: 0;
  margin-left: 6px;
}
.btn-header-icon:hover:not(:disabled) { background: rgba(255,255,255,0.28); }
.btn-header-icon:disabled { opacity: 0.35; cursor: default; }
/* Visszafelé compat alias */
.btn-settings-trigger { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: var(--header-text); width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  font-size: 15px; display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0; margin-left: 6px; }
.btn-settings-trigger:hover { background: rgba(255,255,255,0.28); }
.header-right { display: flex; align-items: center; }

/* ─── SABLON LISTA ────────────────────────────────────── */
.tmpl-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; background: var(--surface2);
  gap: 12px;
}
.tmpl-row-main { flex: 1; min-width: 0; }
.tmpl-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.tmpl-items-preview { display: flex; flex-wrap: wrap; gap: 4px; }
.tmpl-items-preview span { font-size: 10px; color: var(--muted); font-family: var(--mono); }
.tmpl-row-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── STÁTUSZ BADGE ───────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  letter-spacing: .03em; white-space: nowrap;
}
.status-folyamatban { background: #dbeafe; color: #1e40af; }
.status-lejárt      { background: #fee2e2; color: #991b1b; }
.status-teljesített { background: #dcfce7; color: #166534; }
.status-lezárt      { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

[data-theme="dark"] .status-folyamatban { background: #14291e; color: #86efac; }
[data-theme="dark"] .status-lejárt      { background: #2a1515; color: #f87171; }
[data-theme="dark"] .status-teljesített { background: #14291e; color: #4ade80; }

.status-select {
  font-size: 10px; font-weight: 700;
  border: none; background: transparent; cursor: pointer;
  padding: 2px 4px; border-radius: 20px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.field-status-wrap {
  display: flex; align-items: center; gap: 6px;
}

/* ─── HATÁRIDŐ ELŐZMÉNY ───────────────────────────────── */
.hatarido-hist {
  margin-top: 5px;
  border-left: 2px solid var(--border2);
  padding-left: 8px;
}
.hatarido-hist-row {
  display: flex; gap: 8px; align-items: center;
  font-size: 10px; color: var(--muted);
  font-family: var(--mono);
  padding: 2px 0;
}
.hatarido-hist-from { text-decoration: line-through; opacity: .7; }
.hatarido-hist-to { color: var(--accent); font-weight: 600; }
.hatarido-hist-date { opacity: .6; }

/* ─── TABS ───────────────────────────────────────────── */
.main-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
  transition: all 0.15s;
}
.tab-btn.active .tab-badge { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.tab-badge.todo-live { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }

/* ─── TODO SIDEBAR ───────────────────────────────────── */
.todo-sidebar-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.todo-import-zone {
  border: 2px dashed var(--border2);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--surface2);
  position: relative;
}
.todo-import-zone:hover, .todo-import-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.todo-import-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.todo-import-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.todo-import-title { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.todo-import-hint  { font-family: var(--mono); font-size: 9px; color: var(--muted); line-height: 1.5; }
.todo-bkm-btn { width: 100%; margin-top: 8px; font-size: 11px; padding: 7px 10px; }

/* ─── TODO ADD FORM ──────────────────────────────────── */
.todo-add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.todo-add-row { display: flex; gap: 8px; align-items: center; }
.todo-title-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.todo-title-input:focus { border-color: var(--accent); background: white; }
.todo-title-input::placeholder { color: var(--muted); }
.todo-extra-fields {
  display: none;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.todo-extra-fields.open { display: flex; }
.todo-extra-group { display: flex; flex-direction: column; }
.todo-extra-label { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.todo-extra-fields input[type="date"],
.todo-extra-fields select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  outline: none;
}
.todo-extra-fields input[type="date"]:focus,
.todo-extra-fields select:focus { border-color: var(--accent); }
.todo-paste-area {
  display: none;
  width: 100%;
  height: 72px;
  resize: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  outline: none;
  transition: border-color 0.15s;
  margin-top: 10px;
}
.todo-paste-area.open { display: block; }
.todo-paste-area:focus { border-color: var(--accent); color: var(--text); }

/* ─── TODO TOOLBAR ───────────────────────────────────── */
.todo-toolbar { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.todo-filter-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  transition: all 0.12s;
}
.todo-filter-btn:hover { border-color: var(--border2); color: var(--text); }
.todo-filter-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.todo-clear-done { margin-left: auto; font-size: 11px; padding: 5px 12px; }

/* ─── TODO LIST & ITEMS ──────────────────────────────── */
.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: start;
  transition: border-color 0.15s, opacity 0.2s;
  box-shadow: var(--shadow);
}
.todo-item:hover { border-color: var(--border2); }
.todo-item.done { opacity: 0.48; }
.todo-item.done .todo-item-title { text-decoration: line-through; color: var(--muted); }
.todo-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.15s;
  margin-top: 1px;
}
.todo-check:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5l3 4L11 1' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}
.todo-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.todo-item-title { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-word; }
.todo-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.todo-due { font-family: var(--mono); font-size: 10px; font-weight: 500; }
.todo-due.overdue { color: var(--danger); }
.todo-due.urgent  { color: var(--warn); }
.todo-due.ok      { color: #15803d; }
.todo-due.someday { color: var(--muted); }
.todo-email-from {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.todo-notes-toggle {
  background: none; border: none;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  cursor: pointer; padding: 0; text-align: left; margin-top: 2px;
  text-decoration: underline; text-decoration-style: dotted;
}
.todo-notes-toggle:hover { color: var(--accent); }
.todo-notes-body {
  display: none;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-top: 6px; background: var(--surface2); border-radius: 6px;
  padding: 8px 10px; white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow-y: auto; line-height: 1.6;
}
.todo-notes-body.open { display: block; }
.prio-badge {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 2px 6px; border-radius: 3px; font-weight: 700;
}
.prio-high   { background: var(--danger-bg); color: var(--danger); }
.prio-normal { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.prio-low    { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.src-badge {
  font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: 600;
}
.src-email  { background: #eff6ff; color: #1d4ed8; }
.src-ics    { background: #ede9fe; color: #6d28d9; }
.src-csv    { background: #ecfdf5; color: #065f46; }
.src-manual { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.todo-actions { display: flex; gap: 4px; flex-shrink: 0; }
.todo-del {
  background: none; border: none; color: #d1d5db;
  cursor: pointer; font-size: 14px; padding: 4px 6px;
  border-radius: 4px; transition: color 0.12s; line-height: 1;
}
.todo-del:hover { color: var(--danger); }

/* ─── TODO EMPTY STATE ───────────────────────────────── */
.todo-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.todo-empty-icon { font-size: 40px; opacity: 0.3; margin-bottom: 12px; display: block; }
.todo-empty p { font-family: var(--mono); font-size: 12px; line-height: 1.9; }

/* ─── TODO EXTENDED: DUE EDIT, REMINDERS, NOTES ─────── */
.todo-item-title[contenteditable="true"] { cursor: text; border-radius: 3px; padding: 1px 3px; margin: -1px -3px; }
.todo-item-title[contenteditable="true"]:focus { outline: 1px solid var(--accent); background: var(--surface2); }
.todo-due-edit { display:none; margin-top:4px; }
.todo-due-edit input[type="date"] { font-family:var(--mono);font-size:11px;border:1px solid var(--border);border-radius:5px;padding:3px 6px;background:var(--surface2);color:var(--text); }
.todo-section { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.todo-section-label { font-family:var(--mono);font-size:10px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:5px; }
.todo-reminder-row { display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text);padding:3px 0;border-bottom:1px solid var(--border); }
.todo-reminder-row:last-of-type { border-bottom:none; }
.todo-reminder-row.rdone { opacity:.55;text-decoration:line-through; }
.reminder-dt { font-family:var(--mono);font-size:10px;color:var(--muted);white-space:nowrap; }
.todo-add-sub-btn { background:none;border:none;font-size:10px;color:var(--accent);cursor:pointer;padding:2px 0;text-decoration:underline dotted; }
.todo-reminder-input { display:none;flex-wrap:wrap;gap:4px;margin-top:5px;align-items:center; }
.todo-reminder-input input { font-family:var(--mono);font-size:11px;border:1px solid var(--border);border-radius:5px;padding:3px 6px;background:var(--surface2);color:var(--text); }
.todo-reminder-input input[type="text"] { flex:1;min-width:120px; }
.todo-note-row { display:flex;align-items:flex-start;gap:6px;font-size:11px;padding:3px 0;border-bottom:1px solid var(--border); }
.todo-note-row:last-of-type { border-bottom:none; }
.note-ts { font-family:var(--mono);font-size:9px;color:var(--muted);white-space:nowrap;padding-top:2px;min-width:76px; }
.note-text { flex:1;word-break:break-word;line-height:1.5; }
.note-text:focus { outline:1px solid var(--accent);border-radius:3px; }
.todo-note-input-row { display:flex;gap:4px;margin-top:6px;align-items:center; }
.todo-note-input-row input { flex:1;font-family:var(--mono);font-size:11px;border:1px solid var(--border);border-radius:5px;padding:3px 8px;background:var(--surface2);color:var(--text); }
.todo-notes-log { margin-top:4px; }

/* ─── PROJEKT TAB ─────────────────────────────────────── */
.proj-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;flex-wrap:wrap;}
.proj-view-toggle{display:flex;gap:6px;}
.proj-count-badge{background:var(--accent-bg);color:var(--accent);border:1px solid var(--accent);border-radius:10px;padding:1px 8px;font-size:11px;font-weight:700;margin-left:6px;}
.proj-list{display:flex;flex-direction:column;gap:12px;}
.proj-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;overflow:hidden;transition:box-shadow .15s;}
.proj-card:hover{box-shadow:var(--shadow-md);}
.proj-card-header{display:flex;align-items:center;gap:12px;padding:14px 18px;cursor:pointer;border-left:4px solid transparent;}
.proj-card-header:hover{background:var(--surface2);}
.proj-color-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0;}
.proj-card-name{font-weight:700;font-size:14px;flex:1;}
.proj-card-meta{font-size:11px;color:var(--muted);display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.proj-card-body{padding:16px 18px;border-top:1px solid var(--border);}
.proj-status-badge{font-size:11px;padding:2px 8px;border-radius:8px;font-weight:600;white-space:nowrap;}
.proj-status-active{background:#d1fae5;color:#065f46;}
.proj-status-done{background:#dbeafe;color:#1e40af;}
.proj-status-archived{background:var(--surface2);color:var(--muted);}
/* Kanban */
.kanban-board{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:4px;}
.kanban-col{background:var(--surface2);border-radius:10px;padding:12px;min-height:160px;transition:background .15s;}
.kanban-col.drag-target{background:var(--accent-bg);outline:2px dashed var(--accent);}
.kanban-col-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
.kanban-card{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:10px 12px;margin-bottom:8px;cursor:grab;transition:box-shadow .12s,opacity .12s;font-size:13px;}
.kanban-card:active{cursor:grabbing;opacity:.7;}
.kanban-card.dragging{opacity:.4;}
.kanban-card-title{font-weight:600;margin-bottom:4px;line-height:1.3;}
.kanban-card-meta{font-size:11px;color:var(--muted);display:flex;gap:6px;flex-wrap:wrap;margin-top:4px;}
.kanban-card-progress{margin-top:6px;}
/* Checklists */
.cl-section{margin-top:14px;}
.cl-section-hdr{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;}
.cl-section-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);}
.cl-group{background:var(--surface2);border:1px solid var(--border);border-radius:8px;margin-bottom:8px;overflow:hidden;}
.cl-group-hdr{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--surface);border-bottom:1px solid var(--border);}
.cl-group-name{font-weight:600;font-size:13px;flex:1;}
.cl-progress-bar{height:5px;border-radius:3px;background:var(--border);overflow:hidden;flex:1;}
.cl-progress-fill{height:100%;border-radius:3px;background:var(--accent);transition:width .3s;}
.cl-progress-label{font-size:10px;color:var(--muted);white-space:nowrap;min-width:38px;text-align:right;}
.cl-item{display:flex;align-items:center;gap:8px;padding:6px 12px;border-bottom:1px solid var(--border);font-size:13px;}
.cl-item:last-child{border-bottom:none;}
.cl-item.cl-done .cl-item-title{text-decoration:line-through;opacity:.45;}
.cl-item-title{flex:1;cursor:text;}
.cl-item-meta{display:flex;gap:5px;align-items:center;font-size:11px;color:var(--muted);}
.cl-pri-high{color:#ef4444;font-weight:700;}
.cl-pri-normal{color:var(--muted);}
.cl-pri-low{color:#94a3b8;}
.cl-add-row{display:flex;gap:6px;padding:6px 12px;background:var(--surface2);}
.cl-add-row input{flex:1;font-size:12px;border:1px solid var(--border);border-radius:5px;padding:4px 8px;background:var(--surface);color:var(--text);}
/* Sablon chipek */
.tmpl-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px;}
.tmpl-chip{padding:4px 12px;border-radius:14px;border:1px solid var(--border);background:var(--surface);font-size:12px;cursor:pointer;transition:all .12s;}
.tmpl-chip:hover{border-color:var(--accent);color:var(--accent);}
/* Form modal */
.proj-form-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:900;display:flex;align-items:center;justify-content:center;padding:20px;}
.proj-form-box{background:var(--surface);border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.25);width:100%;max-width:500px;max-height:90vh;overflow-y:auto;}
.proj-form-hdr{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface);z-index:1;}
.proj-form-hdr h3{margin:0;font-size:15px;}
.proj-form-body{padding:20px;}
.proj-form-group{margin-bottom:14px;}
.proj-form-group label{display:block;font-size:11px;font-weight:700;color:var(--muted);margin-bottom:4px;text-transform:uppercase;letter-spacing:.05em;}
.proj-form-group input,.proj-form-group select,.proj-form-group textarea{width:100%;border:1px solid var(--border);border-radius:6px;padding:7px 10px;font-size:13px;background:var(--surface2);color:var(--text);box-sizing:border-box;}
.proj-form-group textarea{resize:vertical;min-height:60px;}
.proj-color-picker{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;}
.proj-color-swatch{width:26px;height:26px;border-radius:50%;cursor:pointer;border:3px solid transparent;transition:border-color .12s;}
.proj-color-swatch.sel{border-color:var(--text);}
.proj-form-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px;border-top:1px solid var(--border);}
/* Projekt detail */
.proj-detail-hdr{display:flex;align-items:center;gap:10px;margin-bottom:18px;flex-wrap:wrap;}
.proj-detail-back{padding:6px 12px;border:1px solid var(--border);border-radius:6px;background:var(--surface);cursor:pointer;font-size:13px;}
.proj-detail-back:hover{background:var(--surface2);}
.proj-detail-title{font-size:18px;font-weight:700;flex:1;}
/* Eset kártya checklist progress sáv */
.case-cl-progress{display:flex;align-items:center;gap:6px;margin-top:4px;}
.case-cl-progress .cl-progress-bar{flex:1;height:4px;}
.case-cl-progress-label{font-size:10px;color:var(--muted);white-space:nowrap;}
/* Settings – partner/checklist sablon tab */
.partner-row,.csdok-row{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--border);}
.partner-row:last-of-type,.csdok-row:last-of-type{border-bottom:none;}
.partner-name,.csdok-name{flex:1;font-size:13px;}
.cs-group{margin-bottom:16px;border:1px solid var(--border);border-radius:8px;overflow:hidden;}
.cs-group-hdr{padding:8px 12px;background:var(--surface2);font-weight:600;font-size:13px;display:flex;align-items:center;justify-content:space-between;}
.cs-dok-list{padding:4px 12px;}
/* Responsive */
@media(max-width:700px){
  .kanban-board{grid-template-columns:1fr;}
  .proj-header{flex-direction:column;align-items:flex-start;}
}

/* —— Auth overlay (Fázis 5) —— */
.auth-overlay{
  position:fixed;inset:0;z-index:20000;
  display:none;align-items:center;justify-content:center;
  background:rgba(15,18,28,.72);backdrop-filter:blur(6px);
}
.auth-panel{
  width:min(400px,92vw);padding:28px;border-radius:12px;
  background:var(--surface);border:1px solid var(--border);
  box-shadow:0 20px 50px rgba(0,0,0,.35);
}
.auth-title{margin:0 0 16px;font-size:20px;font-weight:700;color:var(--text);}
.auth-hint{font-size:13px;color:var(--muted);margin:0 0 12px;line-height:1.45;}
.auth-input{
  display:block;width:100%;box-sizing:border-box;margin-bottom:10px;
  padding:10px 12px;border-radius:8px;border:1px solid var(--border);
  background:var(--surface2);color:var(--text);font-size:14px;
}
.auth-btn{
  width:100%;margin-top:6px;padding:11px 14px;border:none;border-radius:8px;
  background:var(--accent,#3b82f6);color:#fff;font-weight:600;font-size:14px;cursor:pointer;
}
.auth-btn:hover{filter:brightness(1.06);}
.auth-error{min-height:1.2em;margin:10px 0 0;font-size:13px;color:#f87171;}
.auth-qr-wrap{display:flex;justify-content:center;margin:12px 0;}
.auth-qr-wrap img{max-width:220px;height:auto;border-radius:8px;}
.auth-backup-codes{
  font-size:12px;background:var(--surface2);padding:12px;border-radius:8px;
  border:1px solid var(--border);max-height:140px;overflow:auto;margin:0 0 12px;
}

