:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --white: #fffefa;
  --ink: #222c3d;
  --soft: #596577;
  --muted: #7b8491;
  --rule: #dce0e5;
  --deep: #17352e;
  --deep-soft: #25473e;
  --green: #52745b;
  --green-dark: #35543d;
  --lime: #d9eed1;
  --coral: #f4aa82;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --primary: var(--deep);
  --primary-light: var(--deep-soft);
  --accent: var(--deep);
  --accent-hover: var(--deep-soft);
  --text-main: var(--ink);
  --text-muted: var(--soft);
  --border: var(--rule);
  --bg-page: var(--paper);
  --bg-card: var(--white);
  --success: var(--green-dark);
  --warning: #b45309;
  --font-family: var(--sans);
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--sans);
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar — PayBrik Deep Forest Green */
.admin-sidebar {
  width: 270px;
  background-color: var(--deep);
  color: #f8f6f1;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  flex-shrink: 0;
  border-right: 1px solid rgba(238, 243, 239, 0.12);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(238, 243, 239, 0.15);
  margin-bottom: 24px;
}

.admin-brand img {
  display: block;
  border-radius: 9px;
}

.admin-brand-text {
  display: flex;
  flex-direction: column;
}

.admin-brand-text strong {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -0.06em;
  line-height: 1.05;
  color: #fff;
}

.admin-brand-text span {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #d8e5d5;
  font-weight: 800;
  margin-top: 2px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #d4ded9;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  text-align: left;
}

.admin-nav-item:hover {
  background-color: var(--deep-soft);
  color: #fff;
}

.admin-nav-item.is-active {
  background-color: rgba(217, 238, 209, 0.16);
  border-color: rgba(217, 238, 209, 0.28);
  color: #fff;
  font-weight: 650;
}

.admin-nav-link {
  margin-top: 20px;
  border: 1px dashed rgba(217, 238, 209, 0.35);
  color: var(--lime);
}

.admin-nav-link:hover {
  background-color: rgba(217, 238, 209, 0.12);
  color: #fff;
}

.admin-sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid rgba(238, 243, 239, 0.15);
}

.admin-security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #bdcbc3;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--lime);
}

/* Main Area */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: 36px 48px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--paper);
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  width: 100%;
}

.topbar-crumb {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--green);
  margin-bottom: 4px;
}

.admin-topbar h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.admin-badge {
  padding: 6px 14px;
  background-color: var(--lime);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  border: 1px solid rgba(53, 84, 61, 0.18);
  letter-spacing: 0.02em;
}

/* Content Views */
.admin-content-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.section-lead {
  font-size: 13px;
  color: var(--soft);
  line-height: 1.5;
}

