/* ================================================================
   SimpleProject — style.css
   Light / Dark theme via [data-theme="dark"] on <html>
================================================================ */

/* ── Custom properties ────────────────────────────────────── */
:root {
  --bg:           #f0f2f7;
  --bg-card:      #ffffff;
  --bg-hover:     #f5f7ff;
  --bg-input:     #ffffff;
  --text:         #1b1f2e;
  --text-muted:   #6b7280;
  --text-label:   #4b5563;
  --border:       #e2e5ec;
  --border-focus: #4361ee;
  --primary:      #4361ee;
  --primary-h:    #3451d1;
  --primary-10:   #eef1fd;
  --danger:       #dc2626;
  --danger-10:    #fef2f2;
  --success:      #16a34a;
  --success-10:   #f0fdf4;
  --priority:     #f97316;
  --priority-10:  #fff7ed;
  --priority-bd:  #fdba74;
  --warn:         #d97706;
  --shadow-xs:    0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:    0 1px 4px rgba(0,0,0,.08);
  --shadow:       0 4px 14px rgba(0,0,0,.10);
  --radius:       10px;
  --radius-sm:    6px;
  --radius-xs:    4px;
  --header-h:     56px;
  --sidebar-w:    272px;
  --trans:        .18s ease;
  --form-group-bg: #e6e9f2;
}

[data-theme="dark"] {
  --bg:         #0c0c0c;
  --bg-card:    #161616;
  --bg-hover:   #202020;
  --bg-input:   #1c1c1c;
  --text:       #e3e3e3;
  --text-muted: #888888;
  --text-label: #9a9a9a;
  --border:     #2e2e2e;
  --primary-10: #191921;
  --danger-10:  #190a0a;
  --success-10: #091209;
  --priority-10: #1a0e00;
  --priority-bd: #92400e;
  --shadow-xs:  0 1px 2px rgba(0,0,0,.50);
  --shadow-sm:  0 1px 4px rgba(0,0,0,.55);
  --shadow:     0 4px 14px rgba(0,0,0,.65);
  --form-group-bg: #222226;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background var(--trans), color var(--trans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
code {
  font-family: 'Fira Mono', 'Cascadia Code', monospace;
  font-size: .82em;
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

/* ── SVG icons ────────────────────────────────────────────── */
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon svg { display: block; }

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  gap: 12px;
}
.app-header-left {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.app-logo {
  font-size: 1rem; font-weight: 800; letter-spacing: -.4px;
  color: var(--primary); cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Client color badge — shown after logo when a client is active */
.client-header-badge {
  display: flex; align-items: center;
  padding: 4px 13px; border-radius: 20px;
  font-size: 1rem; font-weight: 800; white-space: nowrap;
  letter-spacing: -.4px;
  /* color and background set inline */
}

.header-right  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--primary-10); color: var(--primary);
  font-size: .78rem; font-weight: 700;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: .875rem; font-weight: 600;
  transition: background var(--trans), color var(--trans), border-color var(--trans), opacity var(--trans);
  white-space: nowrap; text-decoration: none;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }

.btn-ghost {
  background: transparent; border-color: var(--border); color: var(--text);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .85; }

.btn-icon { padding: 6px; border-radius: var(--radius-sm); }

.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-xs { padding: 3px 8px;  font-size: .75rem; }

/* Theme toggle ─────────────────────────────────────────────── */
.btn-theme {
  background: none; border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 13px;
  color: var(--text); font-size: .8rem; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; transition: all var(--trans); font-family: inherit;
}
.btn-theme:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Container ────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 28px 20px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 5px;
  font-size: .75rem; font-weight: 700;
  color: var(--text-label); letter-spacing: .4px; text-transform: uppercase;
}
.form-control {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text);
  font-size: .875rem; transition: border-color var(--trans), box-shadow var(--trans);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(67,97,238,.14);
}
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 11px 15px; border-radius: var(--radius-sm);
  font-size: .855rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.alert-error   { background: var(--danger-10);  color: var(--danger);  border: 1px solid rgba(220,38,38,.2); }
