/* ═══════════════════════════════════════════════════════════
   Concept'Immo — Design System
   Palette terracotta/sable, typographie éditoriale
   ═══════════════════════════════════════════════════════════ */

:root {
  --terra: #B85042;
  --terra-light: #D4826A;
  --terra-bg: #fdf5f3;
  --dark: #3B2F2F;
  --sand: #F5F3EB;
  --sand-dark: #E7E8D1;
  --sage: #A7BEAE;
  --sage-dark: #7FA08B;
  --white: #FFFFFF;
  --gray: #8A8580;
  --gray-light: #C8C3BC;
  --gray-lighter: #EDEBE7;
  --text: #3B2F2F;
  --text-muted: #7A7068;
  --blue: #5B8FA8;
  --amber: #C4933F;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --sidebar-w: 260px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(59,47,47,0.06), 0 4px 12px rgba(59,47,47,0.04);
  --shadow-hover: 0 2px 8px rgba(59,47,47,0.1), 0 8px 24px rgba(59,47,47,0.06);
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--sand);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── SIDEBAR ─────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-mark {
  width: 40px;
  height: 40px;
  background: var(--terra);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--gray); margin-top: 1px; }

.sidebar-nav {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: var(--white);
  background: rgba(184,80,66,0.3);
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--sage-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--gray); }

/* ─── MAIN ────────────────────────────────────────────── */

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0 40px 40px;
  max-width: 1200px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--gray-lighter);
  margin-bottom: 28px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── STATS ───────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

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

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-terra { background: var(--terra-bg); color: var(--terra); }
.stat-icon-sage { background: #eef4f0; color: var(--sage-dark); }
.stat-icon-blue { background: #edf4f7; color: var(--blue); }
.stat-icon-amber { background: #fdf6ec; color: var(--amber); }

.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ─── CARDS ───────────────────────────────────────────── */

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-large { grid-column: 1; }

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

.card-header h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
}

.card-body { padding: 24px; }

/* ─── EMPTY STATE ─────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state svg { margin-bottom: 16px; color: var(--gray-light); }
.empty-state p { font-size: 14px; color: var(--text-muted); }
.empty-hint { font-size: 13px; color: var(--gray); margin-top: 6px; }

/* ─── ACTION BUTTONS ──────────────────────────────────── */

.action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-lighter);
  border-radius: 6px;
  background: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 8px;
  text-align: left;
  position: relative;
}

.action-btn:hover:not(:disabled) {
  border-color: var(--terra-light);
  background: var(--terra-bg);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-primary {
  background: var(--terra);
  color: var(--white);
  border-color: var(--terra);
}

.action-primary:hover:not(:disabled) {
  background: #a3453a;
  border-color: #a3453a;
}

.action-primary svg { opacity: 0.9; }

.badge-soon {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  background: var(--gray-lighter);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── TELEGRAM CARD ───────────────────────────────────── */

.telegram-card { border: 1px solid #e3edf3; }

.telegram-body {
  display: flex;
  align-items: center;
  gap: 20px;
}

.telegram-icon {
  width: 52px;
  height: 52px;
  background: #e3edf3;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2AABEE;
  flex-shrink: 0;
}

.telegram-content { flex: 1; }
.telegram-content h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.telegram-content p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.telegram-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #2AABEE;
  color: var(--white);
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.telegram-btn:hover { background: #229ED9; }

/* ─── UPLOAD ZONE ─────────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--gray-light);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--terra);
  background: var(--terra-bg);
}

.upload-zone svg { color: var(--gray-light); margin-bottom: 12px; }
.upload-zone:hover svg { color: var(--terra-light); }
.upload-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-hint { font-size: 13px; color: var(--text-muted); }
.upload-formats { font-size: 11px; color: var(--gray); margin-top: 12px; }

/* ─── UPLOAD FORM ─────────────────────────────────────── */

.upload-form { margin-top: 20px; }

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--sand);
  border-radius: 6px;
  margin-bottom: 20px;
}

.file-preview svg { color: var(--terra); flex-shrink: 0; }
.file-info { display: flex; flex-direction: column; flex: 1; }
.file-name { font-size: 14px; font-weight: 600; }
.file-size { font-size: 12px; color: var(--text-muted); }

.file-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--gray);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-remove:hover { background: var(--gray-lighter); color: var(--terra); }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-lighter);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s ease;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--terra);
}

.form-group textarea { resize: vertical; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--terra);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover { background: #a3453a; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--gray-lighter);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--terra);
  color: var(--terra);
}

/* ─── PROCESSING ──────────────────────────────────────── */

.processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.processing-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-lighter);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 28px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.processing-steps { width: 100%; max-width: 400px; }

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--gray);
}

.step.active { color: var(--text); font-weight: 500; }
.step.done { color: var(--sage-dark); }

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

.step.active .step-dot { background: var(--terra); animation: pulse 1.5s ease infinite; }
.step.done .step-dot { background: var(--sage-dark); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ─── VIEWS ───────────────────────────────────────────── */

.view { display: none; }
.view.active { display: block; }

/* ─── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0 16px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .telegram-body { flex-direction: column; text-align: center; }
}
