/* ─────────────────────────────────────────────────────
   PEACE Employee Management — CSS
   CI Color: #055c37
   ───────────────────────────────────────────────────── */

:root {
  --primary: #055c37;
  --primary-light: #078a52;
  --primary-dark: #044a2c;
  --primary-bg: #f0f7f4;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────
   Loading Overlay
   ───────────────────────────────────────────────────── */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s, visibility .5s;
}
.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}
.loading-spinner {
  text-align: center;
  position: relative;
}
.loading-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  animation: pulse 1.5s ease-in-out infinite;
}
.spinner-ring {
  width: 100px;
  height: 100px;
  border: 3px solid var(--gray-200);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -70%);
  animation: spin 1.2s linear infinite;
}
.loading-text {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: .5px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: .8; }
}
@keyframes spin { to { transform: translate(-50%, -70%) rotate(360deg); } }

/* ─────────────────────────────────────────────────────
   Login Screen
   ───────────────────────────────────────────────────── */

.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #055c37 0%, #078a52 50%, #0aa564 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-width: 420px;
  width: 90%;
  animation: slideUp .5s ease-out;
}
.login-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
}
.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.login-card p { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.login-note {
  font-size: 13px;
  color: var(--danger);
  margin-top: 16px;
  min-height: 20px;
}
.login-footer {
  margin-top: 24px;
  font-size: 12px;
  color: rgba(255,255,255,.6);
}

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

.btn-microsoft {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow);
}
.btn-microsoft:hover { background: var(--primary-light); border-color: var(--primary-light); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-microsoft:active { transform: translateY(0); }
.btn-microsoft:disabled { opacity: .5; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────
   Header
   ───────────────────────────────────────────────────── */

.header {
  background: #fff;
  border-bottom: 2px solid var(--primary);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 36px; height: 36px; object-fit: contain; }
.header h1 { font-size: 16px; font-weight: 700; color: var(--primary); }
.badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.sync-info { font-size: 12px; color: var(--gray-500); }

/* ─────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-bg); }
.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }
.icon { font-size: 14px; display: inline-block; }

/* ─────────────────────────────────────────────────────
   User Info
   ───────────────────────────────────────────────────── */

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--gray-200);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.user-name { font-size: 12px; font-weight: 500; color: var(--gray-700); }

/* ─────────────────────────────────────────────────────
   Toolbar
   ───────────────────────────────────────────────────── */

.toolbar {
  padding: 16px 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.search-input, .dept-filter {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  transition: border .15s;
}
.search-input:focus, .dept-filter:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,92,55,.1); }
.search-input { flex: 1; min-width: 200px; }
.dept-filter { min-width: 180px; }
.checkbox-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: all .15s;
}
.checkbox-filter:hover { border-color: var(--primary); background: var(--primary-bg); }
.checkbox-filter input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

/* ─────────────────────────────────────────────────────
   Table
   ───────────────────────────────────────────────────── */

.table-container {
  padding: 0 24px 24px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: var(--shadow);
}
thead { background: var(--primary); }
th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  letter-spacing: .5px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--primary);
}
td {
  padding: 8px 12px;
  font-size: 13px;
  border-top: 1px solid var(--gray-100);
}
.text-muted { color: var(--gray-500); font-size: 11px; }

/* Name cell with photo */
.name-cell { display: flex; align-items: center; gap: 10px; }
.photo-placeholder {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
}
.photo-placeholder.has-photo { background: none; }
.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Modal profile photo */
.modal-profile-section { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; }
.modal-photo {
  width: 90px;
  height: 90px;
  min-width: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 3px solid var(--primary);
}
.modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-profile-info { width: 100%; }
.photo-placeholder-lg {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: var(--primary-bg); }

.status-active { color: var(--success); font-weight: 600; }
.status-inactive { color: var(--danger); font-weight: 600; }
.sig-icon { font-size: 16px; text-align: center; }
.sig-yes { color: var(--success); }
.sig-no { color: var(--gray-300); }

.loading-cell { text-align: center; padding: 40px; }

/* Dot pulse loader for table */
.table-loader { display: flex; justify-content: center; }
.dot-pulse {
  display: flex;
  gap: 6px;
}
.dot-pulse::before,
.dot-pulse::after,
.dot-pulse {
  position: relative;
}
.dot-pulse::before { content: ''; }
.dot-pulse::after { content: ''; }
.dot-pulse, .dot-pulse::before, .dot-pulse::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.dot-pulse::before {
  position: absolute;
  left: -16px;
  animation-delay: -.3s;
}
.dot-pulse::after {
  position: absolute;
  left: 16px;
  animation-delay: .3s;
}
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(.4); opacity: .3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─────────────────────────────────────────────────────
   Modal
   ───────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}