.alert-success { background: var(--success-10); color: var(--success); border: 1px solid rgba(22,163,74,.2); }
.alert-info    { background: var(--primary-10); color: var(--primary); border: 1px solid rgba(67,97,238,.2); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  background: var(--bg-hover); color: var(--text-muted);
}
.badge-blue    { background: var(--primary-10);  color: var(--primary);  }
.badge-green   { background: var(--success-10);  color: var(--success);  }
.badge-red     { background: var(--danger-10);   color: var(--danger);   }
.badge-grey    { background: var(--bg-2);         color: var(--text-muted); border: 1px solid var(--border); }
.badge-priority{ background: var(--priority-10);  color: var(--priority);   border: 1px solid var(--priority-bd); font-weight:700; }
.badge-yellow  { background: #fff8e1;             color: #b45309; }

/* ── Time badge ───────────────────────────────────────────── */
.time-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--primary); color: #fff;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.time-badge-outline {
  background: var(--primary-10); color: var(--primary);
  padding: 6px 14px; font-size: .85rem;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Utility ──────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap     { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .875rem; }
.text-xs    { font-size: .78rem; }
.text-center { text-align: center; }
.font-bold   { font-weight: 700; }
.hidden      { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Page typography ──────────────────────────────────────── */
.page-title    { font-size: 1.4rem; font-weight: 800; letter-spacing: -.4px; margin-bottom: 2px; }
.page-subtitle { color: var(--text-muted); font-size: .875rem; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text-muted); margin-bottom: 16px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { opacity: .35; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-h)); padding: 24px 16px;
}
.auth-card { width: 100%; max-width: 420px; padding: 36px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .auth-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--primary-10); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 1.4rem; font-weight: 800; }
.auth-logo p  { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

/* ── Client tabs (legacy) ─────────────────────────────────── */
.client-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.client-tab {
  padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; font-size: .82rem; font-weight: 600;
  transition: all var(--trans);
}
.client-tab:hover { border-color: var(--primary); color: var(--primary); }
.client-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Admin client selector (dropdown) ────────────────────── */
.client-selector-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}

/* ── Projects layout (list + calendar sidebar) ────────────── */
.projects-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 22px;
  align-items: start;
}
.projects-main {}
.calendar-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }

/* ── Project list ─────────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 8px; }

.project-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--trans), transform var(--trans), box-shadow var(--trans);
}
.project-item:hover {
  border-color: var(--primary);
  transform: translateX(3px);
  box-shadow: var(--shadow);
}
.project-item.day-filtered {
  border-color: var(--primary);
  background: var(--primary-10);
}
.project-item-left   { min-width: 0; flex: 1; }
.project-item-name   { font-weight: 700; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-item-meta   { display: flex; flex-wrap: wrap; gap: 10px; font-size: .75rem; color: var(--text-muted); align-items: center; }
.project-item-right  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Update items ─────────────────────────────────────────── */
.update-item {
  padding: 14px 16px;
  border-left: 3px solid var(--primary);
  background: var(--bg-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}
.update-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px; gap: 10px;
}
.update-meta    { font-size: .75rem; color: var(--text-muted); }
.update-content { white-space: pre-wrap; line-height: 1.65; font-size: .88rem; }
.update-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* Inline update edit form */
.update-edit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.update-edit textarea { min-height: 80px; }

/* ── Closed project styling ───────────────────────────────── */
.project-item--closed {
  opacity: .55;
  border-style: dashed;
}
.project-item--closed:hover {
  opacity: .9;
}
.project-item--priority {
  border: 1.5px solid var(--priority);
  border-left: 5px solid var(--priority);
  background: var(--priority-10);
}
.project-item--priority:hover {
  background: var(--priority-10);
  border-color: var(--priority);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,115,22,.15);
}
.priority-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .05em;
  margin: 10px 0 6px;
}
.priority-divider::before, .priority-divider::after {
  content: ''; flex: 1; border-top: 1px solid var(--border);
}

/* ── Admin editor inline edit / password forms ───────────── */
.editor-edit-form {
  padding: 16px 18px;
  background: var(--primary-10);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(67,97,238,.18);
}

/* ── Admin client inline edit form ───────────────────────── */
.client-edit-form {
  padding: 16px 18px;
  background: var(--primary-10);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(67,97,238,.18);
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .empty-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: var(--text-muted);
}

