/* ================================
   Design Tokens
   ================================ */
:root {
  /* Brand */
  --navy:        #0f2444;
  --navy-700:    #1a3560;
  --navy-600:    #1e3a6e;
  --navy-500:    #2a4d85;
  --teal:        #32ba9a;
  --teal-600:    #27997e;
  --teal-100:    #e6f7f4;

  /* Surface */
  --bg:          #f0f4f8;
  --panel:       #ffffff;
  --panel-alt:   #f7f9fc;
  --panel-hover: #eef6f4;
  --border:      #dde3ed;

  /* Text */
  --text:        #1a2540;
  --muted:       #5a6a85;
  --subtle:      #8a9ab5;

  /* Status */
  --focus:       #7ec8bc;

  /* Layout */
  --sidebar-w:   260px;
  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(15,36,68,.07), 0 1px 2px rgba(15,36,68,.05);
  --shadow:      0 4px 12px rgba(15,36,68,.08), 0 1px 3px rgba(15,36,68,.05);
  --shadow-md:   0 8px 24px rgba(15,36,68,.10), 0 2px 6px rgba(15,36,68,.06);

  /* Type */
  --font-body:   Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --font-display:Arial, 'Helvetica Neue', Helvetica, sans-serif;
}

/* ================================
   Reset & Base
   ================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ================================
   Name Prompt Modal
   ================================ */
.name-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.name-modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.name-modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: modalIn 0.35s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.name-modal .modal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.name-modal .modal-logo img {
  height: 3rem;
  width: auto;
}

.name-modal h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy);
  margin: 0 0 8px;
}

.name-modal p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.name-modal input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--panel-alt);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
}

.name-modal input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(50,186,154,.18);
}

.name-modal button {
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.name-modal button:hover { background: var(--navy-600); }

/* ================================
   Top Bar
   ================================ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 64px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  z-index: 500;
  box-shadow: var(--shadow-sm);
}

.topbar .page-label {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  flex: 1;
}

/* Page title in main body is now redundant — topbar carries it */
.page-title { display: none; }

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--teal-100);
  color: var(--navy);
  padding: 7px 14px 7px 10px;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-pill i {
  color: var(--teal-600);
  font-size: 0.95rem;
}

/* ================================
   Sidebar
   ================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.sidebar-header img {
  height: 3.6rem;
  width: auto;
}

.sidebar-header .brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}

.sidebar-header .brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.nav-section {
  padding: 20px 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.nav-links a i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

.nav-links a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-links a.active {
  background: var(--teal);
  color: #fff;
}

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

.sidebar-footer {
  padding: 16px 12px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.sidebar-footer a i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-footer a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

/* Mobile close button */
.close-btn {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.close-btn:hover { background: rgba(255,255,255,.2); }

/* Mobile hamburger */
.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 1100;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

/* ================================
   Main Content
   ================================ */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: 64px;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 32px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--navy);
  margin: 0 0 28px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ================================
   Stat Cards (Dashboard)
   ================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--panel);
  padding: 22px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--teal);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1;
}

.target-number {
  font-size: 0.78rem;
  color: var(--subtle);
  margin: 6px 0 0;
}

/* ================================
   Summary Cards (Admin)
   ================================ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--panel);
  padding: 20px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.summary-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal);
  border-radius: var(--radius) var(--radius) 0 0;
}

.summary-card h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.summary-card .value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
}

/* ================================
   Tables
   ================================ */
.table-section { margin-top: 8px; }

.table-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.table-wrapper {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

thead {
  background: var(--navy);
}

thead th {
  color: rgba(255,255,255,.8);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 13px 16px;
  text-align: left;
}

tbody td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

tbody tr:nth-child(even) td { background: var(--panel-alt); }

tbody tr:hover td { background: var(--panel-hover); }

/* ================================
   Filters
   ================================ */
.filters-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* All filter controls share identical height/padding/border */
.filter-group input,
.filter-group select,
.filter-group .btn-reset {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--panel-alt);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(50,186,154,.15);
}

