/* ============================================================
   WCAG Test Generator — Global Stylesheet
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --color-primary:       #2563eb;
  --color-primary-dark:  #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-success:       #16a34a;
  --color-success-light: #dcfce7;
  --color-warning:       #d97706;
  --color-warning-light: #fef3c7;
  --color-danger:        #dc2626;
  --color-danger-light:  #fee2e2;
  --color-info:          #0891b2;
  --color-info-light:    #cffafe;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
  --font-mono:   ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo,
                 Consolas, 'DejaVu Sans Mono', monospace;

  --border-radius:   6px;
  --border-radius-lg: 10px;
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:      0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);

  --nav-height: 60px;
  --transition: 150ms ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-family);
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

/* ---------- Typography ---------- */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem;     font-weight: 600; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--gray-900);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1.25rem;
  box-shadow: var(--shadow-md);
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  margin-right: 1.5rem;
  letter-spacing: -.01em;
}
.nav-brand:hover { text-decoration: none; color: var(--gray-200); }

.nav-links {
  display: flex;
  align-items: center;
  gap: .125rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: .375rem .75rem;
  border-radius: var(--border-radius);
  color: var(--gray-300);
  font-size: .875rem;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--gray-700); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--color-primary); color: #fff; }
.nav-link:focus-visible { outline: 2px solid var(--color-primary-light); outline-offset: 2px; }

.nav-link-admin { color: var(--color-warning-light); }
.nav-link-admin:hover { background: rgba(217,119,6,.25); }
.nav-link-admin.active { background: var(--color-warning); color: var(--gray-900); }

.nav-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-username {
  font-size: .8125rem;
  color: var(--gray-300);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.two-col-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.card-body { padding: 1.25rem; }

.card-title { font-size: 1rem; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-sm { padding: .3125rem .625rem; font-size: .8125rem; }
.btn-lg { padding: .6875rem 1.375rem; font-size: 1rem; }

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }

.btn-secondary {
  background: #fff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-400); }

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }

.btn-danger-outline {
  background: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.btn-danger-outline:hover:not(:disabled) { background: var(--color-danger-light); }

.btn-success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-warning {
  background: var(--color-warning);
  border-color: var(--color-warning);
  color: #fff;
}
.btn-warning:hover:not(:disabled) { background: #b45309; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-800); }

.btn-icon {
  padding: .375rem;
  border-radius: var(--border-radius);
}

/* ---------- Forms ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.form-group + .form-group { margin-top: 1rem; }

label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-control {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--gray-800);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem; }

.form-hint { font-size: .8125rem; color: var(--gray-500); }
.form-error { font-size: .8125rem; color: var(--color-danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.checkbox-group input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--color-primary); }
.checkbox-group label { margin: 0; font-weight: 400; color: var(--gray-700); }

.form-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-draft        { background: var(--gray-200);          color: var(--gray-700); }
.badge-pending      { background: var(--color-warning-light); color: #92400e; }
.badge-pending_review { background: var(--color-warning-light); color: #92400e; }
.badge-approved     { background: var(--color-success-light); color: #14532d; }
.badge-rejected     { background: var(--color-danger-light);  color: #991b1b; }
.badge-deleted      { background: var(--gray-200);           color: var(--gray-600); }

.badge-generated { background: var(--color-info-light);   color: #164e63; }
.badge-manual    { background: var(--color-primary-light); color: #1e3a8a; }
.badge-imported  { background: #f3e8ff;                   color: #581c87; }

.badge-needs-tags {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.badge-level-a   { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-level-aa  { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.badge-level-aaa { background: #fdf4ff; color: #581c87; border: 1px solid #e9d5ff; }

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--gray-50); }
tbody tr.highlight { background: #fffbeb; }
tbody tr.highlight:hover { background: #fef3c7; }

tbody tr[data-href] { cursor: pointer; }

.td-id { font-family: var(--font-mono); font-size: .8125rem; color: var(--gray-500); }
.td-name { font-weight: 500; }
.td-meta { color: var(--gray-500); font-size: .8125rem; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 .5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: .875rem;
  color: var(--gray-700);
  background: #fff;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.pagination-btn:hover:not(:disabled) { background: var(--gray-100); }
.pagination-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination-btn:disabled { opacity: .45; cursor: not-allowed; }

.pagination-info { font-size: .875rem; color: var(--gray-500); margin: 0 .5rem; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 120ms ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 150ms ease;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title { font-size: 1.0625rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  padding: .375rem;
  border-radius: var(--border-radius);
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-800); }

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  pointer-events: auto;
  animation: toastIn 200ms ease;
  font-size: .875rem;
  line-height: 1.5;
}

@keyframes toastIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.toast-success { background: var(--color-success); color: #fff; }
.toast-error   { background: var(--color-danger);  color: #fff; }
.toast-info    { background: var(--color-info);    color: #fff; }

.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: .1rem; }
.toast-message { flex: 1; }
.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
.toast-close:hover { color: #fff; }

/* ---------- Loading Spinner ---------- */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--gray-300);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.spinner-sm { width: .875rem; height: .875rem; }
.spinner-lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 2.5rem 1rem;
  justify-content: center;
  color: var(--gray-500);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  opacity: .5;
}

.empty-state h3 { margin-bottom: .5rem; color: var(--gray-600); }
.empty-state p  { font-size: .875rem; }

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  margin-bottom: 1.25rem;
}