/* ── Monthly report bar ───────────────────────────────────── */
.monthly-report-bar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font-size: .82rem; font-weight: 600;
  transition: all var(--trans); font-family: inherit;
}
.page-btn:hover:not(.active) { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Calendar ─────────────────────────────────────────────── */
.cal-card { padding: 16px 18px; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-size: .9rem; font-weight: 700; }
.cal-nav-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 28px; height: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--trans); font-family: inherit;
}
.cal-nav-btn:hover { background: var(--bg-hover); color: var(--primary); border-color: var(--primary); }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-wd {
  text-align: center; font-size: .65rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; padding: 2px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: var(--radius-xs); cursor: pointer; position: relative;
  transition: background var(--trans);
  min-height: 28px;
}
.cal-day:hover { background: var(--bg-hover); }
.cal-day.empty { cursor: default; }
.cal-day.selected { background: var(--primary-10); }
.cal-day.today .cal-day-num { color: var(--primary); font-weight: 800; }

.cal-day-num {
  font-size: .72rem; font-weight: 600; color: var(--text-muted);
  line-height: 1;
}
.cal-day.has-dot .cal-day-num { color: var(--text); }

.cal-dot {
  border-radius: 50%;
  background: var(--primary);
  margin-top: 2px;
  transition: transform var(--trans);
}
.cal-dot.dot-sm { width: 5px;  height: 5px;  }
.cal-dot.dot-md { width: 8px;  height: 8px;  }
.cal-dot.dot-lg { width: 12px; height: 12px; }
.cal-day:hover .cal-dot { transform: scale(1.25); }

.cal-legend { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: .68rem; color: var(--text-muted); }

/* ── Month nav (in list header) ───────────────────────────── */
.month-nav {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 700; color: var(--text-muted);
}
.month-nav-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 28px; height: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--trans); font-family: inherit;
}
.month-nav-btn:hover { background: var(--bg-hover); color: var(--primary); border-color: var(--primary); }
.month-label { min-width: 110px; text-align: center; }

/* ── Admin tabs ───────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 22px; overflow-x: auto;
}
.admin-tab {
  padding: 10px 18px; cursor: pointer;
  font-weight: 600; font-size: .85rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color var(--trans), border-color var(--trans);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab:hover:not(.active) { color: var(--text); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 9px 13px; text-align: left;
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  background: var(--bg); border-bottom: 2px solid var(--border);
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
td {
  padding: 10px 13px; border-bottom: 1px solid var(--border);
  font-size: .855rem; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Share link box ───────────────────────────────────────── */
.share-box {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-top: 8px;
}
.share-url {
  flex: 1; font-size: .78rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: monospace;
}

/* ── Danger zone ──────────────────────────────────────────── */
.danger-zone {
  border: 1px solid rgba(220,38,38,.25);
  border-radius: var(--radius); padding: 18px 20px; margin-top: 18px;
}
.danger-zone h3 { color: var(--danger); font-size: .95rem; margin-bottom: 8px; }

/* ── Loading spinner ──────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-muted); gap: 12px;
}

/* ── Section heading ──────────────────────────────────────── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.section-title { font-size: 1rem; font-weight: 700; }

/* ── Collapsible panel ────────────────────────────────────── */
.collapsible-trigger {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 10px 0;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  user-select: none;
}
.collapsible-trigger:hover .collapsible-label { color: var(--primary); }
.collapsible-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 700;
  color: var(--text-muted);
  transition: color var(--trans);
}
.collapsible-chevron {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius-xs);
  color: var(--text-muted); flex-shrink: 0;
  transition: transform var(--trans), color var(--trans);
}
.collapsible-trigger:hover .collapsible-chevron { color: var(--primary); }
.collapsible-chevron.open { transform: rotate(180deg); }

.collapsible-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .3s ease, opacity .25s ease, padding .25s ease;
  padding-top: 0;
}
.collapsible-body.open {
  max-height: 2000px;
  opacity: 1;
  padding-top: 16px;
}

/* ── Color picker row ─────────────────────────────────────── */
.color-picker-row {
  display: flex; align-items: center; gap: 8px;
}
.color-swatch-input {
  width: 38px; height: 38px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 2px;
  background: var(--bg-card); cursor: pointer;
  flex-shrink: 0;
}
.color-swatch {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.15);
  vertical-align: middle;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
  .projects-layout {
    grid-template-columns: 1fr;
  }
  .calendar-sidebar {
    position: static;
    order: 2; /* calendar below list on mobile */
  }
}

