/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Inter', sans-serif; background: #0F172A; color: #E2E8F0; min-height: 100vh; }
a { color: #EF9F27; text-decoration: none; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { background: #1E293B; border: 1px solid #334155; border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 420px; }
.logo-block { text-align: center; margin-bottom: 2rem; }
.logo-text { font-size: 2rem; font-weight: 700; color: #EF9F27; }
.logo-sub { color: #94A3B8; font-size: 0.875rem; margin-top: 0.25rem; }
.login-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.5rem; text-align: center; }

/* ── Forms ── */
.field { margin-bottom: 1.25rem; }
label { display: block; font-size: 0.875rem; font-weight: 500; color: #94A3B8; margin-bottom: 0.375rem; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 0.625rem 0.875rem;
  background: #0F172A; border: 1px solid #334155; border-radius: 8px;
  color: #E2E8F0; font-family: inherit; font-size: 0.9375rem;
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: #EF9F27; }
textarea { resize: vertical; min-height: 80px; }
.error-box { background: #7F1D1D; border: 1px solid #EF4444; color: #FCA5A5; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.875rem; margin-bottom: 1.25rem; }

/* ── Buttons ── */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 0.625rem 1.25rem; background: #EF9F27; color: #0F172A; font-weight: 700;
  font-size: 0.9375rem; border: none; border-radius: 8px; cursor: pointer;
  font-family: inherit; transition: opacity .15s; }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { display: inline-flex; align-items: center; gap: .4rem;
  padding: 0.5rem 1rem; background: transparent; color: #94A3B8;
  border: 1px solid #334155; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 0.875rem; transition: border-color .15s, color .15s; }
.btn-ghost:hover { border-color: #64748B; color: #E2E8F0; }
.btn-danger { background: #7F1D1D; color: #FCA5A5; border: 1px solid #EF4444; border-radius: 8px; padding: 0.4rem 0.875rem; font-family: inherit; font-size: 0.8125rem; cursor: pointer; transition: background .15s; }
.btn-danger:hover { background: #991B1B; }

/* ── App Header ── */
.app-header { height: 56px; background: #1E293B; border-bottom: 1px solid #334155;
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem; position: sticky; top: 0; z-index: 100; }
.app-header .brand { font-weight: 700; font-size: 1.125rem; color: #EF9F27; letter-spacing: .02em; }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.user-chip { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #94A3B8; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; color: #0F172A; flex-shrink: 0; }
.avatar-sm { width: 22px; height: 22px; font-size: 0.6875rem; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid #1E293B; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0.25rem; padding: 0 1.5rem; background: #1E293B; border-bottom: 1px solid #334155; }
.tab-btn { padding: 0.625rem 1rem; font-family: inherit; font-size: 0.875rem; font-weight: 500;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: #94A3B8; cursor: pointer; transition: color .15s, border-color .15s; }
.tab-btn.active { color: #EF9F27; border-bottom-color: #EF9F27; }
.tab-btn:hover:not(.active) { color: #E2E8F0; }

/* ── Filters bar ── */
.filters-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.5rem;
  flex-wrap: wrap; background: #0F172A; border-bottom: 1px solid #1E293B; }
.filter-label { font-size: 0.8125rem; color: #64748B; }
.filter-chip { padding: 0.35rem 0.75rem; background: #1E293B; border: 1px solid #334155;
  border-radius: 999px; font-size: 0.8125rem; color: #94A3B8; cursor: pointer;
  font-family: inherit; transition: border-color .15s, color .15s; }
.filter-chip.active { border-color: #EF9F27; color: #EF9F27; background: rgba(239,159,39,.08); }
.filter-select { padding: 0.35rem 0.625rem; background: #1E293B; border: 1px solid #334155;
  border-radius: 8px; color: #94A3B8; font-size: 0.8125rem; font-family: inherit; }

/* ── Kanban Board ── */
.board-wrap { overflow-x: auto; padding: 1.25rem 1.5rem 2rem; min-height: calc(100vh - 140px); }
.board { display: flex; gap: 1rem; align-items: flex-start; min-width: max-content; }
.column { background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  width: 300px; flex-shrink: 0; display: flex; flex-direction: column; }
.column-header { padding: 0.875rem 1rem; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #334155; cursor: pointer; user-select: none; transition: background .15s; }
.column-header:hover { background: rgba(255,255,255,.03); }
.column-title { font-size: 0.875rem; font-weight: 600; color: #CBD5E1; }
.col-count { background: #334155; color: #94A3B8; font-size: 0.75rem; font-weight: 600;
  padding: 0.1rem 0.5rem; border-radius: 999px; }
.col-chevron { font-size: .65rem; color: #64748B; transition: transform .2s; }
.col-collapsed .col-chevron { transform: rotate(-90deg); }
.col-collapsed .column-header { border-bottom: none; }
.col-body-wrap { display: flex; flex-direction: column; }
.column-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.625rem; min-height: 80px; }
.col-add-wrap { padding: .5rem .75rem .75rem; }

/* ── Cards ── */
.card { background: #0F172A; border: 1px solid #334155; border-radius: 10px; padding: 0.875rem;
  cursor: grab; transition: box-shadow .15s, border-color .15s; user-select: none; }
.card:hover { border-color: #475569; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.card.sortable-chosen { cursor: grabbing; box-shadow: 0 8px 32px rgba(0,0,0,.5); opacity: .9; }
.card.sortable-ghost { opacity: 0.3; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: 0.5rem; }
.card-title { font-size: 0.9375rem; font-weight: 500; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.priority-dot.basse { background: #475569; }
.priority-dot.moyenne { background: #EF9F27; }
.priority-dot.haute { background: #EF4444; }
.cat-tag { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 4px;
  font-size: 0.6875rem; font-weight: 600; color: #0F172A; margin-bottom: 0.5rem; white-space: nowrap; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.625rem; }
.due-date { font-size: 0.75rem; color: #64748B; }
.due-date.overdue { color: #EF4444; }
.card-actions { display: flex; gap: 0.25rem; opacity: 0; transition: opacity .15s; }
.card:hover .card-actions { opacity: 1; }
.card-btn { background: none; border: none; color: #64748B; cursor: pointer; padding: 2px 4px;
  border-radius: 4px; font-size: 0.8125rem; transition: color .15s, background .15s; }
.card-btn:hover { color: #E2E8F0; background: #1E293B; }
.add-card-btn { display: flex; align-items: center; gap: 0.375rem; width: 100%;
  padding: 0.5rem 0.75rem; background: transparent; border: 1px dashed #334155;
  border-radius: 8px; color: #64748B; cursor: pointer; font-family: inherit;
  font-size: 0.8125rem; transition: border-color .15s, color .15s; margin-top: 0.25rem; }
.add-card-btn:hover { border-color: #EF9F27; color: #EF9F27; }

/* ── Notifications ── */
.notif-btn { position: relative; background: none; border: none; color: #94A3B8; cursor: pointer;
  padding: 0.375rem; border-radius: 8px; font-size: 1.125rem; transition: color .15s; }
.notif-btn:hover { color: #E2E8F0; }
.notif-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px;
  background: #EF4444; color: white; font-size: 0.625rem; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1; }
.notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 340px;
  background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5); z-index: 200; overflow: hidden; }
.notif-panel-header { display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1rem; border-bottom: 1px solid #334155; }
.notif-panel-title { font-size: 0.875rem; font-weight: 600; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 0.75rem; padding: 0.75rem 1rem;
  border-bottom: 1px solid #1E293B; cursor: pointer; transition: background .15s; }
.notif-item:hover { background: #0F172A; }
.notif-item.unread { background: rgba(239,159,39,.05); }
.notif-item.unread .notif-dot { opacity: 1; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #EF9F27; flex-shrink: 0; margin-top: 5px; opacity: 0; }
.notif-msg { font-size: 0.8125rem; color: #CBD5E1; line-height: 1.45; }
.notif-time { font-size: 0.75rem; color: #64748B; margin-top: 2px; }
.notif-empty { padding: 2rem 1rem; text-align: center; color: #64748B; font-size: 0.875rem; }
.notif-wrap { position: relative; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn .15s ease; }
.modal { background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid #334155; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: #64748B; cursor: pointer; font-size: 1.25rem; padding: 2px; }
.modal-close:hover { color: #E2E8F0; }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.5rem; border-top: 1px solid #334155; }
.assignee-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.assignee-chip { display: flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem;
  background: #0F172A; border: 1px solid #334155; border-radius: 999px;
  font-size: 0.8125rem; cursor: pointer; transition: border-color .15s; }
.assignee-chip.selected { border-color: #EF9F27; color: #EF9F27; }

/* ── Admin Panel ── */
.admin-wrap { padding: 1.5rem; max-width: 900px; }
.admin-section { margin-bottom: 2rem; }
.admin-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #CBD5E1; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; font-size: 0.75rem; font-weight: 600; color: #64748B;
  padding: 0.625rem 1rem; border-bottom: 1px solid #334155; text-transform: uppercase; letter-spacing: .06em; }
.users-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #1E293B; font-size: 0.875rem; vertical-align: middle; }
.status-pill { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pill.active { background: rgba(52,211,153,.15); color: #34D399; }
.status-pill.inactive { background: rgba(100,116,139,.15); color: #64748B; }

/* ── Tasks tab / Dashboard ── */
.tasks-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.5rem;
  flex-wrap: wrap; background: #0F172A; border-bottom: 1px solid #1E293B; }

.dashboard-wrap { padding: 1.5rem; max-width: 1200px; }

/* Stats row */
.stats-row { display: flex; gap: .875rem; flex-wrap: wrap; margin-bottom: 2rem; }
.stat-card { background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  padding: 1.25rem 1.5rem; flex: 1; min-width: 110px; }
.stat-card.stat-main { min-width: 200px; flex: 2; }
.stat-card.stat-status { cursor: pointer; transition: border-color .15s; }
.stat-card.stat-status:hover { border-color: #475569; }
.stat-number { font-size: 2rem; font-weight: 700; color: #E2E8F0; line-height: 1; }
.stat-denom { font-size: 1rem; font-weight: 400; color: #64748B; }
.stat-label { font-size: .8125rem; color: #64748B; margin-top: .375rem; }
.stat-progress-wrap { background: #334155; border-radius: 999px; height: 6px; margin: .875rem 0 .375rem; overflow: hidden; }
.stat-progress-bar { height: 100%; background: #34D399; border-radius: 999px; transition: width .4s ease; }
.stat-progress-label { font-size: .75rem; color: #64748B; }

/* Status sections */
.status-section { margin-bottom: 1rem; border: 1px solid #334155; border-radius: 12px; overflow: hidden; }
.section-header { display: flex; align-items: center; gap: .75rem; padding: .875rem 1.25rem;
  cursor: pointer; background: #1E293B; transition: background .15s; user-select: none; }
.section-header:hover { background: #243043; }
.section-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.section-status-name { font-size: .9375rem; font-weight: 600; color: #CBD5E1; flex: 1; }
.section-count { font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.section-chevron { font-size: .75rem; color: #64748B; margin-left: .25rem; }
.section-body { background: #0F172A; }
.section-empty { padding: 1.5rem; text-align: center; color: #475569; font-size: .875rem; }

/* Table inside sections */
.tasks-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.tasks-table th { text-align: left; font-size: .75rem; font-weight: 600; color: #64748B;
  padding: .625rem 1rem; border-bottom: 1px solid #334155; text-transform: uppercase; letter-spacing: .06em; }
.tasks-table td { padding: .625rem 1rem; border-bottom: 1px solid #1E293B; font-size: .875rem; vertical-align: middle; }
.tasks-table tbody tr:last-child td { border-bottom: none; }
.tasks-table tr:hover td { background: rgba(255,255,255,.02); }
.task-list-title { font-weight: 500; color: #E2E8F0; max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-label { font-size: .75rem; font-weight: 600; padding: .15rem .45rem; border-radius: 4px; }
.prio-label.prio-haute   { background: rgba(239,68,68,.15); color: #EF4444; }
.prio-label.prio-moyenne { background: rgba(239,159,39,.15); color: #EF9F27; }
.prio-label.prio-basse   { background: rgba(71,85,105,.15); color: #94A3B8; }
.overdue-text { color: #EF4444; font-weight: 500; }

/* ── Board management ── */
.board-mgmt-list { display: flex; flex-direction: column; gap: .5rem; max-width: 480px; }
.board-mgmt-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem;
  background: #0F172A; border: 1px solid #334155; border-radius: 8px; }
.board-mgmt-name { flex: 1; font-size: .875rem; color: #CBD5E1; font-weight: 500; }

/* ── Category management ── */
.cat-mgmt-list { display: flex; flex-direction: column; gap: .5rem; max-width: 480px; }
.cat-mgmt-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem;
  background: #0F172A; border: 1px solid #334155; border-radius: 8px; }
.cat-color-swatch { width: 32px; height: 30px; padding: 2px; cursor: pointer; flex-shrink: 0;
  border-radius: 6px; border: 1px solid #334155; background: #0F172A; }
.cat-mgmt-name { flex: 1; font-size: .875rem; color: #CBD5E1; }
.cat-mgmt-grip { color: #475569; cursor: grab; font-size: .875rem; flex-shrink: 0; }
.cat-mgmt-grip:active { cursor: grabbing; }

/* ── Column management ── */
.status-mgmt-list { display: flex; flex-direction: column; gap: .5rem; max-width: 420px; }
.status-mgmt-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem;
  background: #0F172A; border: 1px solid #334155; border-radius: 8px; }
.status-mgmt-grip { color: #475569; cursor: default; font-size: .875rem; }
.status-mgmt-name { flex: 1; font-size: .875rem; color: #CBD5E1; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { background: #1E293B; border: 1px solid #334155; border-radius: 10px;
  padding: .75rem 1.25rem; font-size: .875rem; color: #E2E8F0;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slideUp .2s ease;
  pointer-events: all; display: flex; align-items: center; gap: .625rem; }
.toast.success { border-left: 3px solid #34D399; }
.toast.error   { border-left: 3px solid #EF4444; }

/* ── Offline Banner ── */
.offline-banner { position: fixed; top: 0; left: 0; right: 0; background: #7F1D1D;
  color: #FCA5A5; text-align: center; font-size: 0.8125rem; padding: .5rem;
  z-index: 600; display: none; }
.offline-banner.visible { display: block; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0F172A; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .filters-bar { padding: .75rem 1rem; gap: .5rem; }
  .board-wrap { padding: 1rem; }
  .notif-panel { width: 300px; }
}
