/* ============================================================
   Adopt[IA] Agency OS — Design System
   Shared stylesheet — v1.0
   ============================================================ */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ─── 1. Reset minimal ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ─── 2. Variables ──────────────────────────────────────────── */
:root {
  --bg: #0A0E14;
  --surface: rgba(255,255,255,0.045);
  --surface-hover: rgba(255,255,255,0.075);
  --border: rgba(0,214,138,0.14);
  --border-subtle: rgba(255,255,255,0.07);
  --green: #00D68A;
  --green-dim: rgba(0,214,138,0.13);
  --text: #FFFFFF;
  --muted: rgba(255,255,255,0.55);
  --dim: rgba(255,255,255,0.28);
  --wine: #9B2D4F;
  --magenta: #FF2D6F;
  --orange: #FF8C42;
  --chloro: #4FE07A;
  --indigo: #3D4F9B;
  --slate: #8090A8;
  --yellow: #FFD23F;
  --red: #FF4D4D;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
}

/* ─── 3. Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ─── 4. Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(10,14,20,0.97);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  padding: 20px 0 16px;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.sidebar-brand .brand-icon {
  width: 34px;
  height: 34px;
  background: var(--green-dim);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.sidebar-brand .brand-name span {
  color: var(--green);
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Nav groups */
.nav-group {
  margin-bottom: 4px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--dim);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 16px 20px 6px;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--green-dim);
  color: var(--green);
  border-left-color: var(--green);
  font-weight: 600;
}

.nav-item .ni {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Colored nav icons via --ac variable */
.nav-item.nav-audit { --ac: var(--orange); }
.nav-item.nav-audit .ni { color: var(--ac); }
.nav-item.nav-clients .ni { color: var(--indigo); }
.nav-item.nav-tasks .ni { color: var(--yellow); }
.nav-item.nav-okr .ni { color: var(--chloro); }
.nav-item.nav-pipeline .ni { color: var(--magenta); }
.nav-item.nav-settings .ni { color: var(--slate); }

.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: var(--dim);
  padding: 1px 7px;
  border-radius: 99px;
}