@media (max-width: 640px) {
  :root { --header-h: 52px; }

  .container  { padding: 16px 14px; }
  .app-header { padding: 0 14px; }

  .card { padding: 16px 16px; }
  .auth-card { padding: 24px 18px; }

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

  .page-title { font-size: 1.2rem; }

  .project-item { flex-wrap: wrap; }
  .project-item-right { width: 100%; justify-content: flex-start; }

  .admin-tabs { gap: 0; }
  .admin-tab  { padding: 10px 12px; font-size: .78rem; }

  .btn { padding: 7px 13px; font-size: .82rem; }
  .user-badge { display: none; }
  .client-header-badge { display: none; }
  .header-center { display: none; }
}

@media (max-width: 400px) {
  .cal-day-num { font-size: .62rem; }
}

/* ================================================================
   NEW FEATURES — Build 0.10
================================================================ */

/* ── Footer ───────────────────────────────────────────────── */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--text-muted);
  opacity: .8;
  margin-top: auto;
}
.footer-name { font-weight: 700; color: var(--primary); }
.footer-sep  { opacity: .5; }
.footer-build { font-family: monospace; opacity: .7; }


/* ── Overdue indicator ────────────────────────────────────── */
.overdue-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Alert warning ────────────────────────────────────────── */
.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}
[data-theme="dark"] .alert-warning {
  background: rgba(245,158,11,.12);
  color: #fbbf24;
}

/* ── Time summary card ────────────────────────────────────── */
.time-summary-card {
  margin-top: 12px;
  padding: 14px 16px;
}
.time-summary-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.time-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: .9rem;
}
.time-summary-total strong { font-size: 1rem; color: var(--primary); }
.time-summary-list { display: flex; flex-direction: column; gap: 5px; }
.time-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: .82rem;
}
.time-summary-name {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.time-summary-val { display: flex; align-items: baseline; gap: 5px; flex-shrink: 0; }
.time-summary-exact { font-size: .72rem; color: var(--text-muted); }
/* ── Tag Cloud ────────────────────────────────────────────── */
.tag-cloud-card { margin-top: 12px; }
.tag-cloud-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px; margin-bottom: 9px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chip {
  font-size: .72rem; padding: 3px 9px; border-radius: 20px;
  background: var(--bg-2); color: var(--text-muted);
  border: 1px solid var(--border); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  user-select: none;
}
.tag-chip:hover { background: var(--primary-10); color: var(--primary); border-color: var(--primary); }
.tag-chip--active { background: var(--primary); color: #fff; border-color: var(--primary); }


/* ── Editor client picker ─────────────────────────────────── */
.client-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-page);
}
.client-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text-primary);
}
.client-picker-item input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
#e-client-list {
  padding-top: 4px;
  padding-left: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Author card ──────────────────────────────────────────── */
.author-card {
  max-width: 600px;
  text-align: center;
  padding: 40px 36px;
  margin: 0 auto;
}
.author-logo {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}
.author-logo .icon svg { width: 48px; height: 48px; }
.author-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 6px;
}
.author-subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.55;
  margin-bottom: 24px;
}
.author-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}
.author-meta-item {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.author-meta-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.author-meta-val { font-size: .88rem; font-weight: 500; color: var(--text-primary); }
.author-meta-val a { color: var(--primary); text-decoration: none; }
.author-meta-val a:hover { text-decoration: underline; }
.author-free {
  background: #eef9f1;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: .88rem;
  margin-bottom: 16px;
}
[data-theme="dark"] .author-free {
  background: rgba(22,163,74,.15);
  color: #4ade80;
  border-color: rgba(74,222,128,.25);
}
.author-disclaimer {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: left;
}

/* ── Badge: green ─────────────────────────────────────────── */
.badge-green {
  background: #dcfce7;
  color: #166534;
}
[data-theme="dark"] .badge-green {
  background: rgba(22,163,74,.2);
  color: #4ade80;
}

/* ── mail/key/shield/warning icons for settings ───────────── */
.icon svg { vertical-align: middle; }

/* ── Alert info ───────────────────────────────────────────── */
.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
}
[data-theme="dark"] .alert-info {
  background: rgba(59,130,246,.12);
  color: #93c5fd;
}

/* ── Responsive footer ────────────────────────────────────── */
@media (max-width: 640px) {
  .app-footer { font-size: .65rem; }
  .author-meta { grid-template-columns: 1fr; }
  .author-card { padding: 28px 18px; }
}

/* ── Admin settings — side-by-side card grids ─────────────── */
.admin-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-cards-grid > .card { margin-bottom: 0; }

