/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #E2E8F0;
  --border-hover: #CBD5E1;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-dark: #1D4ED8;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --purple: #7C3AED;
  --purple-light: #EDE9FE;
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-active: #2563EB;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.5; }

/* =============================================
   LAYOUT
   ============================================= */
#app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
#sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width .2s;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-size: 16px; font-weight: 700;
  letter-spacing: -.3px;
}
.logo svg { color: var(--primary); flex-shrink: 0; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  color: var(--sidebar-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: all .15s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item.active svg { color: #fff; }
.nav-item svg { flex-shrink: 0; }

.nav-badge {
  margin-left: auto; background: rgba(255,255,255,.15);
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }
.nav-badge:empty { display: none; }

.sidebar-footer {
  padding: 12px 16px;
  color: rgba(255,255,255,.25); font-size: 11px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* MAIN CONTENT */
#main-content { flex: 1; overflow-y: auto; }
#view-container { min-height: 100%; }

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0;
  gap: 12px;
}
.page-header-left h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.page-header-left p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.page-content { padding: 20px 28px 32px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-ghost { background: transparent; color: var(--text-2); padding: 6px 8px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-icon { padding: 7px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; }
.btn-icon:hover { border-color: var(--border-hover); color: var(--text); }
.btn svg { flex-shrink: 0; }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

/* =============================================
   STATS
   ============================================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.stat-card .stat-label { font-size: 12px; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-3); }
.stat-card .stat-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }

/* =============================================
   CHANTIER CARDS
   ============================================= */
.chantiers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.chantier-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column;
}
.chantier-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.chantier-card-stripe { height: 4px; flex-shrink: 0; }
.chantier-card-body { padding: 16px; flex: 1; }
.chantier-card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.chantier-card-addr { font-size: 12px; color: var(--text-2); margin-bottom: 12px; display: flex; align-items: center; gap: 4px; }
.chantier-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chantier-card-footer { padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.chantier-card-actions { display: flex; gap: 6px; }
.chantier-progress { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.progress-bar { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .3s; }

/* =============================================
   STATUS & PRIORITY BADGES
   ============================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Chantier statuts */
.badge-planifie { background: #F1F5F9; color: #475569; }
.badge-planifie .badge-dot { background: #94A3B8; }
.badge-en-cours { background: var(--primary-light); color: var(--primary); }
.badge-en-cours .badge-dot { background: var(--primary); }
.badge-termine { background: var(--success-light); color: var(--success); }
.badge-termine .badge-dot { background: var(--success); }
.badge-suspendu { background: var(--warning-light); color: var(--warning); }
.badge-suspendu .badge-dot { background: var(--warning); }
.badge-bloque { background: var(--danger-light); color: var(--danger); }
.badge-bloque .badge-dot { background: var(--danger); }

/* Priorité */
.badge-basse { background: #F1F5F9; color: #64748B; }
.badge-normale { background: #EFF6FF; color: #3B82F6; }
.badge-haute { background: var(--warning-light); color: var(--warning); }
.badge-urgente { background: var(--danger-light); color: var(--danger); }

/* =============================================
   KANBAN
   ============================================= */
.kanban-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kanban-filter { display: flex; align-items: center; gap: 8px; }
.kanban-filter label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }

.kanban-col { border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.kanban-col-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.kanban-col-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kanban-col-count { background: var(--border); color: var(--text-2); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.kanban-col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; }

.task-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 12px; cursor: pointer; transition: all .15s;
}
.task-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.task-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.task-card-chantier { font-size: 11.5px; color: var(--text-2); margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.task-card-intervenants { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.task-card-interv-chip { background: var(--primary-light); color: var(--primary); font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 99px; }
.task-card-date { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 3px; }
.task-card-date.overdue { color: var(--danger); }

.kanban-col-add { padding: 0 12px 12px; }
.kanban-col-add button { width: 100%; padding: 8px; border-radius: var(--radius); border: 1px dashed var(--border); background: transparent; color: var(--text-3); cursor: pointer; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; }
.kanban-col-add button:hover { background: var(--surface); color: var(--text-2); border-color: var(--border-hover); }

/* =============================================
   INTERVENANTS
   ============================================= */
.intervenants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.intervenant-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: all .15s; cursor: pointer;
}
.intervenant-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.intervenant-card-top { display: flex; align-items: center; gap: 12px; }
.intervenant-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.intervenant-info { flex: 1; min-width: 0; }
.intervenant-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intervenant-role { font-size: 12px; color: var(--text-2); }
.intervenant-contact { display: flex; flex-direction: column; gap: 4px; }
.intervenant-contact-item { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.intervenant-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }

/* =============================================
   FORMS
   ============================================= */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.form-group small { font-size: 11.5px; color: var(--text-3); }
.form-control {
  padding: 8px 11px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13.5px; color: var(--text); transition: border-color .15s;
  width: 100%; outline: none; font-family: inherit;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

.checkbox-group { display: flex; flex-direction: column; gap: 8px; max-height: 160px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 4px 4px; border-radius: 4px; transition: background .1s; }
.checkbox-item:hover { background: var(--border); }
.checkbox-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }
.checkbox-item:empty { display: none; }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all .15s; }
.color-swatch.selected { border-color: var(--text); transform: scale(1.1); }

/* =============================================
   MODAL
   ============================================= */
#modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#modal-overlay.hidden { display: none; }
#modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 540px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  animation: modal-in .18s ease;
}
#modal.modal-lg { max-width: 680px; }
@keyframes modal-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
#modal-title { font-size: 16px; font-weight: 700; }
#modal-close { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: 6px; display: flex; align-items: center; transition: all .15s; }
#modal-close:hover { background: var(--bg); color: var(--text); }
#modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); }

/* =============================================
   TOAST
   ============================================= */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  animation: toast-in .2s ease;
  pointer-events: all; max-width: 320px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(20px); opacity: 0; } }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.empty-state-icon { width: 64px; height: 64px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-3); margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-2); max-width: 280px; }

/* =============================================
   SEARCH & FILTERS
   ============================================= */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); flex: 1; max-width: 300px; }
.search-box svg { color: var(--text-3); flex-shrink: 0; }
.search-box input { border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--text); width: 100%; }
.search-box input::placeholder { color: var(--text-3); }

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); transition: all .15s; cursor: pointer; }
.recent-item:hover { border-color: var(--primary-light); background: var(--primary-light); }
.recent-item-icon { width: 34px; height: 34px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.recent-item-info { flex: 1; min-width: 0; }
.recent-item-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-sub { font-size: 11.5px; color: var(--text-2); }

/* =============================================
   DETAIL VIEW
   ============================================= */
.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.back-btn { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; cursor: pointer; background: none; border: none; padding: 6px 0; transition: color .15s; }
.back-btn:hover { color: var(--primary); }
.detail-title { font-size: 20px; font-weight: 700; }

/* =============================================
   UTILITIES
   ============================================= */
.hidden { display: none !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.ml-auto { margin-left: auto; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-2); }
.fw-600 { font-weight: 600; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* =============================================
   LOGIN
   ============================================= */
#login-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#login-overlay.hidden { display: none; }

.login-card {
  background: var(--surface); border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
  padding: 36px 40px; width: 100%; max-width: 420px;
  animation: modal-in .25s ease;
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; color: var(--text);
  margin-bottom: 24px; letter-spacing: -.5px;
}
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 4px; }
.login-sub { font-size: 13.5px; color: var(--text-2); margin-bottom: 24px; }
.login-error {
  background: var(--danger-light); color: var(--danger);
  border: 1px solid #FECACA; border-radius: var(--radius);
  padding: 10px 12px; font-size: 13px; font-weight: 500; margin-bottom: 4px;
}
.login-footer { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 20px; }

.pw-wrapper { position: relative; }
.pw-wrapper .form-control { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 4px; display: flex; align-items: center; transition: color .15s;
}
.pw-toggle:hover { color: var(--text-2); }

/* =============================================
   SIDEBAR USER PROFILE
   ============================================= */
.sidebar-user {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 8px;
  flex-shrink: 0;
}
.sidebar-user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius);
  transition: background .15s;
}
.sidebar-user-card:hover { background: rgba(255,255,255,.06); }
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.4); }
.sidebar-logout {
  background: none; border: none; color: rgba(255,255,255,.35);
  cursor: pointer; padding: 6px; border-radius: 6px;
  display: flex; align-items: center; transition: all .15s; flex-shrink: 0;
}
.sidebar-logout:hover { background: rgba(255,255,255,.08); color: #fff; }

.nav-separator { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 6px 8px; }

/* =============================================
   USERS TABLE
   ============================================= */
.users-table { width: 100%; border-collapse: collapse; }
.users-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.users-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.users-table tr:last-child td { border-bottom: none; }
.users-table tbody tr { transition: background .1s; }
.users-table tbody tr:hover { background: var(--surface-2); }
.user-inactive { opacity: .55; }

/* =============================================
   PHOTOS
   ============================================= */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.photo-thumb {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: all .15s;
}
.photo-thumb:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo-thumb:hover img { transform: scale(1.05); }
.photo-thumb-del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.65); color: #fff; border: none;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.photo-thumb:hover .photo-thumb-del { opacity: 1; }
.photo-thumb-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff; font-size: 10px; padding: 12px 5px 4px;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-card-photo-preview {
  margin: -12px -12px 10px; height: 110px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}
.task-card-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-card-photo-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-3); font-weight: 500;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  #sidebar { width: 56px; }
  .logo span, .nav-item span, .sidebar-footer, .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .kanban-board { grid-template-columns: 1fr; }
  .page-header { padding: 16px 16px 0; }
  .page-content { padding: 14px 16px 24px; }
}
