/* ═══════════════════════════════════════════════════════════════
   SOCOSIL SAS — Dashboard Styles (client + admin)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --orange:       #F5A200;
  --orange-dark:  #D48800;
  --orange-light: #FEF3DC;
  --orange-mid:   #F8CC78;
  --dark:         #111111;
  --bg:           #F5F5F5;
  --surface:      #FFFFFF;
  --text:         #111111;
  --text-muted:   #777777;
  --border:       #E8E8E8;
  --sidebar-w:    240px;
  --topbar-h:     64px;
  --radius:       10px;
  --radius-sm:    7px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img, svg { display: block; }

/* ─── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
}
/* Brand logo nella sidebar */
.sidebar-logo .brand { display: flex; align-items: center; gap: 10px; }
.sidebar-logo .brand-logo { height: 40px; width: auto; border-radius: 4px; flex-shrink: 0; }
.sidebar-logo .brand-tagline { font-family: Inter, Arial, sans-serif; font-weight: 700; font-size: 9px; letter-spacing: 0.3px; color: rgba(255,255,255,0.88); line-height: 1.45; text-transform: uppercase; }
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.nav-item.active { background: rgba(245,162,0,0.15); color: var(--orange); font-weight: 600; }
.nav-item svg { flex-shrink: 0; opacity: 0.75; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  background: var(--orange); color: #111;
  font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 1px 7px;
  margin-left: auto;
}
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.4);
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.logout-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); }