@media (max-width: 760px) {
  .admin-cards-grid { grid-template-columns: 1fr; }
}

/* ── Body layout: footer at bottom of content ─────────────── */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#main {
  flex: 1;
}

/* ── Admin sub-tabs (Historia sub-nawigacja) ──────────────── */
.admin-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.admin-subtab {
  padding: 7px 16px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
  transition: background .15s, color .15s;
}
.admin-subtab:hover { background: var(--surface-alt); color: var(--text); }
.admin-subtab.active {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--border);
  border-bottom-color: var(--bg);
}

/* ── Collapsible section (ogólny, używany w szczegółach projektu) ─ */
.section-collapsible { margin-top: 12px; }
.section-collapsible + .section-collapsible { margin-top: 8px; }
.section-collapse-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  gap: 8px;
  transition: background .15s;
}
.section-collapse-trigger:hover { background: var(--border); }
.section-collapse-trigger .icon { flex-shrink: 0; }
.section-collapse-chevron { margin-left: auto; transition: transform .2s; }
.section-collapse-chevron.open { transform: rotate(180deg); }
.section-collapse-body {
  display: none;
  padding: 14px 4px 4px;
}
.section-collapse-body.open { display: block; }

/* ── Task checklist ───────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface-alt);
  border-radius: 7px;
  font-size: .88rem;
}
.task-item input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.task-item-text { flex: 1; line-height: 1.4; }
.task-item--done .task-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.task-item-del {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  line-height: 1; opacity: .55;
  transition: opacity .15s, color .15s;
}
.task-item-del:hover { opacity: 1; color: var(--danger); }
.task-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.task-add-row input { flex: 1; }
.task-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.task-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .3s;
}

/* ── Budget / stawka ──────────────────────────────────────── */
.budget-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.budget-row .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
.budget-earned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .85rem;
  margin-top: 8px;
}
.budget-earned strong { color: var(--primary); }

/* ── Contact info card ────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.contact-field { font-size: .85rem; }
.contact-field label { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: 2px; }
.contact-switch-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; font-size: .85rem;
}
.contact-source-badge {
  font-size: .72rem; color: var(--text-muted);
  background: var(--surface-alt);
  padding: 2px 7px; border-radius: 99px;
}
@media (max-width: 540px) { .contact-grid { grid-template-columns: 1fr; } }

/* ── Internal notes ───────────────────────────────────────── */
.note-internal-badge {
  font-size: .72rem;
  background: #fef9c3;
  color: #92400e;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 500;
}
[data-theme=dark] .note-internal-badge {
  background: #422006;
  color: #fcd34d;
}

/* ── Compact new-project form ─────────────────────────────── */
.form-row-compact {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.form-row-compact .form-control[type=date] {
  font-size: .83rem;
  padding: 6px 8px;
}
.form-row-compact .form-group { margin-bottom: 0; }
.priority-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 4px;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}
.priority-inline input[type=checkbox] { width: auto; accent-color: var(--priority); }
@media (max-width: 600px) {
  .form-row-compact { grid-template-columns: 1fr 1fr; }
  .form-row-compact .priority-inline { grid-column: 1 / -1; }
}

/* ── Updates two-column layout ────────────────────────────── */
.updates-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.updates-col-main { flex: 1; min-width: 0; }
.updates-col-tasks {
  flex-shrink: 0;
  width: 230px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 16px;
}