/* Companies Grid */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.company-card {
  background: var(--white);
  border: 1px solid rgba(34, 44, 61, 0.09);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(28, 44, 39, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(28, 44, 39, 0.08);
}

.company-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.company-card-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.company-card-slug {
  font-size: 11px;
  color: var(--soft);
  font-family: monospace;
  margin-top: 2px;
}

.company-status-badge {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: var(--lime);
  color: var(--green-dark);
  border: 1px solid rgba(53, 84, 61, 0.15);
}

.company-modules-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mod-badge {
  padding: 4px 9px;
  background: #f2f5ef;
  border: 1px solid #d8e2d6;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--deep-soft);
}

.company-tech-details {
  font-size: 12px;
  color: var(--soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f5f7f3;
  border: 1px solid #e1e7de;
  padding: 12px;
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.company-greeting-preview {
  font-size: 11px;
  color: var(--soft);
  font-style: italic;
  margin-top: 2px;
  word-break: break-word;
}

.company-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 8px;
}

/* Form Styles */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 840px;
  min-width: 0;
}

.form-card {
  background: var(--white);
  border: 1px solid rgba(34, 44, 61, 0.09);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(28, 44, 39, 0.04);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.form-card-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.form-grid > * {
  min-width: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.form-group-full {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin-bottom: 6px;
}

.section-instruction {
  font-size: 13px;
  color: var(--soft);
  margin-bottom: 14px;
  line-height: 1.5;
}

.form-group label {
  font-size: 12px;
  font-weight: 650;
  color: #313c4c;
}

.input-text, select.input-text, textarea.input-text {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 13px;
  border: 1px solid #d9dee2;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-text:focus, select.input-text:focus, textarea.input-text:focus {
  outline: none;
  border-color: #68806c;
  box-shadow: 0 0 0 3px rgba(82, 116, 91, 0.13);
}

select.input-text {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 32px;
}

textarea.input-text {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.input-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* Modules Selection */
.modules-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.modules-selection-grid > * {
  min-width: 0;
}

.module-checkbox-card {
  display: flex;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(34, 44, 61, 0.1);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  min-width: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.module-checkbox-card:hover {
  border-color: var(--green);
  background: #fbfdfa;
}

.module-checkbox-card:has(input:checked) {
  border-color: var(--deep);
  background: #f5f8f3;
}

.module-checkbox-card input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--deep);
}

.module-card-content {
  min-width: 0;
  flex: 1;
}

.module-card-content p {
  font-size: 12px;
  color: var(--soft);
  margin-top: 4px;
  line-height: 1.45;
}

.module-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}

/* Buttons — PayBrik Deep Green */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  border: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.button-primary {
  background-color: var(--deep);
  color: #fff;
  border: 1px solid var(--deep);
}

.button-primary:hover {
  background-color: var(--deep-soft);
  transform: translateY(-1px);
}

.button-secondary {
  background-color: transparent;
  border: 1px solid #cfd6d1;
  color: var(--deep);
}

.button-secondary:hover {
  background-color: #f2f5f0;
}

/* Time range input row */
.time-range-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.time-range-row .time-input {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.time-range-row span {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 53, 46, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--white);
  border-radius: 16px;
  max-width: 660px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  padding: 26px;
  box-shadow: 0 26px 80px rgba(23, 53, 46, 0.28);
  border: 1px solid rgba(34, 44, 61, 0.1);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.business-days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}

.day-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  background: #f8faf5;
  border: 1px solid #d4ded9;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  color: var(--ink);
  text-align: center;
  min-width: 0;
}

.day-checkbox:hover {
  border-color: var(--green);
  background: #edf3eb;
}

.day-checkbox:has(input:checked) {
  background: #eaf2e8;
  border-color: var(--deep);
  color: var(--deep);
  font-weight: 650;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--soft);
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.edit-modules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.edit-module-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.edit-module-toggle input[type="checkbox"] {
  accent-color: var(--deep);
}

.status-box {
  padding: 24px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--soft);
  font-size: 13px;
}

.status-message {
  padding: 12px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.status-success {
  background: #edf6ec;
  border: 1px solid #cce5c8;
  color: var(--green-dark);
}

.status-error {
  background: #fff5f1;
  border: 1px solid #f0d1c7;
  color: #8e3827;
}

/* Mobile Header and Drawer Base (Desktop Hidden) */
.admin-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background-color: var(--deep);
  color: #fff;
  border-bottom: 1px solid rgba(238, 243, 239, 0.15);
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand img {
  border-radius: 7px;
}

.mobile-brand-text {
  display: flex;
  flex-direction: column;
}

.mobile-brand-text strong {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
}

.mobile-brand-text span {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: #d8e5d5;
  font-weight: 800;
}

.mobile-toggle-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px 8px;
  background: transparent;
  border: 1px solid rgba(238, 243, 239, 0.2);
  border-radius: 7px;
  cursor: pointer;
}

.mobile-toggle-btn:hover {
  background: var(--deep-soft);
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.mobile-close-btn {
  display: none;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 53, 46, 0.65);
  backdrop-filter: blur(2px);
  z-index: 900;
}

.mobile-backdrop[hidden] {
  display: none !important;
}

/* ==========================================================================
   Responsive Mobile Styles (@media max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .admin-mobile-header {
    display: flex;
  }

  .mobile-close-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(238, 243, 239, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 85vw);
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
    overflow-y: auto;
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  }

  .admin-nav-item {
    min-height: 48px;
    font-size: 14px;
    padding: 12px 16px;
  }

  .admin-main {
    padding: 18px 14px 40px;
    width: 100%;
    max-width: 100vw;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
  }

  .admin-topbar h1 {
    font-size: 23px;
  }

  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .view-header .button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .companies-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .company-card {
    padding: 18px 14px;
  }

  .company-card-actions .button {
    width: 100%;
    min-height: 46px;
  }

  .form-card {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .modules-selection-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .module-checkbox-card {
    padding: 14px 12px;
    min-height: 48px;
  }

  .input-text, select.input-text, textarea.input-text {
    min-height: 48px;
    font-size: 16px;
  }

  textarea.input-text {
    min-height: 90px;
  }

  .business-days-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .business-days-row label:last-child {
    grid-column: span 2;
  }

  .day-checkbox {
    min-height: 44px;
    font-size: 13px;
    padding: 8px 6px;
  }

  .time-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .time-range-row .time-input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
  }

  .button {
    min-height: 48px;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  .form-actions .button {
    width: 100%;
    min-height: 48px;
    font-size: 14px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    padding: 20px 14px;
    border-radius: 14px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .button {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 380px) {
  .admin-main {
    padding: 14px 10px 32px;
  }

  .form-card {
    padding: 14px 10px;
  }

  .company-card {
    padding: 14px 10px;
  }

  .modal-card {
    padding: 14px 10px;
  }
}

/* Channels Selection Grid */
.channels-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  width: 100%;
}

