/* ===========================
   O2Prod Services - Style
   Dark Gold Modern Design
=========================== */

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

:root {
  --gold: #c9a84c;
  --gold-light: #e4c46d;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --gold-border: rgba(201, 168, 76, 0.3);
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #18181f;
  --surface: #1c1c24;
  --surface2: #22222c;
  --border: rgba(255,255,255,0.06);
  --text: #e8e8f0;
  --text-dim: #888896;
  --text-muted: #555566;
  --offre: #3d9f6e;
  --offre-bg: rgba(61, 159, 110, 0.12);
  --demande: #5b7fd4;
  --demande-bg: rgba(91, 127, 212, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}
.logo-o2 { color: var(--gold); }
.logo-prod { color: var(--text); }
.logo-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 4px;
}
.nav { display: flex; align-items: center; gap: 16px; }
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }

/* ===== BUTTONS ===== */
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(201,168,76,0.35); }
.btn-gold.btn-large { font-size: 1rem; padding: 13px 32px; }
.btn-gold.btn-full { width: 100%; text-align: center; }

.btn-outline {
  color: var(--gold);
  border: 1px solid var(--gold-border);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 50px;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  display: inline-block;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--gold-dim); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  background: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(201,168,76,0.08) 0%, transparent 70%);
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 30%, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: var(--text-dim); font-size: 1rem; max-width: 500px; margin: 0 auto 24px; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 0.9rem; color: var(--text-dim); }
.hero-stats .stat { display: flex; align-items: center; gap: 6px; }
.hero-stats .stat span { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.stat-sep { color: var(--text-muted); }

/* ===== FILTERS ===== */
.filters-bar {
  margin: 30px 0 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.filters-form {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.type-toggle {
  display: flex;
  background: var(--bg3);
  border-radius: 50px;
  padding: 3px;
  gap: 0;
  flex-shrink: 0;
}
.toggle-btn {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.toggle-btn.active {
  background: var(--surface2);
  color: var(--text);
}
.toggle-btn.offre-btn.active { color: var(--offre); }
.toggle-btn.demande-btn.active { color: var(--demande); }

.filter-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}
.filter-right select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  min-width: 200px;
}
.filter-right select option { background: var(--bg2); }
.search-wrap {
  display: flex;
  flex: 1;
  min-width: 200px;
  gap: 0;
}
.search-wrap input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: inherit;
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus { outline: none; border-color: var(--gold-border); }
.search-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim);
  padding: 8px 14px;
  cursor: pointer;
}

