:root {
  --primary: #0f1b2d;
  --primary-mid: #1a365d;
  --primary-light: #2b6cb0;
  --accent: #3b82f6;
  --accent-glow: rgba(59,130,246,.15);
  --red: #ef4444;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.05);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Navigation ─── */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: white;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  box-shadow: 0 4px 20px rgba(15,27,45,.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  color: white;
}

.navbar-logo {
  height: 80px;
  width: auto;
  opacity: .95;
  transition: opacity .2s;
}

.navbar-brand:hover .navbar-logo {
  opacity: 1;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.2);
}

.brand-portal {
  font-size: .85rem;
  font-weight: 600;
  opacity: .7;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: .35rem;
}

.nav-links a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  gap: .45rem;
}

.nav-links a svg {
  opacity: .7;
  flex-shrink: 0;
}

.nav-links a:hover {
  color: white;
  background: rgba(255,255,255,.1);
}

.nav-links a:hover svg { opacity: 1; }

.nav-links a.active {
  color: white;
  background: rgba(255,255,255,.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}

.nav-links a.active svg { opacity: 1; }

/* ─── Layout ─── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ─── Page Header ─── */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.03em;
}

.page-header p {
  color: var(--text-light);
  margin-top: .25rem;
  font-size: .95rem;
}

/* ─── Hero Banner (Dashboard) ─── */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 50%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 3rem 2.75rem;
  color: white;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 70%);
  pointer-events: none;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
}

.hero-logo-img {
  height: 128px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
  opacity: .9;
}

.hero-banner h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .35rem;
}

.hero-banner p {
  opacity: .7;
  font-size: 1rem;
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow .25s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card + .card {
  margin-top: 1.5rem;
}

.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .95rem;
  color: var(--primary);
  background: linear-gradient(to bottom, #fafcff, #f8faff);
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}

.card-body {
  padding: 1.75rem;
}

/* ─── Section Headings ─── */
.section-heading {
  margin-bottom: 1rem;
  margin-top: .5rem;
}

.section-heading h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
}

.section-heading p {
  color: var(--text-light);
  font-size: .85rem;
  margin-top: .1rem;
}

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dashboard-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.dashboard-grid.grid-1 {
  grid-template-columns: 1fr;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0;
  transition: opacity .25s, transform .25s;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.stat-card:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(3px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.holidays {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}
.stat-icon.incidents {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
}
.stat-icon.policies {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
}
.stat-icon.knowledge {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
}

.stat-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: .15rem;
}

.stat-info p {
  font-size: .85rem;
  color: var(--text-light);
}

/* ─── Forms ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}

.form-group label .required {
  color: var(--red);
  margin-left: .1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  background: white;
  color: var(--text);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.75rem;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  letter-spacing: -.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(59,130,246,.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: .75rem;
}

/* ─── Alerts ─── */
.alert {
  padding: 1rem 1.35rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-success::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23059669' viewBox='0 0 16 16'%3E%3Cpath d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

/* ─── Tables ─── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: .85rem 1.25rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-light);
  background: linear-gradient(to bottom, #fafcff, #f8faff);
  border-bottom: 2px solid var(--border);
}

td {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  font-size: .88rem;
}

tr {
  transition: background .15s;
}

tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.badge-pending { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.badge-approved { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.badge-open { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.badge-resolved { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.badge-declined { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.badge-closed { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.row-cancelled { opacity: 0.55; }

.date-changed {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  cursor: help;
}

/* ─── File Upload ─── */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  position: relative;
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-text {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.file-upload-hint {
  font-size: 13px;
  color: var(--text-light);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.file-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text-mid);
}

/* ─── Attachment Links ─── */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.attachment-link:hover {
  background: var(--accent-glow);
  text-decoration: underline;
}

.text-muted { color: var(--text-light); }

/* ─── Clickable Table Rows ─── */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #eef2ff; }

/* ─── Back Link ─── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--accent);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .75rem;
  transition: color .15s;
}
.back-link:hover { color: var(--primary-light); }

/* ─── Detail Page ─── */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-rows {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  width: 180px;
  flex-shrink: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-light);
}

.detail-value {
  font-size: .9rem;
  color: var(--text);
}

.detail-text {
  font-size: .9rem;
  color: var(--text-mid);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ─── Attachment Grid (Detail View) ─── */
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.attachment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}

.attachment-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.attachment-image img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.attachment-video video {
  width: 100%;
  display: block;
}

.attachment-file {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.attachment-file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  color: var(--text-light);
  margin-bottom: .5rem;
}

.attachment-ext {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
}

.attachment-name {
  display: block;
  padding: .5rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-light);
}

.attachment-file .attachment-name {
  border-top: none;
  padding: 0;
}

