/* ============================================================
   GestAffaires – Espace client & administrateur
   Authentification, panneau de gestion (clients, factures,
   devis, contrats) et documents imprimables.
   ============================================================ */

/* ---------- Bouton compte dans l'en-tête ---------- */
.auth-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.auth-avatar svg { width: 18px; height: 18px; flex: none; }
.auth-avatar:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.auth-avatar.is-admin {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}
.auth-avatar.is-admin:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: #fff;
}

/* ---------- Modales d'authentification ---------- */
.modal-panel.modal-auth { max-width: 440px; }
.modal-sub { font-size: 14px; }
.auth-form { margin-top: 6px; }
.auth-error {
  font-size: 13px;
  color: #c0392b;
  background: #fdecea;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.auth-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.auth-switch { font-size: 14px; color: var(--muted); text-align: center; margin-top: 14px; }
.auth-switch a { font-weight: 600; }

/* ============================================================
   PANNEAU ESPACE (overlay plein écran)
   ============================================================ */
.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  overflow: hidden;
}
.admin-panel[hidden] { display: none; }

.admin-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: var(--navy-900);
  color: var(--white);
}
.admin-top-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.admin-logo { height: 42px; width: auto; flex: none; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px 4px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.admin-top-brand strong { font-size: 16px; color: var(--white); letter-spacing: 0.02em; }
.admin-role {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal);
  margin-top: 2px;
}
.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.admin-user { font-size: 13px; color: rgba(255, 255, 255, 0.85); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-btn {
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: var(--teal);
  color: var(--white);
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}
.admin-btn:hover { background: var(--teal-dark); }
.admin-btn:active { transform: scale(0.97); }
.admin-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--white);
}
.admin-btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }

.admin-nav {
  flex: none;
  display: flex;
  gap: 4px;
  padding: 10px 22px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.admin-nav[hidden] { display: none; }
.admin-tab {
  flex: none;
  padding: 9px 16px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.admin-tab:hover { background: var(--bg-soft); color: var(--ink); }
.admin-tab.active { background: var(--teal-soft); color: var(--teal-dark); }

.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 26px 22px 60px;
  -webkit-overflow-scrolling: touch;
}
.admin-container { max-width: 1040px; margin: 0 auto; }

/* ---------- Vue membre (non admin) ---------- */
.member-welcome {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-sm);
}
.member-welcome h2 { font-size: 26px; margin-bottom: 10px; }
.member-welcome p { color: var(--muted); margin-bottom: 8px; }