.filter-group .btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-alt);
  color: var(--muted);
  border-color: var(--border);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  width: 100%;
}

.filter-group .btn-reset:hover {
  background: #fce8e8;
  color: #c0392b;
  border-color: #e8b4b4;
}

.filter-search { min-width: 200px; max-width: 280px; }

/* ================================
   Buttons
   ================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover  { background: var(--navy-600); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--teal-100);
  color: var(--teal-600);
  border: 1.5px solid var(--teal);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover { background: #d0f0ea; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

/* ================================
   Forms (Add PD Entry)
   ================================ */
.form-card {
  background: var(--panel);
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.pd-form {
  display: grid;
  gap: 6px;
}

.field-group {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.field-group .field-hint {
  font-size: 0.78rem;
  color: var(--subtle);
  margin-top: 2px;
}

.required-star { color: var(--teal-600); margin-left: 2px; }

.pd-form input[type="text"],
.pd-form input[type="date"],
.pd-form input[type="number"],
.pd-form input[type="file"],
.pd-form select,
.pd-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.925rem;
  color: var(--text);
  background: var(--panel-alt);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pd-form input:focus,
.pd-form select:focus,
.pd-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(50,186,154,.15);
  background: #fff;
}

.pd-form textarea { resize: vertical; min-height: 110px; }

.pd-form .two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-submit-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-submit-row .btn-primary {
  padding: 12px 28px;
  font-size: 1rem;
}

/* ================================
   Focus visible
   ================================ */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ================================
   Overlay
   ================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 900;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ================================
   Description col — hidden on screen
   ================================ */
.description-col { display: none; }

/* ================================
   Responsive
   ================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .topbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle { display: flex; align-items: center; }
  .close-btn   { display: flex; }

  .pd-form .two-cols { grid-template-columns: 1fr; }

  .container { padding: 24px 16px; }

  .form-card { padding: 24px 20px; }
}

@media (max-width: 600px) {
  .filters { flex-direction: column; }
  .filter-group { min-width: 100%; }
}

/* ================================
   Print
   ================================ */
@media print {
  @page { size: landscape; }

  .sidebar,
  .topbar,
  .menu-toggle,
  .close-btn,
  .filters-card,
  .button-row,
  .name-modal-backdrop,
  .overlay { display: none !important; }

  .main-content { margin: 0 !important; padding: 0 !important; }
  .container { max-width: none; margin: 0; padding: 0; }

  body { background: #fff; }

  .description-col { display: table-cell; }

  thead { background: var(--navy) !important; -webkit-print-color-adjust: exact; }
}

/* ================================
   Auth Page (auth.html)
   ================================ */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.auth-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo img {
  height: 3.5rem;
  width: auto;
}

.auth-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active {
  color: var(--navy);
  border-bottom-color: var(--teal);
}

.auth-tab:hover { color: var(--navy); }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .field-group {
  margin-bottom: 0;
}

.auth-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 5px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.925rem;
  color: var(--text);
  background: var(--panel-alt);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  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 fill='%235a6a85' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.auth-form select { padding-right: 36px; }

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(50,186,154,.15);
  background-color: #fff;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 44px;
}

.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.toggle-pw:hover { color: var(--navy); }

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 1rem;
  margin-top: 4px;
}