/* ── Budget sidebar box ───────────────────────────────────── */
.sb-budget {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.sb-budget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
  gap: 6px;
}
.sb-budget-head:hover { background: var(--border); }
.sb-budget-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.sb-chevron { color: var(--text-muted); transition: transform .2s; line-height: 1; }
.sb-chevron.open { transform: rotate(180deg); }
.sb-budget-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 9px;
}
.sb-budget-pct {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
}
.sb-budget-pct.sb-budget-over { color: var(--danger); }
.sb-budget-body {
  display: none;
  padding: 0 12px 10px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.sb-budget-body.open { display: block; }
.sb-budget-row {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.sb-budget-row:last-child { border-bottom: none; }
.sb-budget-row span { color: var(--text-muted); }

/* ── Tasks sidebar box ────────────────────────────────────── */
.upd-sidebar-tasks {
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.upd-sidebar-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.upd-sidebar-tasks .task-list { gap: 4px; margin-bottom: 0; }
.upd-sidebar-tasks .task-item {
  padding: 5px 8px;
  font-size: .82rem;
  background: var(--bg);
  border-radius: 6px;
}
.upd-sidebar-tasks .task-progress { margin-bottom: 8px; font-size: .76rem; }

/* ── Contact sidebar box ──────────────────────────────────── */
.upd-sidebar-contact {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.sb-con-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: .8rem;
  padding: 3px 0;
  color: var(--text);
}
.sb-con-row svg { color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }
.sb-con-row a { color: var(--primary); text-decoration: none; }
.sb-con-row a:hover { text-decoration: underline; }

/* ── Sidebar: final file link box ─────────────────────────── */
.upd-sidebar-link {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.sb-link-row { margin-bottom: 6px; }
.sb-link-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-10);
  border: 1px solid rgba(67,97,238,.2);
  transition: background .15s, border-color .15s;
}
.sb-link-download:hover { background: rgba(67,97,238,.18); border-color: rgba(67,97,238,.4); }
.sb-link-service {
  font-size: .73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Linear view: back link instead of breadcrumb ─────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
.back-link:hover { color: var(--primary); }

/* done-text in edit task form */
.task-done-text { text-decoration: line-through; color: var(--text-muted); }

/* ── Mobile: right column above history ───────────────────── */
@media (max-width: 700px) {
  .updates-layout { flex-direction: column; }
  .updates-col-tasks { width: 100%; position: static; order: 1; }
  .updates-col-main { order: 2; }
}

/* ── Form section groups (wizualne grupowanie pól) ── */
.form-section-group {
  background: var(--form-group-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 4px;
  margin-bottom: 14px;
}
.form-section-group .form-group:last-child { margin-bottom: 10px; }

/* ── Collapsible form section (np. Budżet i stawka) ── */
.form-section-collapsible {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.form-section-collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--surface-alt);
  user-select: none;
}
.form-section-collapsible-head:hover { background: var(--surface-hover, var(--border)); }
.form-section-collapsible-label {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-section-collapsible-body {
  display: none;
  padding: 14px 16px 4px;
  border-top: 1px solid var(--border);
}
.form-section-collapsible-body.open { display: block; }

/* ── Live Timer ── */
.timer-dur-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.timer-widget { display: flex; flex-direction: column; flex-shrink: 0; }
.timer-controls { display: flex; align-items: center; gap: 6px; }
.timer-display {
  font-family: monospace; font-size: 1.1rem; font-weight: 700;
  color: var(--primary); min-width: 76px; letter-spacing: .04em;
}
.timer-btn { min-width: 80px; }

/* ── Task drag & drop ── */
.task-item { cursor: default; }
.task-grip {
  cursor: grab; display: inline-flex; align-items: center;
  padding: 0 4px; color: var(--text-muted); flex-shrink: 0;
  touch-action: none;
}
.task-grip:active { cursor: grabbing; }
.task-dragging { opacity: .45; background: var(--primary-10); border-radius: 6px; }
.task-drag-over { outline: 2px dashed var(--primary); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 600px) {
  .timer-widget { width: 100%; }
  .timer-controls { flex-wrap: wrap; }
}

/* ── Search widget ── */
.breadcrumb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.breadcrumb-row .breadcrumb { margin-bottom: 0; }

.search-widget {
  position: relative;
  flex-shrink: 0;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  height: 36px;
  transition: border-color .15s;
}
.search-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-10);
}
.search-input-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: auto !important;
  min-width: 180px;
  font-size: .88rem;
}
.search-input:focus { outline: none; box-shadow: none !important; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 320px;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  z-index: 999;
  overflow: hidden;
}
.search-status {
  padding: 10px 14px;
  font-size: .83rem;
  color: var(--text-muted);
  text-align: center;
}
.search-result {
  display: block;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  text-decoration: none;
  color: inherit;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.active { background: var(--primary-10); }
.search-result-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: .77rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.search-tag {
  background: var(--primary-10);
  color: var(--primary);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .72rem;
}

/* ── Settings two-column layout ── */
.settings-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .settings-two-col { grid-template-columns: 1fr; gap: 0; }
}
.settings-col-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.settings-toggle-item {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.settings-toggle-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.settings-toggle-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-label);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.settings-toggle-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-left: 4px;
  font-size: .82rem;
}