/* ─── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.topbar-user  { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--orange-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--orange-dark); flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* ─── PAGE BODY ──────────────────────────────────────────────── */
.page-body { padding: 28px; flex: 1; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.page-header p  { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; }

/* ─── STATS ROW ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 42px; height: 42px;
  background: var(--orange-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.stat-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }

/* ─── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-body  { padding: 20px; }
.card-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.card-empty svg { margin: 0 auto 12px; opacity: 0.3; }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--orange); color: #111; }
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245,162,0,0.3); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: #ccc; background: #ececec; }
.btn-danger { background: #FFF5F5; color: #C53030; border: 1.5px solid #FED7D7; }
.btn-danger:hover { background: #FED7D7; }
/* ─── CERT EXPANDABLE ROWS (admin) ───────────────────────────── */
.cert-summary-row.clickable { cursor: pointer; }
.cert-summary-row.clickable:hover { background: var(--orange-light); }
.cert-chevron-admin { transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0; }
.cert-chevron-admin.open { transform: rotate(180deg); color: var(--orange-mid); }
.cert-detail-row { display: none; }
.cert-detail-row.open { display: table-row; }
.cert-detail-wrap {
  background: #FAFAFA; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0;
}
.cert-detail-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px 9px 36px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.cert-detail-item:last-child { border-bottom: none; }
.cert-detail-name { flex: 1; font-weight: 500; color: var(--text); }
.cert-detail-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.danger-zone {
  border-top: 1.5px solid #FED7D7;
  background: #FFFAFA;
  padding: 16px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.danger-zone-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #C53030; margin-bottom: 10px;
}
.danger-zone-row { display: flex; align-items: center; gap: 16px; }
.danger-zone-row > div { flex: 1; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg); border-color: #ccc; }
.btn-icon.danger:hover { background: #FFF5F5; border-color: #FEB2B2; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ─── TABLE ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 9px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFAFA; }
tbody tr.clickable { cursor: pointer; }
.td-actions { display: flex; align-items: center; gap: 6px; }

/* ─── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-orange  { background: var(--orange-light); color: var(--orange-dark); }
.badge-green   { background: #F0FFF4; color: #276749; }
.badge-gray    { background: #F0F0F0; color: #555; }
.badge-red     { background: #FFF5F5; color: #C53030; }
.badge-blue    { background: #EBF8FF; color: #2B6CB0; }
.badge-yellow  { background: #FFFBEB; color: #975A16; }

/* ─── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text);
  background: var(--bg); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,162,0,0.13);
  background: #fff;
}
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(12px); transition: transform 0.2s;
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  padding: 20px 22px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; font-size: 18px; transition: background 0.15s;
}
.modal-close:hover { background: var(--bg); }
.modal-body   { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ─── FILE UPLOAD AREA ───────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--orange); background: var(--orange-light); }
.upload-area input[type="file"] { display: none; }
.upload-area svg { margin: 0 auto 10px; opacity: 0.45; }
.upload-area p { font-size: 13.5px; color: var(--text-muted); }
.upload-area p strong { color: var(--orange); }

/* ─── DOCUMENT LIST ──────────────────────────────────────────── */
.doc-section { display: flex; flex-direction: column; gap: 10px; }
.doc-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-date-group { display: flex; flex-direction: column; gap: 8px; }
.doc-date-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.doc-date-group + .doc-date-group { margin-top: 12px; }
.doc-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: border-color 0.15s;
}
.doc-item:hover { border-color: var(--orange-mid); }
.doc-icon {
  width: 36px; height: 36px;
  background: var(--orange-light); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── PDF PREVIEW MODAL ──────────────────────────────────────── */
.modal-preview { max-width: min(900px, 95vw); }
.modal-body-preview { padding: 0; overflow: hidden; }
#previewIframe { width: 100%; height: 70vh; border: none; display: block; }
.doc-item-main {
  display: flex; align-items: center; gap: 13px;
  flex: 1; min-width: 0; cursor: pointer;
}
.doc-item-main:hover .doc-name { color: var(--orange); }

/* ─── TOAST ──────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--dark); color: white;
  padding: 11px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 9px;
  animation: slideUp 0.2s ease; pointer-events: all;
}
.toast.success { border-left: 3px solid #48BB78; }
.toast.error   { border-left: 3px solid #F56565; }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } }

/* ─── TABS ───────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn {
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── INFO GRID ──────────────────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-field label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 3px;
}
.info-field span { font-size: 13.5px; color: var(--text); font-weight: 500; }

/* ─── CHAT ───────────────────────────────────────────────────── */
.chat-wrap {
  display: flex; flex-direction: column;
  height: 480px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13.5px; }
.msg { display: flex; flex-direction: column; max-width: 72%; }
.msg.from-client { align-self: flex-end; align-items: flex-end; }
.msg.from-admin  { align-self: flex-start; align-items: flex-start; }
.msg-bubble {
  padding: 9px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.msg.from-client .msg-bubble { background: var(--orange); color: #111; border-radius: 12px 12px 2px 12px; }
.msg.from-admin  .msg-bubble { background: #F0F0F0; color: var(--text); border-radius: 12px 12px 12px 2px; }
.msg-time { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 12px 14px; display: flex; gap: 9px; align-items: flex-end;
  background: var(--surface);
}
.chat-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px; outline: none; resize: none;
  font-family: inherit; max-height: 100px; transition: border-color 0.15s;
  background: var(--bg);
}
.chat-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,162,0,0.13); background: #fff; }

/* ─── ADMIN CHAT GRID ────────────────────────────────────────── */
.admin-chat-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.chat-client-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-client-list-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
/* Sidebar lista clienti attivi */
.client-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.client-list-item:last-child { border-bottom: none; }
.client-list-item:hover { background: var(--bg); }
.client-list-item.active { background: var(--orange-light); }
.client-list-info { flex: 1; min-width: 0; }
.client-list-item .name  { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-list-item.active .name { color: var(--orange-dark); }
.client-list-item .sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Sidebar lista chat */
.chat-client-item { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.chat-client-item:last-child { border-bottom: none; }
.chat-client-item:hover { background: var(--bg); }
.chat-client-item.active { background: var(--orange-light); }
.chat-client-item .name  { font-size: 13.5px; font-weight: 600; color: var(--text); }
.chat-client-item.active .name { color: var(--orange-dark); }
.chat-client-item .sub   { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ─── EMPLOYEE ROWS ──────────────────────────────────────────── */
.employee-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 8px; }
.employee-header {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; cursor: pointer; transition: background 0.15s;
  user-select: none;
}
.employee-header:hover { background: var(--bg); }
.employee-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--dark); display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: var(--orange); flex-shrink: 0;
}
.employee-name  { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; }
.employee-stats { font-size: 11.5px; color: var(--text-muted); }
.employee-body  { border-top: 1px solid var(--border); padding: 14px 16px; display: none; }
.employee-body.open { display: block; }
.cert-list { display: flex; flex-direction: column; gap: 0; }
.cert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.cert-item:last-child { border-bottom: none; }
.cert-name { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.cert-date { font-size: 12px; color: var(--text-muted); }
.badge-attivo    { background: #F0FFF4; color: #276749; }
.badge-scadenza  { background: #FFFBEB; color: #975A16; }
.badge-scaduto   { background: #FFF5F5; color: #C53030; }

/* ─── BOOKING CARDS ──────────────────────────────────────────── */
.booking-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px;
}
.booking-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.booking-date { font-size: 14.5px; font-weight: 700; color: var(--text); }
.booking-msg  { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.booking-reply {
  margin-top: 10px; padding: 9px 13px;
  background: #F0FFF4; border-radius: var(--radius-sm);
  font-size: 13px; color: #276749; border-left: 3px solid #48BB78;
}
.booking-reply.rejected { background: #FFF5F5; color: #C53030; border-left-color: #F56565; }

/* ─── FAQ (dashboard) ────────────────────────────────────────── */
.faq-dash { display: flex; flex-direction: column; gap: 10px; }
.faq-dash-item { border: 1px solid #F5D28A; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.faq-dash-q {
  width: 100%; text-align: left; padding: 14px 16px;
  font-size: 14px; font-weight: 700;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--orange-dark);
  background: #FFF8E8;
  border: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: background 0.15s;
}
.faq-dash-q:hover { background: #FFF1CC; }
.faq-chevron { transition: transform 0.2s; flex-shrink: 0; color: var(--orange-mid); }
.faq-chevron.open { transform: rotate(180deg); }
.faq-dash-a {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.7;
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 16px;
}
.faq-dash-a.open { max-height: 600px; padding: 14px 16px; }

/* ─── SIDEBAR TOGGLE (mobile) ────────────────────────────────── */
.sidebar-toggle {
  display: none; position: fixed; top: 15px; left: 15px; z-index: 60;
  width: 38px; height: 38px; background: var(--dark); border-radius: 8px;
  border: none; align-items: center; justify-content: center; cursor: pointer;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .topbar { padding: 0 16px 0 60px; }
  .page-body { padding: 18px 14px; }
  .info-grid { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .admin-chat-grid { grid-template-columns: 1fr; }
}

/* ─── DOC HUB ──────────────────────────────────────── */
.doc-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.doc-hub-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  user-select: none;
}
.doc-hub-badge {
  position: absolute;
  top: 10px; right: 12px;
  background: #F5A800; color: #111;
  font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  border-radius: 10px;
  line-height: 1;
}
.doc-hub-card:hover {
  border-color: var(--orange);
  box-shadow: 0 6px 24px rgba(245,162,0,0.13);
  transform: translateY(-2px);
}
.doc-hub-icon {
  width: 76px; height: 76px;
  background: var(--orange-light);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
}
.doc-hub-title { font-size: 17px; font-weight: 800; color: var(--text); }
.doc-hub-sub   { font-size: 13px; color: var(--text-muted); margin-top: -8px; }
.doc-hub-count { font-size: 30px; font-weight: 800; color: var(--orange); line-height: 1; }

/* ─── DOC VIEWS ─────────────────────────────────────── */
.doc-view        { display: none; }
.doc-view.active { display: block; }

.doc-view-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.doc-view-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; color: var(--text);
}
.doc-view-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-back:hover { border-color: var(--orange); color: var(--orange-dark); background: var(--orange-light); }

.doc-search-wrap { position: relative; display: inline-flex; align-items: center; }
.doc-search-wrap svg { position: absolute; left: 10px; pointer-events: none; color: var(--text-muted); }
.doc-search {
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface);
  color: var(--text); outline: none; width: 210px;
  transition: border-color .15s, box-shadow .15s;
}
.doc-search:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245,162,0,0.12); }

.doc-sort-select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--surface);
  color: var(--text); outline: none; cursor: pointer;
  transition: border-color .15s;
}
.doc-sort-select:focus { border-color: var(--orange); }

/* ─── COMPANY LIST ──────────────────────────────────── */
.doc-company-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s; user-select: none;
}
.doc-company-item:last-child { border-bottom: none; }
.doc-company-item:hover { background: var(--orange-light); }
.doc-company-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--dark); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.doc-company-name  { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text); }
.doc-company-badge { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

@media (max-width: 640px) {
  .doc-hub-grid { grid-template-columns: 1fr; }
  .doc-search   { width: 160px; }
}