.forgot-link {
  text-align: center;
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.forgot-link a {
  color: var(--teal-600, #2c9f82);
  text-decoration: none;
  font-weight: 500;
}

.forgot-link a:hover { text-decoration: underline; }

.auth-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.auth-alert.hidden { display: none; }

.auth-alert.error {
  background: #fde8e8;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}

.auth-alert.success {
  background: var(--teal-100);
  color: var(--teal-600);
  border: 1px solid #a8dfd4;
}

@media (max-width: 500px) {
  .auth-card { padding: 28px 20px; }
}

/* ================================
   Print / PDF — My PD Log
   ================================ */
@media print {

  /* Print header with logo and staff details */
  .print-header {
    display: flex !important;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #0f2444;
  }

  .print-header img {
    height: 3rem;
    width: auto;
  }

  .print-header-text {
    display: flex;
    flex-direction: column;
  }

  .print-header-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0f2444;
  }

  .print-header-meta {
    font-size: 0.8rem;
    color: #555;
  }

  /* Reduce table font size for print */
  tbody td {
    font-size: 0.75rem !important;
    padding: 7px 10px !important;
  }

  thead th {
    font-size: 0.7rem !important;
    padding: 8px 10px !important;
  }

  /* Show description column */
  .description-col {
    display: table-cell !important;
  }

  /* Page title for print */
  .print-title {
    font-size: 1.1rem !important;
    font-weight: 700;
    color: #0f2444;
    margin: 0 0 16px;
    display: block !important;
  }
}

/* Hide print-only elements on screen */
.print-header,
.print-title {
  display: none;
}

/* ================================
   Profile page
   ================================ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 960px;
}

@media (max-width: 760px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* ================================
   Shared form card (profile, users)
   ================================ */
.form-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-heading i { color: var(--teal); }

/* field-group already defined globally — just ensure selects match inputs */
.field-group select,
.field-group input:not([type="file"]) {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--panel-alt);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.field-group select {
  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 fill='%235a6a85' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.field-group select:focus,
.field-group input:not([type="file"]):focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(50,186,154,.15);
  background-color: #fff;
}

.input-disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  background: var(--bg) !important;
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-actions {
  margin-top: 8px;
}

/* ================================
   Form alert (profile / users)
   ================================ */
.form-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.form-alert.hidden   { display: none; }
.form-alert.success  { background: #d1fae5; color: #065f46; }
.form-alert.error    { background: #fee2e2; color: #991b1b; }

/* ================================
   Auth page heading helpers
   ================================ */
.auth-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}

.auth-subheading {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 24px;
}

/* ================================
   Inline table inputs (users.html)
   ================================ */
.inline-select,
.inline-input {
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.85rem;
  background: var(--panel-alt);
  color: var(--text);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.inline-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6a85' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
  min-width: 140px;
}

.inline-select:focus,
.inline-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(50,186,154,.15);
}

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-size: 0.9rem;
}

/* Admin links hidden by default; .visible class shows them */
a.admin-link { display: none; }
a.admin-link.visible { display: flex; }

/* ================================
   Toast notifications
   ================================ */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  pointer-events: all;
  animation: toast-in 0.25s ease;
}

.toast.success { background: #059669; }
.toast.error   { background: #dc2626; }
.toast.info    { background: var(--navy); }

.toast i { font-size: 1.1rem; flex-shrink: 0; }

.toast-msg { flex: 1; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0 0 6px;
  flex-shrink: 0;
}

.toast-close:hover { color: #fff; }

.toast.toast-out {
  animation: toast-out 0.25s ease forwards;
}

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

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

@media (max-width: 600px) {
  #toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
  .toast { max-width: 100%; }
}

/* ================================
   Auth alert info type
   ================================ */
.auth-alert.info { background: #dbeafe; color: #1e3a8a; }

/* ================================
   Users page layout
   ================================ */
.users-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1000px) {
  .users-layout { grid-template-columns: 1fr; }
}

.invite-card { position: sticky; top: 24px; }

.card-subtext {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -12px 0 20px;
}

.two-col-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.users-list-section { min-width: 0; }

.users-filters {
  grid-template-columns: 1fr 140px 180px auto auto !important;
}

.req { color: #dc2626; }

/* Archive row styling */
.row-archived td {
  opacity: 0.5;
}

.badge-archived {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fee2e2;
  color: #991b1b;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Icon buttons (save / archive) */
.btn-icon {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-icon:hover { background: var(--panel-alt); color: var(--navy); }

.btn-icon-archive:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-icon-restore:hover {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

/* Checkbox label inline */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  accent-color: var(--teal);
  cursor: pointer;
}