body {
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh;
}

.admin-tabs { display: flex; gap: 4px; padding: 8px 12px; background: #e4e1d8; border-bottom: 1px solid var(--border); }
.tab-btn { padding: 8px 14px; border: 1px solid var(--border); background: #fff; border-radius: 4px 4px 0 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-warning-badge {
  background: #dc2626; color: #fff; border-radius: 50%; font-size: 11px;
  width: 16px; height: 16px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: bold;
}
.tab-panel { display: none; padding: 16px; }
.tab-panel.active { display: block; }

/* ---------- Security Audit Banner ---------- */
.security-banner {
  background: #fff3cd; border-left: 5px solid #ffc107; border-bottom: 1px solid #ffeeba;
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 13px; color: #856404;
}
.security-banner-icon { font-size: 20px; }
.security-banner-content { flex: 1; }
.security-banner-content strong { display: block; margin-bottom: 2px; color: #664d03; }
.security-msg-item { margin: 2px 0; font-size: 12px; }
.security-msg-item.danger { color: #b00020; font-weight: 500; }
.security-msg-item.warning { color: #856404; }
.badge-default-warning {
  background: #fee2e2; color: #b91c1c; border: 1px solid #f87171;
  padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: bold; margin-left: 6px;
}
.badge-modified-ok {
  background: #dcfce7; color: #15803d; border: 1px solid #86efac;
  padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: bold; margin-left: 6px;
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.inline-form input, .inline-form select { padding: 6px; border: 1px solid var(--border); border-radius: 3px; }

/* ---------- Folder & User Creation Form Grid & Labels ---------- */
.folder-create-grid, .user-create-grid {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px;
  background: #fdfdfd; padding: 12px; border: 1px solid #ddd; border-radius: 4px;
}
.form-field-group {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
}
.form-field-group .field-label {
  font-weight: bold; color: #444; font-size: 11px;
}
.checkbox-field-group {
  flex-direction: row; align-items: center; padding: 4px 0;
}
.input-with-btn {
  display: flex; gap: 4px; align-items: center;
}
.editable-max-size-input {
  width: 85px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 3px; font-size: 13px;
}
.cell-editable-group {
  display: flex; align-items: center; gap: 4px;
}

/* ---------- Table Toolbar, Search, Badges & Scrolling ---------- */
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; gap: 12px;
}
.admin-search-input {
  flex: 1; max-width: 380px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 3px; font-size: 13px;
}
.badge {
  font-size: 11px; background: #e0ded8; color: #555; padding: 3px 8px;
  border-radius: 10px; font-weight: bold;
}
.table-scroll-container {
  max-height: 58vh; overflow-y: auto; overflow-x: auto;
  border: 1px solid #ddd; border-radius: 4px; background: #fff;
}

/* ---------- Table Sorting Headers ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid #ddd; text-align: left; white-space: nowrap; }
.admin-table th { background: var(--bg-header); position: sticky; top: 0; z-index: 2; user-select: none; }
.sortable-th { cursor: pointer; }
.sortable-th:hover { background: #c6c2b8; }
.sort-indicator { font-size: 10px; margin-left: 4px; }
.admin-table button { margin-right: 4px; padding: 4px 8px; border: 1px solid var(--border); background: #fff; border-radius: 3px; cursor: pointer; font-size: 12px; }
.admin-table button:hover { background: #f0f0f0; }
.badge-active { background: #dcfce7; color: #166534; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.badge-inactive { background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; }
#folder-permissions-panel { margin-top: 24px; }

/* ---------- Modal Forms ---------- */
.modal-box-wide {
  width: 560px;
}
.modal-form-body {
  padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
}
.modal-form-body input, .modal-form-body select {
  padding: 8px; border: 1px solid var(--border); border-radius: 3px; font-size: 13px;
}

[hidden] {
  display: none !important;
}

/* ---------- Filesystem Folder-Picker Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.modal-overlay[hidden] {
  display: none !important;
}
.modal-box {
  width: 480px; max-width: 92vw; max-height: 80vh; background: #fff;
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--bg-header); font-weight: bold;
}
.modal-header button { border: none; background: transparent; font-size: 18px; cursor: pointer; line-height: 1; }
.modal-path-bar { padding: 8px 14px; border-bottom: 1px solid #ddd; word-break: break-all; background: #fafafa; }
.fs-browser-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.fs-browser-list li { padding: 8px 14px; cursor: pointer; }
.fs-browser-list li:hover { background: #dbe8ff; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid #ddd; }
.modal-footer span { font-size: 12px; color: #666; }