/* ===== CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.card.offre::before { background: linear-gradient(90deg, var(--offre), transparent); }
.card.demande::before { background: linear-gradient(90deg, var(--demande), transparent); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-border); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  letter-spacing: 0.05em;
}
.badge-offre { background: var(--offre-bg); color: var(--offre); border: 1px solid rgba(61,159,110,0.3); }
.badge-demande { background: var(--demande-bg); color: var(--demande); border: 1px solid rgba(91,127,212,0.3); }
.badge-lg { font-size: 0.85rem; padding: 5px 14px; }

.card-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 4px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text);
}
.card-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}
.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.card-date {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text); }
.empty-state p { margin-bottom: 24px; }

/* ===== FORM PAGE ===== */
.form-page {
  padding: 50px 20px;
  min-height: calc(100vh - 160px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 680px;
}
.form-header { margin-bottom: 32px; }
.form-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.form-header p { color: var(--text-dim); font-size: 0.95rem; }

.form-group { margin-bottom: 22px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-group select option { background: var(--bg2); }

.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

/* Type radio */
.type-radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-radio { cursor: pointer; }
.type-radio input { display: none; }
.type-radio-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.2s;
}
.type-radio-icon { font-size: 1.5rem; }
.type-radio-title { font-size: 1rem; font-weight: 600; }
.type-radio-sub { font-size: 0.78rem; color: var(--text-muted); }
.demande-radio input:checked + .type-radio-inner {
  border-color: var(--demande);
  background: var(--demande-bg);
  box-shadow: 0 0 0 3px rgba(91,127,212,0.1);
}
.demande-radio input:checked + .type-radio-inner .type-radio-title { color: var(--demande); }
.offre-radio input:checked + .type-radio-inner {
  border-color: var(--offre);
  background: var(--offre-bg);
  box-shadow: 0 0 0 3px rgba(61,159,110,0.1);
}
.offre-radio input:checked + .type-radio-inner .type-radio-title { color: var(--offre); }

.form-submit { margin-top: 10px; text-align: center; }
.submit-note { margin-top: 10px; font-size: 0.8rem; color: var(--text-muted); }

.error-box {
  background: rgba(220, 60, 60, 0.12);
  border: 1px solid rgba(220,60,60,0.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: #f58080;
}

/* Success */
.success-box { text-align: center; padding: 20px 0; }
.success-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0a0a0f;
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-box h2 { font-size: 1.5rem; margin-bottom: 10px; }
.success-box p { color: var(--text-dim); max-width: 420px; margin: 0 auto 28px; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== DETAIL PAGE ===== */
.detail-page {
  padding: 40px 20px 60px;
  display: flex;
  justify-content: center;
}
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 720px;
}
.detail-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-cat {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg3);
  padding: 4px 12px;
  border-radius: 4px;
}
.detail-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}
.detail-meta {
  display: flex;
  gap: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detail-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.contact-box {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 32px;
}
.contact-box h3 { font-size: 1rem; margin-bottom: 8px; color: var(--gold); }
.contact-value { font-size: 1.05rem; font-weight: 500; }
.contact-value a { color: var(--gold); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== ADMIN ===== */
.admin-body { background: var(--bg); }
.admin-header {
  padding: 30px 0 0;
}
.admin-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 24px; }
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-count {
  font-size: 0.75rem;
  background: var(--bg3);
  border-radius: 50px;
  padding: 1px 7px;
  font-weight: 600;
}
.tab-count.approved { background: var(--offre-bg); color: var(--offre); }
.tab-count.rejected { background: rgba(220,60,60,0.15); color: #f58080; }

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 60px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table thead {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { background: var(--surface); transition: background 0.15s; }
.admin-table tbody tr:hover { background: var(--surface2); }
.admin-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  max-width: 260px;
}

.status-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  white-space: nowrap;
}
.status-attente { background: rgba(255,180,0,0.12); color: #f0b030; border: 1px solid rgba(255,180,0,0.25); }
.status-approuve { background: var(--offre-bg); color: var(--offre); border: 1px solid rgba(61,159,110,0.3); }
.status-rejete { background: rgba(220,60,60,0.12); color: #f58080; border: 1px solid rgba(220,60,60,0.25); }

.admin-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.action-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-dim);
}
.action-btn.approve { color: var(--offre); border-color: rgba(61,159,110,0.3); }
.action-btn.approve:hover { background: var(--offre-bg); }
.action-btn.reject { color: #f58080; border-color: rgba(220,60,60,0.3); }
.action-btn.reject:hover { background: rgba(220,60,60,0.12); }
.action-btn.delete { color: #f58080; }
.action-btn.delete:hover { background: rgba(220,60,60,0.12); }
.action-btn.view:hover { background: var(--gold-dim); color: var(--gold); }
.action-btn.restore:hover { background: var(--gold-dim); color: var(--gold); }

/* ===== LOGIN ===== */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-icon { font-size: 2.5rem; margin-bottom: 16px; }
.login-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.login-card > p { color: var(--text-muted); margin-bottom: 28px; font-size: 0.9rem; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  text-align: center;
  width: 100%;
  letter-spacing: 0.1em;
}
.login-form input:focus { outline: none; border-color: var(--gold-border); }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.footer .container { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer strong { color: var(--gold); }
.admin-link { color: var(--text-muted); text-decoration: none; font-size: 0.75rem; }
.admin-link:hover { color: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .filters-form { flex-direction: column; align-items: stretch; }
  .filter-right { flex-direction: column; }
  .filter-right select { min-width: unset; }
  .cards-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px; }
  .detail-card { padding: 24px; }
  .type-radio-group { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero { padding: 40px 20px 30px; }
  .header-inner { gap: 12px; }
  .logo-tag { display: none; }
}