.modal-header h2 { font-size: 18px; color: var(--primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--gray-200);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,92,55,.1); }
.input-readonly { background: var(--gray-100); color: var(--gray-500); }
/* Exclude toggle */
.exclude-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--danger);
  cursor: pointer;
}
.exclude-toggle input { accent-color: var(--danger); width: 16px; height: 16px; cursor: pointer; }

/* Excluded row in table */
tr.excluded-row { opacity: .45; }
tr.excluded-row td:first-child { border-left: 3px solid var(--danger); }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Autocomplete */
.autocomplete-group { position: relative; }
.autocomplete-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-lg);
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--primary-bg); }
.autocomplete-item .ac-name { font-weight: 600; color: var(--gray-900); }
.autocomplete-item .ac-email { font-size: 11px; color: var(--gray-500); }
.autocomplete-item .ac-dept { font-size: 11px; color: var(--primary); }
.autocomplete-clear {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--danger);
  text-align: center;
  border-bottom: 1px solid var(--gray-100);
}
.autocomplete-clear:hover { background: #fee2e2; }

/* ─────────────────────────────────────────────────────
   Signature Section
   ───────────────────────────────────────────────────── */

.signature-section { display: flex; flex-direction: column; gap: 10px; }
.signature-preview {
  width: 100%;
  height: 120px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gray-50);
}
.signature-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.no-signature { color: var(--gray-500); font-size: 13px; }

/* ─────────────────────────────────────────────────────
   Toast
   ───────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

/* ─────────────────────────────────────────────────────
   View Toggle
   ───────────────────────────────────────────────────── */

.view-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 2px;
  margin-left: 12px;
}
.view-btn {
  padding: 5px 14px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 6px;
  transition: all .15s;
}
.view-btn.active {
  background: var(--primary);
  color: #fff;
}
.view-btn:hover:not(.active) { color: var(--primary); }

/* ─────────────────────────────────────────────────────
   Dashboard View
   ───────────────────────────────────────────────────── */

.dashboard-view { padding: 20px 24px; }

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dash-kpi-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.clickable { cursor: pointer; transition: all .15s; }
.clickable:hover { opacity: .85; transform: translateY(-1px); }
.dash-kpi-card.clickable:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.dash-dept-row.clickable:hover { background: var(--primary-bg); border-radius: 6px; }
.dash-level-item.clickable:hover { background: var(--gray-50); border-radius: 6px; padding: 4px; margin: -4px; }
.dash-div-item.clickable:hover { background: var(--primary-bg); }

.dash-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.dash-kpi-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.dash-kpi-value.dash-green { color: var(--success); }
.dash-kpi-value.dash-red { color: var(--danger); }
.dash-kpi-sub {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.dash-card-wide { }
.dash-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  background: #fff;
  padding-bottom: 8px;
  z-index: 1;
}

/* Dept bars */
.dash-dept-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.dash-dept-name {
  width: 220px;
  min-width: 220px;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-700);
}
.dash-dept-bar-bg {
  flex: 1;
  height: 16px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.dash-dept-bar {
  height: 100%;
  background: linear-gradient(135deg, #004226, #055c37);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  transition: width .8s ease-out;
}
.dash-dept-bar span {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}

/* Gender donut */
.dash-gender-chart {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
}
.dash-donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.dash-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dash-donut-num { font-size: 28px; font-weight: 800; color: var(--gray-900); }
.dash-donut-label { font-size: 10px; color: var(--gray-500); text-transform: uppercase; }

.dash-legend { display: flex; flex-direction: column; gap: 8px; }
.dash-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}
.dash-legend-left { display: flex; align-items: center; color: var(--gray-700); }
.dash-legend-val { font-weight: 600; color: var(--gray-900); }

/* Recent hires */
.dash-hire-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: var(--gray-50);
  margin-bottom: 8px;
}
.dash-hire-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #004226, #055c37);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-hire-info { flex: 1; min-width: 0; }
.dash-hire-name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.dash-hire-dept { font-size: 11px; color: var(--gray-500); }
.dash-hire-date { font-size: 11px; color: var(--gray-500); white-space: nowrap; }