/* ── Equal-height admin card pairs ── */
.admin-cards-equal { align-items: stretch; }
.card-flex-col {
  display: flex;
  flex-direction: column;
}
.card-flex-col .btn { align-self: flex-start; }
.card-flex-spacer { flex: 1; min-height: 12px; }

/* ── View mode toggle button ── */
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.view-toggle-btn:hover { color: var(--primary); }
.view-toggle-btn.active {
  background: var(--primary-10);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Must-change-password banner ── */
.must-change-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: .88rem;
  font-weight: 500;
  color: #664d03;
}
[data-theme="dark"] .must-change-banner {
  background: #2d2500;
  border-color: #ffc107;
  color: #ffd166;
}
.must-change-banner a {
  color: inherit;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   2DO / Ideas module
   ═══════════════════════════════════════════════════════════ */

/* ── Badge amber ──────────────────────────────────────────── */
.badge-amber {
  background: rgba(255,171,0,.15);
  color: #b37400;
  border: 1px solid rgba(255,171,0,.3);
}
[data-theme="dark"] .badge-amber {
  background: rgba(255,171,0,.18);
  color: #ffc740;
  border-color: rgba(255,171,0,.25);
}
.badge-success {
  background: rgba(34,197,94,.15);
  color: #15803d;
  border: 1px solid rgba(34,197,94,.25);
}
[data-theme="dark"] .badge-success {
  background: rgba(34,197,94,.15);
  color: #4ade80;
  border-color: rgba(34,197,94,.2);
}

/* ── btn-success ──────────────────────────────────────────── */
.btn-success {
  background: var(--success, #22c55e);
  color: #fff;
  border: none;
}
.btn-success:hover { filter: brightness(1.1); }

/* ── Ideas section wrapper ─────────────────────────────────── */
.ideas-section {
  margin-bottom: 12px;
}

/* ── Quick-add form ─────────────────────────────────────────── */
.idea-quick-form {
  background: rgba(255,171,0,.07);
  border: 1px solid rgba(255,171,0,.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
[data-theme="dark"] .idea-quick-form {
  background: rgba(255,171,0,.08);
  border-color: rgba(255,171,0,.2);
}

/* ── Add idea button ─────────────────────────────────────────── */
.idea-add-btn {
  color: #b37400 !important;
  border-color: rgba(255,171,0,.35) !important;
}
.idea-add-btn:hover {
  background: rgba(255,171,0,.1) !important;
}
[data-theme="dark"] .idea-add-btn {
  color: #ffc740 !important;
}

/* ── Ideas list ─────────────────────────────────────────────── */
.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

/* ── Idea card ──────────────────────────────────────────────── */
.idea-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid #ffab00;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.idea-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border-left-color: #e69900;
  background: var(--bg-hover);
}
.idea-card--done {
  border-left-color: var(--success, #22c55e);
  opacity: .72;
}
.idea-card--done .idea-card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.idea-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.idea-card-body { min-width: 0; }
.idea-card-title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.idea-card-preview {
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.idea-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.idea-card-date {
  font-size: .72rem;
  color: var(--text-muted);
}

/* ── Idea icon ──────────────────────────────────────────────── */
.idea-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,171,0,.15);
  color: #b37400;
  flex-shrink: 0;
}
[data-theme="dark"] .idea-icon { background: rgba(255,171,0,.15); color: #ffc740; }
.idea-icon-lg {
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 1.1rem;
}

/* ── Done group collapsible ─────────────────────────────────── */
.ideas-done-group {
  margin-top: 6px;
}
.ideas-done-group > summary {
  list-style: none;
  cursor: pointer;
  font-size: .8rem;
  color: var(--text-muted);
  padding: 4px 2px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ideas-done-group > summary::-webkit-details-marker { display: none; }
.ideas-done-group > summary:hover { color: var(--text); }
.ideas-done-group[open] > summary { margin-bottom: 6px; }

/* ── Idea detail view ───────────────────────────────────────── */
.idea-textarea {
  font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
  font-size: .88rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 240px;
}
.idea-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.idea-content-view {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 80px;
}
.idea-readonly { display: flex; flex-direction: column; gap: 12px; }
.form-control-lg { font-size: 1.05rem; font-weight: 600; padding: 10px 14px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .idea-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .idea-card-right { flex-direction: row; align-items: center; gap: 8px; }
  .idea-actions-bar { flex-direction: column; align-items: stretch; }
  .idea-actions-bar .btn { justify-content: center; }
}