/* ---------- Dashboards et listes ---------- */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.admin-head h2 { font-size: 24px; }
.admin-head p { color: var(--muted); font-size: 14px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.kpi-card strong { display: block; font-size: 28px; color: var(--ink); line-height: 1.2; }
.kpi-card span { font-size: 13px; color: var(--muted); }

.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.admin-card h3 { font-size: 17px; margin-bottom: 12px; }

.empty-note { font-size: 14px; color: var(--muted); padding: 24px 0; text-align: center; }

/* ---------- Tableaux ---------- */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .num-cell { font-weight: 700; color: var(--ink); white-space: nowrap; }
.amount { font-weight: 700; color: var(--ink); white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-paid { background: var(--teal-soft); color: var(--teal-dark); }
.badge-draft { background: var(--bg-soft); color: var(--muted); }
.badge-pending { background: #fff4e0; color: #b56a00; }
.badge-accepted { background: var(--teal-soft); color: var(--teal-dark); }
.badge-rejected { background: #fdecea; color: #c0392b; }
.badge-cancelled { background: #fdecea; color: #c0392b; }
.badge-active { background: var(--teal-soft); color: var(--teal-dark); }
.badge-over { background: var(--bg-soft); color: var(--muted); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.mini-btn:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.mini-btn.danger:hover { border-color: #c0392b; color: #c0392b; background: #fdecea; }
.mini-btn.primary { border-color: var(--teal); background: var(--teal); color: var(--white); }
.mini-btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--white); }

/* ---------- Formulaires de gestion ---------- */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.admin-form-grid .full { grid-column: 1 / -1; }
.admin-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Lignes de document */
.lines-table { width: 100%; border-collapse: collapse; }
.lines-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.lines-table td { padding: 6px 8px; }
.lines-table input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.lines-table input:focus { outline: none; border-color: var(--teal); }
.lines-table .num-in { width: 80px; }
.lines-table .line-total { font-weight: 700; color: var(--ink); white-space: nowrap; }

.doc-totals { margin-top: 14px; text-align: right; font-size: 14px; }
.doc-totals div { padding: 3px 0; color: var(--text); }
.doc-totals .grand { font-size: 18px; font-weight: 800; color: var(--ink); }

/* ============================================================
   FEUILLE IMPRIMABLE
   ============================================================ */
.print-sheet {
  display: none;
  background: var(--white);
  color: #111;
  font-size: 13px;
  line-height: 1.55;
}
.print-sheet .ps-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid var(--navy-900);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.print-sheet .ps-brand { display: flex; align-items: center; gap: 12px; }
.print-sheet .ps-logo { height: 60px; width: auto; flex: none; }
.print-sheet .ps-logo-img { height: 60px; width: auto; object-fit: contain; }
.print-sheet .ps-brand-name { font-size: 22px; font-weight: 800; color: var(--navy-900); letter-spacing: 0.05em; }
.print-sheet .ps-brand-sub { font-size: 8px; font-weight: 700; letter-spacing: 0.22em; color: var(--navy-700); }
.print-sheet .ps-title { text-align: right; }
.print-sheet .ps-title h1 { font-size: 30px; color: var(--navy-900); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.print-sheet .ps-num { font-size: 15px; font-weight: 700; color: var(--teal-dark); }
.print-sheet .ps-meta { font-size: 12px; color: #333; }

.print-sheet .ps-body { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 22px; }
.print-sheet .ps-block h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--navy-700);
  margin-bottom: 6px;
}
.print-sheet .ps-block p { margin: 0; color: #222; white-space: pre-line; }
.print-sheet .ps-clauses {
  grid-column: 1 / -1;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: #333;
  white-space: pre-line;
}

.print-sheet table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; }
.print-sheet table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-700);
  background: #f1f4f9;
  padding: 8px 10px;
  border-bottom: 2px solid var(--navy-900);
}
.print-sheet table td { padding: 8px 10px; border-bottom: 1px solid #e2e2e2; color: #111; }
.print-sheet table tr:last-child td { border-bottom: none; }
.print-sheet table .right { text-align: right; white-space: nowrap; }

.print-sheet .ps-totals { margin-left: auto; width: 46%; font-size: 13px; }
.print-sheet .ps-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.print-sheet .ps-totals .grand { font-weight: 800; font-size: 17px; color: var(--navy-900); border-top: 2px solid var(--navy-900); margin-top: 4px; padding-top: 8px; }
.print-sheet .ps-status {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--teal-soft);
  color: var(--teal-dark);
}
.print-sheet .ps-sig { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.print-sheet .ps-sig div { border-top: 1px solid #999; padding-top: 8px; font-size: 12px; color: #444; }
.print-sheet .ps-foot {
  margin-top: 34px;
  padding-top: 12px;
  border-top: 1px solid #dcdcdc;
  font-size: 11px;
  color: #555;
  text-align: center;
}
.print-sheet .ps-foot b { color: var(--navy-900); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .header-inner { gap: 8px; }
  .auth-avatar { padding: 8px 10px; }
  .admin-top { padding: 10px 14px; }
  .admin-user { display: none; }
  .admin-top-actions { gap: 8px; }
  .admin-main { padding: 18px 14px 90px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .auth-avatar { padding: 8px 12px; }
  .auth-avatar [data-auth-label] { display: inline; }
  .auth-avatar svg { width: 16px; height: 16px; }
  .admin-logo { height: 36px; width: auto; }
  .admin-top-brand strong { font-size: 14px; }
  .admin-btn { padding: 8px 12px; font-size: 12px; }
  .kpi-card { padding: 14px 16px; }
  .kpi-card strong { font-size: 22px; }
  .admin-table th, .admin-table td { padding: 9px 10px; }
}

@media (max-width: 480px) {
  .auth-avatar { padding: 7px; }
  .auth-avatar [data-auth-label] { display: none; }
  .auth-avatar svg { width: 15px; height: 15px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-head h2 { font-size: 20px; }
}

/* ============================================================
   IMPRESSION (documents)
   ============================================================ */
/* ---------- Espace de travail ---------- */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 16px 0; }
.ws-tool {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; padding: 16px; border: 1.5px solid var(--border); border-radius: 14px;
  background: var(--bg); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit; color: var(--ink);
}
.ws-tool:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(12, 181, 166, 0.12); }
.ws-tool-icon { font-size: 26px; line-height: 1; }
.ws-tool-name { font-weight: 800; font-size: 15px; color: var(--navy-900); }
.ws-tool-desc { font-size: 12px; color: #5b6b7b; line-height: 1.45; }
.ws-tool-count { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--teal-dark); background: var(--teal-soft); padding: 3px 8px; border-radius: 999px; }

.ws-card .admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 720px) { .ws-card .admin-form-grid { grid-template-columns: 1fr; } }

.ws-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
@media (max-width: 720px) { .ws-grid2 { grid-template-columns: 1fr; } }

.ws-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #fafcfd; }
.ws-box h4 { margin: 0 0 8px; font-size: 13px; color: var(--navy-900); }
.ws-box h4:not(:first-child) { margin-top: 14px; }
.ws-hint { font-size: 12px; color: #5b6b7b; margin: 6px 0 0; line-height: 1.5; }
.ws-label { font-size: 11px; font-weight: 700; color: var(--teal-dark); margin: 8px 0 2px; }
.ws-quote { background: #eefaf8; border-left: 3px solid var(--teal); padding: 8px 10px; border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.55; margin: 0 0 10px; }
.ws-pre { background: #0b1b33; color: #d6e4ef; padding: 12px; border-radius: 8px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-x: auto; }
.ws-list { margin: 6px 0 0; padding-left: 20px; color: #26333f; font-size: 13px; line-height: 1.6; }
.ws-list.ws-check { list-style: none; padding-left: 2px; }
.ws-list.ws-check li { padding-left: 22px; position: relative; margin-bottom: 6px; }
.ws-list.ws-check li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.ws-visual { margin: 12px 0; }
.ws-actions { margin: 10px 0 6px; }
.ws-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
@media (max-width: 720px) { .ws-kpis { grid-template-columns: repeat(2, 1fr); } }
.ws-kpi { background: linear-gradient(135deg, #0b1b33, #10304f); color: #fff; border-radius: 12px; padding: 14px; text-align: center; }
.ws-kpi b { font-size: 20px; color: #7ce8c8; display: block; }
.ws-kpi span { font-size: 11px; opacity: 0.85; }
.ws-hist-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef2f5; }
.ws-hist-item small { color: #8296a6; margin-left: auto; }
.ws-hist-item .row-actions { margin-left: 0; }

.ws-wiz { margin: 14px 0; }
.ws-progress { height: 8px; background: #e6eef5; border-radius: 999px; overflow: hidden; margin: 4px 0 10px; }
.ws-progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-dark)); border-radius: 999px; transition: width .3s ease; }
.ws-step-label { font-size: 12px; font-weight: 700; color: var(--navy-900); margin-bottom: 2px; }

.ws-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 6px 0; }
.ws-media { display: block; cursor: pointer; position: relative; }
.ws-media input { position: absolute; opacity: 0; }
.ws-media img { width: 100%; height: 84px; object-fit: cover; border-radius: 8px; border: 2px solid #e2e8f0; display: block; }
.ws-media input:checked + img { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.ws-media span { display: block; font-size: 10px; color: #5b6b7b; text-align: center; margin-top: 2px; }
.ws-media-upload { margin: 6px 0 0; font-size: 12px; }
.ws-media-upload input { display: block; margin-top: 4px; }
.ws-media-cell { border: 1px solid var(--border); border-radius: 10px; padding: 6px; text-align: center; background: #fff; }
.ws-media-cell img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; }
.ws-media-cell span { display: block; font-size: 10px; color: #5b6b7b; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-post { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; margin: 8px 0; background: #fff; }
.ws-post > div:first-child { font-size: 12px; color: var(--teal-dark); font-weight: 700; margin-bottom: 6px; }

@media print {
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing #print-sheet {
    display: block;
    width: 100%;
  }
  body.printing .print-sheet {
    padding: 8mm;
    font-size: 12px;
  }
  @page { margin: 12mm; }
}

.ws-app { min-height: 60vh; }

.ws-modwrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 8px;
  background: #f2f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.ws-modwrap .ws-mod-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1b3358;
  font-size: 12px;
}
.ws-modwrap .ws-mod-nav:hover { border-color: #0CB5A6; color: #0CB5A6; }
.ws-modwrap .ws-mod-nav.active {
  background: #0CB5A6;
  border-color: #0CB5A6;
  color: #fff;
}
.ws-accueil { background: linear-gradient(135deg, #0b1b33, #10304f); color: #eaf2f8; border-radius: 14px; padding: 18px 20px; margin-top: 16px; }
.ws-accueil h3 { margin: 0 0 6px; font-size: 18px; color: #fff; }
.ws-sub { font-size: 13px; line-height: 1.6; margin: 0; color: #b9c9d8; max-width: 760px; }

.ws-clientbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.ws-clientbar select { flex: 1; min-width: 200px; }
.ws-clientbar-hint { font-size: 12px; color: #5b6b7b; }

.ws-kpi-v { font-size: 20px; font-weight: 800; color: #7ce8c8; }
.ws-kpi-l { font-size: 11px; opacity: 0.92; margin-top: 2px; }
.ws-kpi-s { font-size: 11px; opacity: 0.7; margin-top: 2px; }

.ws-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.ws-tbtn { background: var(--teal-soft, #e3f7f4); color: var(--teal-dark, #0a7d72); border: 1px solid rgba(12,181,166,0.35); padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.ws-tbtn:hover { background: var(--teal, #0CB5A6); color: #fff; }

.ws-table-wrap { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ws-table th { text-align: left; background: #f0f5f8; color: var(--navy-900); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border: 1px solid #e2e8f0; }
.ws-table td { padding: 8px 10px; border: 1px solid #e2e8f0; vertical-align: top; }
.ws-table tbody tr:nth-child(even) { background: #fafcfd; }
.ws-empty { color: #8296a6; font-size: 12px; background: #f0f5f8; border-radius: 8px; padding: 10px 12px; }

.ws-frow { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ws-frow label { font-size: 12px; font-weight: 700; color: var(--navy-900); }
.ws-form { margin: 8px 0; }
.ws-form input, .ws-form select, .ws-form textarea { width: 100%; box-sizing: border-box; }
.ws-num { font-weight: 700; text-align: left; }
.ws-num-r { font-variant-numeric: tabular-nums; white-space: nowrap; }

.ws-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.ws-pill-ok { background: #ddf6ec; color: #0d7a52; }
.ws-pill-warn { background: #fff3d6; color: #9a6b00; }
.ws-pill-der { background: #fde3e3; color: #b3261e; }
.ws-pill-grey { background: #e8edf2; color: #4b5b6b; }
.ws-pill-pink { background: #fde7f0; color: #b3266e; }

.ws-cat { margin-top: 20px; }
.ws-cat h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #8296a6; margin: 0 0 10px; }
.ws-mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ws-mod-nav { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-decoration: none; transition: all .15s ease; }
.ws-mod-nav:hover { border-color: var(--teal); box-shadow: 0 6px 16px rgba(12,181,166,0.14); transform: translateY(-1px); }
.ws-mod-ico { font-size: 24px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--teal-soft, #e3f7f4); border-radius: 10px; flex-shrink: 0; }
.ws-mod-nav .ws-mod-ico { font-size: 20px; }
.ws-mod-nav b { display: block; color: var(--navy-900); font-size: 13px; line-height: 1.3; }
.ws-mod-nav small { color: #8296a6; font-size: 11px; }

.ws-modhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 2px; }
.ws-modhead-t { font-size: 17px; font-weight: 800; color: var(--navy-900); }
.ws-modhead-s { font-size: 12px; color: #8296a6; }
.ws-mod-body { margin-top: 10px; }

.ws-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 14px; }
.ws-panel h3 { margin: 0 0 10px; font-size: 14px; color: var(--navy-900); }
.ws-panel:first-child { margin-top: 0; }
.ws-panel-sub { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; margin-top: 12px; }
.ws-panel-sub h4 { margin: 0 0 8px; font-size: 13px; color: var(--navy-900); }
.ws-home-actions { margin: 0 0 0; }
.ws-subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 8px; background: #f2f5f9; border: 1px solid #e2e8f0; border-radius: 10px; }
.ws-subtab { border: 1px solid #e2e8f0; background: #fff; color: #1b3358; padding: 6px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.ws-subtab:hover { border-color: #0CB5A6; color: #0CB5A6; }
.ws-subtab.active { background: #0CB5A6; border-color: #0CB5A6; color: #fff; }
.ws-dhead { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ws-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ws-info-grid > div { background: #f7fafc; border: 1px solid #eef2f5; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--navy-900); }
.ws-info-grid > div span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal-dark); margin-bottom: 2px; }
.ws-info-grid .ws-info-full { grid-column: 1 / -1; }
.ws-lockbox { background: #fff7ec; border: 1px solid #f0d9b0; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: 12px; color: #6b4d12; }
.ws-lockbox b { color: #9c7a1c; }
.ws-lockbox .admin-btn { font-size: 12px; padding: 6px 10px; }
.ws-frow { gap: 8px; }

.ws-txt { white-space: pre-wrap; line-height: 1.5; }

.ws-visual-pre { margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-width: 480px; }
.ws-visual-pre img { display: block; width: 100%; }

.ws-doc-cell { width: 96px; }
.ws-doc-img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; display: block; background: #eef2f5; }

.ps-table { border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.ps-table td { padding: 3px 8px; border: none; }

#ws-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #0b1b33; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: 0 10px 30px rgba(11,27,51,0.35); opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 9999; }
#ws-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.ws-pilot {
  background: #fff8ec;
  border: 1px solid #f3d9a4;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 14px;
}
.ws-pilot-h { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #7a5408; }
.ws-pilot-h b { text-transform: uppercase; letter-spacing: 0.05em; }
.ws-pilot-h span { background: #b3261e; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; }
.ws-pilot ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ws-pilot-i { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #26333f; }
.ws-pilot-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8a33d; flex-shrink: 0; }
.ws-pilot-txt { line-height: 1.4; }
.ws-pilot-open { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--teal-dark, #0a7d72); text-decoration: none; white-space: nowrap; }
.ws-pilot-open:hover { text-decoration: underline; }
.ws-pilot-more { font-size: 11px; color: #8296a6; }

.ws-mod-badge {
  margin-left: auto;
  background: #b3261e;
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ws-tfoot td { font-weight: 800; background: #eefaf8; border-top: 2px solid #0CB5A6; }

.ws-modhead-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--teal-soft, #e3f7f4);
  font-size: 16px;
  vertical-align: middle;
  margin-right: 2px;
}