.channel-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid #d9dee2;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.channel-card:hover:not(.is-disabled) {
  border-color: var(--green);
  background-color: #f7f9f6;
}

.channel-card:has(input:checked) {
  border-color: var(--deep);
  background-color: #f2f7f1;
}

.channel-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f8fafc;
}

.channel-card input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--deep);
}

.channel-card.is-disabled input[type="checkbox"] {
  cursor: not-allowed;
}

.channel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.channel-info strong {
  font-size: 13px;
  color: var(--ink);
}

.channel-info span {
  font-size: 11px;
  color: var(--soft);
  line-height: 1.35;
}

@media (max-width: 768px) {
  .channels-selection-grid {
    grid-template-columns: 1fr;
  }
}

/* Voice, Diagnostic & Integration Form Utilities */
.voice-row-flex {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.voice-select-flex {
  flex: 1;
  min-width: 280px;
}

.btn-preview-voice {
  white-space: nowrap;
  padding: 0.65rem 1rem;
}

.toggle-card-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.day-checkbox-label {
  font-weight: 600;
  cursor: pointer;
}

.btn-diagnostic-trigger {
  border-color: #38bdf8;
  color: #38bdf8;
  width: 100%;
}

.diagnostic-result-box {
  margin-top: 0.75rem;
}

.diagnostic-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.diagnostic-title {
  display: block;
  margin-bottom: 0.5rem;
}

.diagnostic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.diagnostic-item {
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-text-error {
  color: #f87171;
}

.status-text-success {
  color: #4ade80;
}

.form-subheading-creds {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.95rem;
  color: #4ade80;
}

/* --- Base de Connaissances & Catalogue de Tarifs --- */
.kb-selector-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kb-selector-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.kb-selector-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  white-space: nowrap;
}

.kb-company-dropdown {
  min-width: 280px;
  max-width: 450px;
  font-weight: 600;
  border-color: var(--leaf);
}

.kb-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--rule);
}

.kb-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--rule);
  background: var(--bg-soft, #f8fafc);
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kb-pill:hover {
  border-color: var(--leaf);
  color: var(--deep);
}

.kb-pill.is-active {
  background: var(--deep);
  color: #ffffff;
  border-color: var(--deep);
}

.kb-form-card {
  background: #ffffff;
  border: 2px solid var(--leaf);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kb-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.kb-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.kb-entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.kb-entry-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kb-entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.kb-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.kb-entry-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--deep);
  margin: 0;
  line-height: 1.4;
}

.kb-cat-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.kb-cat-tarifs { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.kb-cat-services { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.kb-cat-horaires { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.kb-cat-faq { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.kb-cat-urgence { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.kb-cat-general { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }

.kb-entry-content {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  margin: 8px 0 14px;
  white-space: pre-wrap;
}

.kb-keywords-box {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.kb-keyword-chip {
  padding: 2px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
}

.kb-entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

.btn-kb-action {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: transparent;
  transition: all 0.2s;
}

.btn-kb-edit { color: var(--deep); border-color: var(--rule); }
.btn-kb-edit:hover { background: #f8fafc; border-color: var(--deep); }
.btn-kb-delete { color: #dc2626; border-color: #fecaca; }
.btn-kb-delete:hover { background: #fee2e2; border-color: #dc2626; }

/* --- Super-Admin Authentication Gate Modal --- */
.admin-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.admin-auth-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-card-brand {
  text-align: center;
}

.auth-card-brand img {
  margin-bottom: 12px;
}

.auth-card-brand h2 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--deep);
  margin-bottom: 6px;
}

.auth-card-brand p {
  font-size: 13px;
  color: var(--soft);
}

.admin-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.button-full {
  width: 100%;
  justify-content: center;
}

.button-logout {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.2);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button-logout:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}