.filter-bar .form-group { margin: 0; min-width: 160px; }

.search-input-wrap {
  flex: 1;
  min-width: 200px;
}

.filter-bar .btn { align-self: flex-end; }

/* ---------- Detail Page ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}

.detail-field {}
.detail-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: .25rem;
}
.detail-value {
  font-size: .9375rem;
  color: var(--gray-800);
  word-break: break-word;
}
.detail-value.mono { font-family: var(--font-mono); font-size: .875rem; }
.detail-value.multiline { white-space: pre-wrap; }

/* ---------- Tag Tree ---------- */
.tree-root { padding: .5rem 0; }

.tree-node {
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  margin-bottom: .5rem;
  overflow: hidden;
}

.tree-node-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .875rem;
  background: #fff;
  cursor: default;
}

.tree-node-toggle {
  background: none;
  border: none;
  padding: .125rem .25rem;
  cursor: pointer;
  color: var(--gray-500);
  font-size: .875rem;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color var(--transition);
}
.tree-node-toggle:hover { color: var(--gray-800); }

.tree-node-name { font-weight: 500; flex: 1; }
.tree-node-count { font-size: .8125rem; color: var(--gray-500); }

.tree-node-actions {
  display: flex;
  gap: .25rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.tree-node-header:hover .tree-node-actions,
.tree-node-header:focus-within .tree-node-actions { opacity: 1; }

.tree-children {
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  padding: .5rem .5rem .5rem 1.5rem;
}

.tree-inline-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .5rem .875rem;
  background: var(--color-primary-light);
  border-top: 1px solid var(--gray-200);
}
.tree-inline-form .form-control { flex: 1; }

/* ---------- Comment Thread ---------- */
.comment-list { display: flex; flex-direction: column; gap: 1rem; }

.comment {
  display: flex;
  gap: .75rem;
}

.comment-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8125rem;
  flex-shrink: 0;
}

.comment-body { flex: 1; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .25rem;
  flex-wrap: wrap;
}
.comment-author { font-weight: 600; font-size: .875rem; }
.comment-date   { font-size: .8125rem; color: var(--gray-500); }

.comment-text { font-size: .9375rem; line-height: 1.55; color: var(--gray-700); }
.comment-deleted { font-size: .875rem; color: var(--gray-400); font-style: italic; }

/* ---------- Status & Rate Limit ---------- */
.rate-limit-msg {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .875rem;
  background: var(--color-warning-light);
  border: 1px solid #fcd34d;
  border-radius: var(--border-radius);
  font-size: .875rem;
  color: #92400e;
  margin-top: .75rem;
}