.nav-item.active .nav-count {
  background: var(--green-dim);
  color: var(--green);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid var(--border-subtle);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

.user-pill .av-group {
  display: flex;
  gap: 4px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  border: 1.5px solid transparent;
  flex-shrink: 0;
}

.avatar.av-v { background: rgba(0,214,138,0.18); color: var(--green); }
.avatar.av-m { background: rgba(255,140,66,0.18); color: var(--orange); }

.avatar.active {
  border-color: currentColor;
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

.avatar:hover:not(.active) { opacity: 0.8; }

/* Avatar taille 32px standard */
.avatar-32 {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.user-pill .av-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.user-pill .av-role {
  font-size: 10.5px;
  color: var(--dim);
}

/* ─── 5. Page wrap ──────────────────────────────────────────── */
.page-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 32px 36px;
  animation: fadeIn 0.25s ease;
}

/* ─── 6. Page header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header-left h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.page-header-left .page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ─── 7. Stats row ──────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ac, var(--green));
  opacity: 0.5;
}

.stat-card:hover {
  background: var(--surface-hover);
  border-color: rgba(0,214,138,0.22);
}

.stat-card .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.stat-card .stat-icon {
  font-size: 18px;
  opacity: 0.7;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card .stat-delta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-delta.positive { color: var(--green); }
.stat-delta.negative { color: var(--red); }

/* ─── 8. Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.card-header .card-header-meta {
  font-size: 12px;
  color: var(--dim);
}

.card-body {
  padding: 16px 22px;
}

/* ─── 9. Badges — base ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.4;
}

/* Status badges */
.badge-todo       { background: rgba(128,144,168,0.15); color: var(--slate); }
.badge-in-progress, .badge-inprogress { background: rgba(61,79,155,0.2); color: #7B8FD4; }
.badge-review     { background: rgba(255,140,66,0.15); color: var(--orange); }
.badge-done       { background: rgba(0,214,138,0.13); color: var(--green); }
.badge-prospect   { background: rgba(128,144,168,0.15); color: var(--slate); }
.badge-active     { background: rgba(0,214,138,0.13); color: var(--green); }
.badge-livré      { background: rgba(61,79,155,0.2); color: #7B8FD4; }
.badge-maintenance{ background: rgba(155,45,79,0.2); color: #D4607F; }

/* Priority badges */
.badge-urgent  { background: rgba(255,77,77,0.15); color: var(--red); }
.badge-high    { background: rgba(255,140,66,0.15); color: var(--orange); }
.badge-medium  { background: rgba(255,210,63,0.12); color: var(--yellow); }
.badge-low     { background: rgba(128,144,168,0.12); color: var(--slate); }

/* Offer badges */
.badge-dashboard { background: rgba(0,214,138,0.13); color: var(--green); }
.badge-site      { background: rgba(61,79,155,0.2); color: #7B8FD4; }
.badge-app       { background: rgba(79,224,122,0.13); color: var(--chloro); }
.badge-care      { background: rgba(155,45,79,0.18); color: #D4607F; }
.badge-funnel    { background: rgba(255,140,66,0.15); color: var(--orange); }
.badge-studio    { background: rgba(255,45,111,0.15); color: var(--magenta); }

/* ─── 10. Progress bar ──────────────────────────────────────── */
.progress-bar {
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  background: rgba(255,255,255,0.35);
  border-radius: 99px;
}

/* ─── 11. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  outline: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--green);
  color: #0A0E14;
  border-color: var(--green);
}
.btn-primary:hover { background: #00f09d; border-color: #00f09d; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-subtle);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: rgba(255,255,255,0.12); }

.btn-sm { padding: 5px 11px; font-size: 12px; }

.btn-icon {
  background: transparent;
  color: var(--dim);
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }

/* ─── 12. Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #111620;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.2s ease;
}

.modal-lg { max-width: 700px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.modal-header .modal-close {
  background: transparent;
  border: none;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── 13. Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
textarea,
select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: 'Manrope', sans-serif;
  padding: 9px 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--green);
  background: rgba(0,214,138,0.05);
  box-shadow: 0 0 0 3px rgba(0,214,138,0.08);
}

input::placeholder, textarea::placeholder {
  color: var(--dim);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238090A8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ─── 14. Deadline badges ───────────────────────────────────── */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.deadline-badge.overdue { background: rgba(255,77,77,0.15); color: var(--red); }
.deadline-badge.today   { background: rgba(255,210,63,0.15); color: var(--yellow); }
.deadline-badge.soon    { background: rgba(255,140,66,0.15); color: var(--orange); }

/* ─── 15. Task item ─────────────────────────────────────────── */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
  border-radius: var(--radius-sm);
  padding-left: 10px;
  padding-right: 10px;
  margin: 0 -10px;
}

.task-item:last-child { border-bottom: none; }

.task-item:hover { background: var(--surface-hover); }

.task-item .task-left { flex: 1; min-width: 0; }
.task-item .task-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.task-item .task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-item .task-client {
  font-size: 11.5px;
  color: var(--dim);
}

.task-item .task-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

/* ─── 16. Milestone item ────────────────────────────────────── */
.milestone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.milestone-item:last-child { border-bottom: none; }

.milestone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.milestone-dot.urgent { background: var(--red); }
.milestone-dot.soon   { background: var(--orange); }

.milestone-item .ms-content { flex: 1; min-width: 0; }
.milestone-item .ms-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.milestone-item .ms-client {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 1px;
}
.milestone-item .ms-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

/* ─── 17. Project card ──────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.project-card:hover {
  background: var(--surface-hover);
  border-color: rgba(0,214,138,0.25);
  transform: translateY(-1px);
}

.project-card .pc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card .pc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.project-card .pc-sector {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 2px;
}

.project-card .pc-okr {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-card .pc-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-card .pc-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.project-card .pc-progress-labels .label { color: var(--muted); }
.project-card .pc-progress-labels .pct {
  font-weight: 700;
  color: var(--green);
}

.project-card .pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-card .pc-budget {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.project-card .pc-budget span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

/* ─── 18. Section dividers ──────────────────────────────────── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ─── 19. Separator ─────────────────────────────────────────── */
.sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

/* ─── 20. Empty state ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 8px;
  text-align: center;
}

.empty-state .empty-icon { font-size: 28px; opacity: 0.4; }
.empty-state .empty-text { font-size: 13px; color: var(--muted); }

/* ─── 21. Animations ────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── 22. Utility classes ───────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-muted  { color: var(--muted); }
.text-dim    { color: var(--dim); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-orange { color: var(--orange); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
