/*static/css/main.css 
*/
/* =========================================
   DiackPain — CSS Global
   ========================================= */

/* Variables */
:root {
  --bg-dark:      #1C1B2E;
  --gold:         #EEA922;
  --gold-light:   #FEF3C7;
  --green:        #1D9E75;
  --green-light:  #E1F5EE;
  --red:          #C62828;
  --red-light:    #FCEBEB;
  --orange:       #D85A30;
  --orange-light: #FAECE7;
  --purple:       #3C3489;
  --purple-light: #EDE9FE;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --border:       #e5e7eb;
  --bg-secondary: #f9fafb;
  --radius:       12px;
  --radius-sm:    8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f3f4f6;
  color: var(--text-primary);
  min-height: 100vh;
}

/* =========================================
   MESSAGES
   ========================================= */
.messages-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 1000; display: flex; flex-direction: column; gap: 8px;
  max-width: 340px;
}
.message {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.message-success { background: var(--green-light); color: #065f46; border: 0.5px solid #6ee7b7; }
.message-error   { background: var(--red-light);   color: #7f1d1d; border: 0.5px solid #fca5a5; }
.message-warning { background: var(--gold-light);  color: #78350f; border: 0.5px solid #fcd34d; }
.message-info    { background: #e0f2fe; color: #0c4a6e; border: 0.5px solid #7dd3fc; }
.message-close   { background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.6; }
.message-close:hover { opacity: 1; }

/* =========================================
   LOGIN
   ========================================= */
.login-screen {
  min-height: 100vh;
  background: var(--bg-dark);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 20px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
  width: 64px; height: 64px; background: var(--gold);
  border-radius: 16px; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 14px; font-size: 28px; color: var(--bg-dark);
}
.login-logo-name { font-size: 24px; font-weight: 600; color: var(--gold); }
.login-logo-sub  { font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 4px; }

.login-card {
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%; max-width: 360px;
}
.login-card-title { font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.login-card-sub   { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 24px; }

/* Champs formulaire */
.form-field { margin-bottom: 16px; }
.form-label { font-size: 11px; color: rgba(255,255,255,0.5); display: block; margin-bottom: 6px; }
.form-input-wrap { position: relative; }
.form-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.35); font-size: 16px; pointer-events: none;
}
.form-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.35); font-size: 16px; cursor: pointer;
}
.form-eye:hover { color: rgba(255,255,255,0.7); }
.form-input-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 11px 38px;
  font-size: 14px; color: #fff; outline: none;
  transition: border-color 0.15s;
}
.form-input-wrap input::placeholder { color: rgba(255,255,255,0.25); }
.form-input-wrap input:focus { border-color: rgba(238,169,34,0.6); }
.form-error { font-size: 11px; color: #fca5a5; margin-top: 4px; display: block; }

.btn-login {
  width: 100%; padding: 13px;
  background: var(--gold); color: var(--bg-dark);
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  margin-top: 8px; transition: opacity 0.15s;
}
.btn-login:hover { opacity: 0.9; }

.login-forgot {
  text-align: center; margin-top: 14px;
  font-size: 12px; color: rgba(255,255,255,0.35);
}
.login-forgot span { color: var(--gold); cursor: pointer; }
.login-divider {
  height: 0.5px; background: rgba(255,255,255,0.08); margin: 20px 0;
}
.login-roles-title {
  font-size: 11px; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px;
}
.login-roles { display: flex; flex-direction: column; gap: 8px; }
.login-role {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
}
.role-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dot-patron   { background: var(--gold); }
.dot-gest     { background: var(--green); }
.dot-distrib  { background: var(--purple); }
.dot-boutique { background: var(--orange); }
.role-name { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.7); }
.role-desc { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 1px; }

/* =========================================
   TOPBAR
   ========================================= */
.topbar {
  background: var(--bg-dark);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-left .app-name  { font-size: 15px; font-weight: 600; color: var(--gold); }
.topbar-left .app-sub   { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.topbar-right .top-date { font-size: 13px; font-weight: 500; color: var(--gold); text-align: right; }
.topbar-right .top-day  { font-size: 11px; color: rgba(255,255,255,0.4); }

.role-bar {
  background: var(--bg-dark);
  padding: 0 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.role-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: rgba(238,169,34,0.15); color: var(--gold);
  border: 0.5px solid rgba(238,169,34,0.3);
}

/* =========================================
   BOTTOM NAV
   ========================================= */
.bottom-nav {
  background: #fff;
  border-top: 0.5px solid var(--border);
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 8px 2px; cursor: pointer;
  text-decoration: none; color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-item i    { font-size: 20px; }
.nav-item span { font-size: 9px; white-space: nowrap; }
.nav-item.active       { color: var(--bg-dark); }
.nav-item.active span  { font-weight: 600; }
.nav-item:hover        { color: var(--text-primary); }
.nav-item.nav-boutique { color: var(--orange); }

/* =========================================
   PAGE CONTENT
   ========================================= */
.page-body {
  padding: 14px;
  padding-bottom: 80px; /* espace pour bottom nav */
  min-height: 100vh;
}

/* Cartes */
.card {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.card-header {
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.card-title { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.card-body  { padding: 12px 14px; }

/* Badges statuts */
.badge {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  font-weight: 500; white-space: nowrap;
}
.badge-ok      { background: var(--green-light); color: #065f46; }
.badge-pending { background: var(--gold-light);  color: #78350f; }
.badge-reliquat{ background: var(--red-light);   color: #7f1d1d; }
.badge-absent  { background: #f3f4f6; color: var(--text-secondary); }
.badge-live    { background: #e0f2fe; color: #0c4a6e; }
.badge-done    { background: var(--green-light); color: #065f46; }

/* Boutons */
.btn-primary {
  background: var(--bg-dark); color: var(--gold);
  border: none; border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 0.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 12px; cursor: pointer;
}
.btn-secondary:hover { background: var(--bg-secondary); }
.btn-danger {
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
}

/* Recherche */
.search-zone { background: var(--bg-dark); padding: 0 14px 12px; }
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 36px; font-size: 13px; color: #fff;
}
.search-wrap input::placeholder { color: rgba(255,255,255,0.35); }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.4); font-size: 16px; pointer-events: none;
}

/* Filtres chips */
.filters {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 2px; margin-bottom: 12px;
}
.filter-chip {
  font-size: 11px; padding: 4px 12px; border-radius: 20px;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
}
.filter-chip.active {
  background: var(--bg-dark); color: var(--gold); border-color: var(--bg-dark);
}

/* Alertes */
.alert-bar {
  background: var(--gold-light); border: 0.5px solid #fcd34d;
  border-radius: var(--radius-sm); padding: 9px 12px;
  margin-bottom: 12px; display: flex; align-items: flex-start; gap: 8px;
}
.alert-bar i    { color: #78350f; font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-bar span { font-size: 12px; color: #78350f; line-height: 1.5; }

/* Avatars */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.av-patron  { background: var(--bg-dark); color: var(--gold); }
.av-distrib { background: var(--purple-light); color: var(--purple); }
.av-boutique{ background: var(--orange-light); color: var(--orange); }
.av-gest    { background: var(--green-light); color: var(--green); }