/* Division list */
.dash-div-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.dash-div-item:last-child { border-bottom: none; }
.dash-div-name { color: var(--gray-700); font-weight: 500; }
.dash-div-count { font-weight: 700; color: var(--primary); background: var(--primary-bg); padding: 2px 10px; border-radius: 12px; font-size: 12px; }

/* Level distribution */
.dash-level-grid {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.dash-level-donut-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.dash-level-donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.dash-level-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dash-level-center-num { font-size: 28px; font-weight: 800; color: var(--gray-900); }
.dash-level-center-label { font-size: 10px; color: var(--gray-500); text-transform: uppercase; }
.dash-level-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-level-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-level-label {
  width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.dash-level-bar-bg {
  flex: 1;
  height: 18px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.dash-level-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .8s ease-out;
}
.dash-level-count {
  width: 50px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
}
.dash-level-pct {
  width: 40px;
  text-align: right;
  font-size: 11px;
  color: var(--gray-500);
}

/* Responsive dashboard */
@media (max-width: 768px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-dept-name { width: 100px; font-size: 11px; }
  .view-toggle { margin-left: 0; margin-top: 8px; }
}

/* ─────────────────────────────────────────────────────
   Export Modal
   ───────────────────────────────────────────────────── */

.export-item { margin-bottom: 14px; }
.export-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.export-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.export-row code, .export-row pre {
  flex: 1;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--gray-700);
  max-height: 120px;
  overflow-y: auto;
}

/* API Tabs */
.api-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 0;
  overflow-x: auto;
}
.api-tab {
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all .15s;
}
.api-tab:hover { color: var(--primary); }
.api-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.api-tab-content { display: none; }
.api-tab-content.active { display: block; }
.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
}
.api-table th {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 6px 10px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
}
.api-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--gray-100);
  font-size: 12px;
}
.api-table code {
  background: var(--primary-bg);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.api-note {
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  font-size: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gray-700);
}
.api-note code {
  background: #fff;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ─────────────────────────────────────────────────────
   Secret Expiry Warning
   ───────────────────────────────────────────────────── */

.secret-warning {
  background: #fef3c7;
  border-bottom: 2px solid var(--warning);
  padding: 10px 24px;
  font-size: 13px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.secret-warning .warn-icon { font-size: 18px; }
.secret-warning a { color: #92400e; font-weight: 600; }

/* ─────────────────────────────────────────────────────
   Sync Button Spinner
   ───────────────────────────────────────────────────── */

.btn.syncing .icon {
  animation: spinBtn 1s linear infinite;
}
@keyframes spinBtn { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────
   Mobile Card View
   ───────────────────────────────────────────────────── */

/* On mobile: hide table, show card list */
.card-list { display: none; padding: 0 16px 16px; }
.emp-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .15s;
  border-left: 4px solid var(--primary);
}
.emp-card:active { box-shadow: var(--shadow-lg); }
.emp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.emp-card-name { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.emp-card-id { font-size: 12px; color: var(--primary); font-weight: 600; background: var(--primary-bg); padding: 2px 8px; border-radius: 4px; }
.emp-card-email { font-size: 12px; color: var(--gray-500); margin-bottom: 8px; }
.emp-card-details { display: flex; flex-wrap: wrap; gap: 6px; }
.emp-card-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.emp-card-tag.dept { background: #e0f2fe; color: #0369a1; }
.emp-card-tag.manager { background: #fef3c7; color: #92400e; }
.emp-card-tag.status-active { background: #dcfce7; color: #166534; }
.emp-card-tag.status-inactive { background: #fee2e2; color: #991b1b; }
.emp-card-tag.has-sig { background: #dcfce7; color: #166534; }

/* ─────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Header */
  .header {
    padding: 10px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .header-left { width: 100%; }
  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header h1 { font-size: 14px; }
  .sync-info { font-size: 11px; }

  /* Toolbar */
  .toolbar {
    padding: 10px 16px;
    flex-direction: column;
    gap: 8px;
  }
  .search-input { width: 100%; min-width: unset; }
  .dept-filter { width: 100%; min-width: unset; }
  .checkbox-filter { width: 100%; justify-content: center; }

  /* Switch to card view on mobile */
  .table-container { display: none; }
  .card-list { display: block; }

  /* Modal */
  .modal {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
  }
  .modal-overlay.active { align-items: flex-end; }
  .modal-header { padding: 16px 16px 0; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .form-row { flex-direction: column; gap: 0; }
  .form-group input { font-size: 16px; /* prevent iOS zoom */ }

  /* Toast */
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
  }

  /* User info */
  .user-info { border-left: none; padding-left: 0; }
}
