/* ============================================================
   public/assets/css/app.css
   Styles personnalisés CDO Formation (complète Bootstrap)
   ============================================================ */

/* ─── Variables couleurs ─── */
:root {
  --cdo-blue:        #1a56db;
  --cdo-blue-dark:   #1e429f;
  --cdo-sidebar:     #0f172a;
  --cdo-sidebar-h:   #1e293b;
}

/* ─── Body & base ─── */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f8fafc; color: #1e293b; font-size: 14px; }

/* ─── Shell applicatif ─── */
.app-shell      { display: flex; min-height: 100vh; }
.main-content   { flex: 1; display: flex; flex-direction: column; margin-left: 240px; }
.page-content   { flex: 1; padding: 24px; }

/* ─── Sidebar ─── */
.sidebar        { width: 240px; background: var(--cdo-sidebar); flex-shrink: 0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-brand  { padding: 16px 20px; border-bottom: 1px solid #1e293b; display: flex; align-items: center; gap: 10px; }
.brand-logo-wrap{ width: 36px; height: 36px; border-radius: 8px; overflow: hidden; background: #1e293b; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name     { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3; }
.brand-name span{ color: #60a5fa; }
.brand-sub      { font-size: 11px; color: #64748b; }
.sidebar-user   { padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #1e293b; transition: background .15s; }
.sidebar-user:hover { background: var(--cdo-sidebar-h); }
.sb-av          { width: 34px; height: 34px; border-radius: 50%; background: var(--cdo-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.sb-av img      { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sb-name        { font-size: 13px; font-weight: 500; color: #e2e8f0; }
.sb-role-txt    { font-size: 11px; color: #64748b; }
.sidebar-nav    { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section    { font-size: 10px; color: #475569; text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px 4px; font-weight: 600; }
.nav-item       { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #94a3b8; font-size: 13px; cursor: pointer; margin-bottom: 2px; transition: all .15s; text-decoration: none; }
.nav-item:hover { background: var(--cdo-sidebar-h); color: #e2e8f0; }
.nav-item.active{ background: var(--cdo-blue); color: #fff; font-weight: 500; }
.nav-item i     { font-size: 16px; width: 18px; text-align: center; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid #1e293b; }
.btn-logout-side{ display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; color: #f87171; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .15s; }
.btn-logout-side:hover { background: var(--cdo-sidebar-h); color: #fca5a5; }

/* ─── Topbar ─── */
.topbar       { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-logo  { height: 32px; max-width: 120px; object-fit: contain; }
.topbar-title { font-size: 16px; font-weight: 600; color: #0f172a; }
.topbar-sub   { font-size: 12px; color: #64748b; margin-top: 1px; }

/* ─── Login ─── */
.login-screen     { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--cdo-sidebar); }
.login-card       { background: #fff; border-radius: 16px; padding: 2.5rem; width: 420px; max-width: 96vw; }
.login-logo-area  { text-align: center; margin-bottom: 20px; }
.text-logo        { font-size: 24px; font-weight: 800; color: #0f172a; }
.text-logo span   { color: var(--cdo-blue); }
.login-sub        { color: #64748b; font-size: 13px; margin-bottom: 24px; text-align: center; }
.lf label         { font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 5px; display: block; }
.lf input         { width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; color: #0f172a; outline: none; margin-bottom: 14px; transition: border .15s; }
.lf input:focus   { border-color: var(--cdo-blue); box-shadow: 0 0 0 3px #dbeafe; }
.btn-login        { width: 100%; padding: 11px; background: var(--cdo-blue); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-login:hover  { background: var(--cdo-blue-dark); }

/* ─── Formulaires ─── */
.fl label             { font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 5px; display: block; }
.fl input, .fl select, .fl textarea { width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #0f172a; outline: none; background: #fff; transition: border .15s; }
.fl input:focus, .fl select:focus, .fl textarea:focus { border-color: var(--cdo-blue); box-shadow: 0 0 0 3px #dbeafe; }
.input-eye            { position: relative; }
.input-eye input      { padding-right: 36px; }
.input-eye .eye-btn   { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 16px; padding: 0; }
.cred-box             { background: #eff6ff; border-left: 3px solid var(--cdo-blue); border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 13px; margin-top: 12px; color: #1e429f; }

/* ─── Boutons ─── */
.btn-p        { background: var(--cdo-blue); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s; }
.btn-p:hover  { background: var(--cdo-blue-dark); color: #fff; }
.btn-o        { background: #fff; color: #374151; border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: all .15s; }
.btn-o:hover  { background: #f8fafc; color: #374151; }
.btn-success  { background: #059669; color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; }
.btn-success:hover { background: #047857; }
.btn-warn     { background: #fff; color: #d97706; border: 1px solid #fde68a; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.btn-warn:hover { background: #fef9c3; }
.btn-edit     { background: #fff; color: #374151; border: 1px solid #e2e8f0; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn-edit:hover { background: #f1f5f9; color: #374151; }
.btn-del      { background: #fff; color: #ef4444; border: 1px solid #fecaca; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.btn-del:hover { background: #fee2e2; }
.btn-danger-full { background: #ef4444; color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }

/* ─── Stat cards ─── */
.stat-card  { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; }
.stat-icon  { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.stat-val   { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1; margin-bottom: 4px; }
.stat-lbl   { font-size: 12px; color: #64748b; }

/* ─── Tables ─── */
.tbl-card           { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.tbl-card table     { margin: 0; font-size: 13px; }
.tbl-card thead th  { background: #f8fafc; border-bottom: 1px solid #e2e8f0; color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 10px 14px; white-space: nowrap; }
.tbl-card tbody td  { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #374151; }
.tbl-card tbody tr:last-child td { border-bottom: none; }
.tbl-card tbody tr:hover td { background: #f8fafc; }
.tbl-card tbody tr.clickable:hover td { background: #eff6ff; cursor: pointer; }
.tbl-card-header    { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; }
.tbl-card-header h4 { font-size: 14px; font-weight: 600; color: #0f172a; margin: 0; }

/* ─── Profil cards ─── */
.profil-card    { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 24px; margin-bottom: 20px; }
.profil-card h4 { font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: 8px; }

/* ─── Pills ─── */
.pill    { display: inline-block; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.p-blue  { background: #dbeafe; color: #1e429f; }
.p-green { background: #d1fae5; color: #065f46; }
.p-amber { background: #fef3c7; color: #92400e; }
.p-red   { background: #fee2e2; color: #991b1b; }
.p-purple{ background: #ede9fe; color: #5b21b6; }
.p-teal  { background: #ccfbf1; color: #134e4a; }
.p-gray  { background: #f1f5f9; color: #475569; }

/* ─── Breadcrumb ─── */
.bc      { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #94a3b8; margin-bottom: 18px; flex-wrap: wrap; }
.bc a    { color: var(--cdo-blue); text-decoration: none; }
.bc a:hover { text-decoration: underline; }

/* ─── Section header ─── */
.section-hdr   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.section-hdr h3 { font-size: 14px; font-weight: 600; color: #374151; margin: 0; }

/* ─── Session cards ─── */
.sess-card        { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; transition: border-color .15s, box-shadow .15s; text-decoration: none; display: block; color: inherit; }
.sess-card:hover  { border-color: var(--cdo-blue); box-shadow: 0 0 0 3px #dbeafe; color: inherit; }
.sess-meta        { font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

/* ─── Empty state ─── */
.empty-st   { text-align: center; padding: 40px 20px; color: #94a3b8; }
.empty-st i { font-size: 32px; margin-bottom: 10px; display: block; }

/* ─── Charts (donut + barres) ─── */
.chart-card   { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; }
.chart-card h6 { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.donut-wrap   { position: relative; width: 90px; height: 90px; }
.donut-wrap svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-pct    { font-size: 17px; font-weight: 700; color: #0f172a; }
.donut-lbl    { font-size: 10px; color: #94a3b8; }
.bar-row      { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.bar-label    { width: 90px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.bar-track    { flex: 1; height: 10px; background: #f1f5f9; border-radius: 9999px; overflow: hidden; }
.bar-fill     { height: 100%; border-radius: 9999px; }
.bar-val      { width: 24px; text-align: right; color: #94a3b8; font-size: 11px; flex-shrink: 0; }

/* ─── Logo upload ─── */
.logo-upload-zone       { border: 2px dashed #e2e8f0; border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: all .2s; background: #fafbfc; position: relative; }
.logo-upload-zone:hover { border-color: var(--cdo-blue); background: #eff6ff; }
.logo-upload-zone.has-logo { border-style: solid; border-color: var(--cdo-blue); background: #eff6ff; padding: 16px; }
.logo-preview           { max-height: 80px; max-width: 200px; object-fit: contain; margin: 0 auto; display: block; }
.logo-upload-label      { font-size: 13px; font-weight: 500; color: var(--cdo-blue); margin-bottom: 6px; }
.logo-upload-hint       { font-size: 12px; color: #94a3b8; margin-top: 8px; }

/* ─── Alertes messages ─── */
.alert-card    { border-radius: 12px; border: none; padding: 16px 18px; margin-bottom: 10px; }
.alert-unread  { background: #eff6ff; border-left: 3px solid var(--cdo-blue); }
.alert-read    { background: #f8fafc; border-left: 3px solid #e2e8f0; }
.alert-urgent  { background: #fef2f2; border-left: 3px solid #ef4444; }

/* ─── Detail banner ─── */
.detail-banner { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 22px; margin-bottom: 20px; }
.db-lbl        { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.db-val        { font-size: 14px; font-weight: 600; color: #0f172a; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
}