/* ─── Incident Detail Actions ─── */
.inline-form {
  display: inline-block;
  margin-left: .75rem;
}

.btn-close-incident {
  font-size: .75rem;
  padding: .3rem .85rem;
  background: #374151;
  color: white;
  border-radius: 6px;
}

.btn-close-incident:hover {
  background: #1f2937;
}

.btn-reopen-incident {
  font-size: .75rem;
  padding: .3rem .85rem;
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 6px;
}

.btn-reopen-incident:hover {
  background: #fde68a;
}

.add-files-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.add-files-form .form-actions {
  justify-content: flex-start;
  padding-top: .75rem;
}

.btn-upload {
  font-size: .82rem;
  padding: .55rem 1.25rem;
}

/* ─── Email Report ─── */
.email-report-desc {
  font-size: .88rem;
  color: var(--text-mid);
  margin-bottom: 1rem;
}

.email-report-form {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

.email-input {
  flex: 1;
  min-width: 220px;
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.email-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-send-email {
  font-size: .85rem;
  padding: .65rem 1.25rem;
  white-space: nowrap;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ─── Policies ─── */
.policy-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.policy-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}

.policy-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--accent), #6366f1);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity .25s;
}

.policy-item:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.policy-item:hover::before {
  opacity: 1;
}

.policy-item h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .4rem;
  letter-spacing: -.01em;
}

.policy-item p {
  font-size: .9rem;
  color: var(--text-mid);
  line-height: 1.65;
}

.policy-meta {
  margin-top: .65rem;
  font-size: .78rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ─── Knowledge Base ─── */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

a.kb-category {
  text-decoration: none;
  color: inherit;
}

.kb-category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all .25s ease;
  cursor: pointer;
}

.kb-category:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.kb-category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
}

.kb-category-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.01em;
}

.kb-category-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb-category-icon svg {
  width: 22px;
  height: 22px;
}

.kb-category-icon.equipment {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
}

.kb-category-icon.workflows {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}

.kb-category-icon.venues {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
}

.kb-category-icon.training {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
}

.kb-category-desc {
  font-size: .88rem;
  color: var(--text-mid);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.kb-empty {
  font-size: .82rem;
  color: var(--text-light);
  font-style: italic;
  padding: .75rem 1rem;
  background: var(--border-light);
  border-radius: var(--radius);
  text-align: center;
}

.kb-count {
  font-size: .78rem;
  color: var(--text-light);
  font-weight: 500;
}

/* KB Article List */
.kb-article-list {
  display: flex;
  flex-direction: column;
}

.kb-article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}

.kb-article-row:last-child { border-bottom: none; }
.kb-article-row:hover { background: #f8fafc; }

.kb-article-info { flex: 1; min-width: 0; }

.kb-article-info h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .2rem;
}

.kb-article-meta {
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: .35rem;
}

.kb-article-preview {
  font-size: .85rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.kb-article-arrow {
  flex-shrink: 0;
  color: var(--text-light);
  margin-left: 1rem;
  transition: transform .2s;
}

.kb-article-row:hover .kb-article-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* KB Article Content */
.kb-article-content {
  font-size: .92rem;
  color: var(--text-mid);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* KB Edit Form */
.kb-edit-form {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.kb-edit-form .form-group {
  margin-bottom: 1rem;
}

.kb-edit-form .form-group input,
.kb-edit-form .form-group textarea {
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}

.kb-edit-form .form-group input:focus,
.kb-edit-form .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.card-header-actions {
  margin-left: auto;
}

.btn-edit-article {
  font-size: .75rem;
  padding: .3rem .85rem;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all .15s;
}

.btn-edit-article:hover {
  background: var(--accent);
  color: white;
}

.btn-secondary {
  background: var(--border-light);
  color: var(--text-mid);
  border: 1px solid var(--border);
  margin-left: .5rem;
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: .82rem;
  padding: .55rem 1.25rem;
}

.btn-danger:hover {
  background: #fecaca;
}

.kb-danger-zone {
  border-color: #fecaca;
}

.kb-danger-zone .card-body {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.75rem;
}

/* ─── Footer ─── */
.site-footer {
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--text-light);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.footer-logo {
  height: 72px;
  width: auto;
  opacity: .4;
}

.site-footer p {
  margin: 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; height: 60px; }
  .brand-divider, .brand-portal { display: none; }
  .nav-links a { padding: .45rem .65rem; font-size: .8rem; }
  .nav-links a svg { display: none; }
  .container { padding: 1.5rem 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .dashboard-grid, .dashboard-grid.grid-2 { grid-template-columns: 1fr; }
  .kb-grid { grid-template-columns: 1fr; }
  .hero-banner { padding: 2rem 1.5rem; }
  .hero-logo-img { height: 96px; }
  .hero-banner h1 { font-size: 1.5rem; }
}