.status-msg {
  padding: .625rem .875rem;
  border-radius: var(--border-radius);
  font-size: .875rem;
  margin-top: .75rem;
}
.status-msg-success { background: var(--color-success-light); color: #14532d; border: 1px solid #86efac; }
.status-msg-error   { background: var(--color-danger-light);  color: #991b1b; border: 1px solid #fca5a5; }
.status-msg-info    { background: var(--color-info-light);    color: #164e63; border: 1px solid #a5f3fc; }

/* ---------- Import/Export ---------- */
.import-summary { display: flex; flex-direction: column; gap: .5rem; }
.import-row { display: flex; justify-content: space-between; align-items: center; padding: .375rem 0; border-bottom: 1px solid var(--gray-100); }
.import-row:last-child { border-bottom: 0; }
.import-label { color: var(--gray-600); font-size: .875rem; }
.import-value { font-weight: 600; }

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  padding: 1.5rem;
}

.login-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
}

.login-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.login-desc  { color: var(--gray-500); font-size: .9375rem; margin-bottom: 2rem; line-height: 1.5; }

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-google:hover { background: var(--gray-50); box-shadow: var(--shadow); text-decoration: none; color: var(--gray-900); }

.google-icon { width: 20px; height: 20px; flex-shrink: 0; }

.login-error {
  margin-top: 1.25rem;
  padding: .75rem 1rem;
  background: var(--color-danger-light);
  border: 1px solid #fca5a5;
  border-radius: var(--border-radius);
  color: #991b1b;
  font-size: .875rem;
  text-align: left;
}

/* ---------- Draft Display ---------- */
.draft-fields { display: flex; flex-direction: column; gap: .875rem; }

.draft-field-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: .2rem;
}

.draft-field-value {
  font-size: .9rem;
  color: var(--gray-800);
  line-height: 1.55;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: .5rem .75rem;
  min-height: 2.25rem;
  word-break: break-word;
  white-space: pre-wrap;
}
.draft-field-value.empty { color: var(--gray-400); font-style: italic; }

/* ---------- Tag Multi-select ---------- */
.tag-select-wrap {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: .5rem;
  max-height: 180px;
  overflow-y: auto;
  background: #fff;
}

.tag-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .25rem;
  border-radius: 4px;
  cursor: pointer;
}
.tag-option:hover { background: var(--gray-50); }
.tag-option input[type="checkbox"] { accent-color: var(--color-primary); }
.tag-option label { margin: 0; font-weight: 400; cursor: pointer; }

/* ---------- User Admin Table ---------- */
.user-table-status {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8125rem;
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; flex-shrink: 0; }
.dot-active { background: var(--color-success); }
.dot-inactive { background: var(--gray-400); }

/* ---------- Confirmation Dialog (inline) ---------- */
.confirm-section {
  padding: 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--border-radius);
  margin-top: .75rem;
}
.confirm-section p { font-size: .875rem; margin-bottom: .75rem; }

/* ---------- Misc Utilities ---------- */
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }
.font-mono   { font-family: var(--font-mono); }

.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center{ align-items: center; }
.gap-1       { gap: .375rem; }
.gap-2       { gap: .75rem; }
.gap-3       { gap: 1.25rem; }
.justify-between { justify-content: space-between; }

.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: .375rem; }
.mb-2  { margin-bottom: .75rem; }
.mb-3  { margin-bottom: 1.25rem; }
.mb-4  { margin-bottom: 1.75rem; }
.mt-2  { margin-top: .75rem; }
.mt-3  { margin-top: 1.25rem; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.divider {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 1.25rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col-equal { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-group { min-width: unset; }
  .page-wrapper { padding: 1rem .75rem 2rem; }
  .nav-links { gap: 0; }
  .nav-brand { margin-right: .75rem; font-size: .9rem; }
  h1 { font-size: 1.375rem; }
}

@media (max-width: 480px) {
  .modal { max-width: 100%; border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .nav-username { display: none; }
}
