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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 18px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner h1 { font-size: 20px; font-weight: 600; letter-spacing: 0.3px; }
.subtitle { font-size: 12px; color: #8892b0; margin-top: 3px; }

/* ── Main ─────────────────────────────────────────────────── */
main { padding: 20px 16px; }

/* ── States ───────────────────────────────────────────────── */
.hidden { display: none !important; }

.loading-state {
  display: flex; align-items: center; gap: 12px;
  justify-content: center; padding: 60px;
  color: #555;
}
.spinner {
  width: 22px; height: 22px; border: 3px solid #dde;
  border-top-color: #1a1a2e; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-state {
  background: #fff0f0; border: 1px solid #fcc; color: #900;
  padding: 16px 20px; border-radius: 8px; margin: 20px 0;
}

/* ── Table scroll wrapper ─────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  background: #fff;
}

/* ── Pivot table ──────────────────────────────────────────── */
#pivot-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;
}

/* ── Header rows ──────────────────────────────────────────── */
#pivot-table thead th {
  position: relative; /* needed for col-resizer absolute positioning */
}

#pivot-table thead tr:first-child th {
  background: #1a1a2e;
  color: #ccd6f6;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid #2a2a4e;
  border-bottom: none;
  position: sticky; top: 0; z-index: 10;
}
#pivot-table thead tr:first-child th:first-child {
  text-align: left;
  min-width: 320px;
  border-right: 2px solid #0f3460;
}

#pivot-table thead tr:nth-child(2) th {
  background: #16213e;
  color: #8892b0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  text-align: right;
  white-space: nowrap;
  border-right: 1px solid #2a2a4e;
  border-top: none;
  position: sticky; top: 37px; z-index: 10; /* JS overrides top after render */
}
#pivot-table thead tr:nth-child(2) th.col-detail {
  text-align: left;
  min-width: 100px;
  color: #7a8aaa;
}
#pivot-table thead tr:nth-child(2) th.col-detail-wide { min-width: 200px; }
#pivot-table thead tr:nth-child(2) th.col-detail-last {
  border-right: 2px solid #0f3460;
}
#pivot-table thead tr:nth-child(2) th.col-count { color: #556; }
#pivot-table thead tr:nth-child(2) th.col-total-net { color: #e0c97f; }

/* ── Column resizer handle ────────────────────────────────── */
.col-resizer {
  position: absolute;
  right: 0; top: 0;
  width: 5px; height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 1;
}
.col-resizer:hover,
.col-resizer:active { background: rgba(255,255,255,0.25); }

/* ── Footer ───────────────────────────────────────────────── */
#pivot-table tfoot td {
  background: #f7f8fc;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 14px;
  border-top: 2px solid #1a1a2e;
  border-right: 1px solid #e2e6ed;
  text-align: right;
  white-space: nowrap;
  color: #1a1a2e;
}
#pivot-table tfoot td:first-child { text-align: left; border-right: 2px solid #1a1a2e; }
#pivot-table tfoot td.col-total-net { color: #0f3460; font-weight: 800; }

/* ── Body rows ────────────────────────────────────────────── */
#pivot-table tbody tr { transition: background 0.1s; }
#pivot-table tbody tr:hover { background: #f5f7ff !important; }

/* level colours */
tr.row-account  { background: #f0f4ff; }
tr.row-cc       { background: #f8f9fd; }
tr.row-vendor   { background: #fff; }
tr.row-trx      { background: #fffef8; }
tr.row-loading  { background: #fff; }

/* ── Cells ────────────────────────────────────────────────── */
#pivot-table tbody td {
  padding: 7px 14px;
  border-bottom: 1px solid #eef0f5;
  border-right: 1px solid #eef0f5;
  white-space: nowrap;
  vertical-align: middle;
}

/* label cell */
td.cell-label {
  text-align: left;
  border-right: 2px solid #dde2f0;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* amount cells */
td.cell-net, td.cell-count, td.cell-total-net {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
}
td.cell-count { color: #778; font-size: 11px; }
td.cell-total-net { font-weight: 600; background: #f7f8fc; }

/* positive / negative */
.positive { color: #1a1a2e; }
.negative { color: #c0392b; }
.zero     { color: #aaa; }
.blank    { color: transparent; }

/* ── Expand toggle ────────────────────────────────────────── */
.toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px;
  cursor: pointer; font-size: 9px; font-weight: 700;
  margin-right: 6px; flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
  user-select: none;
  vertical-align: middle;
}
.toggle:hover { background: #dde2f0; }
.toggle.open { background: #1a1a2e; color: #fff; }

/* ── Label indentation ────────────────────────────────────── */
.label-content { display: inline-flex; align-items: center; }
.label-text { overflow: hidden; text-overflow: ellipsis; }

.indent-0 .label-content { padding-left: 0px; }
.indent-1 .label-content { padding-left: 22px; }
.indent-2 .label-content { padding-left: 44px; }
.indent-3 .label-content { padding-left: 66px; }

.row-account .label-text  { font-weight: 600; font-size: 13px; }
.row-cc      .label-text  { font-weight: 500; color: #334; }
.row-vendor  .label-text  { color: #445; }
.row-trx     .label-text  { color: #667; font-size: 11.5px; }

.desc-tag {
  font-size: 10px; color: #8892b0; margin-left: 6px;
  font-weight: 400; white-space: nowrap;
}
.trx-type-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
  margin-left: 6px; white-space: nowrap;
  background: #eef0f8; color: #556;
}

/* ── Frozen / sticky columns ──────────────────────────────── */
/* Hover must override the JS-applied inline background on sticky cells */
#pivot-table tbody tr:hover td.sticky-col { background: #f5f7ff !important; }

/* Freeze-pane shadow on the rightmost pinned column */
td.cell-label    { box-shadow: 3px 0 6px -1px rgba(0,0,0,0.10); }
td.cell-trx-type { box-shadow: 3px 0 6px -1px rgba(0,0,0,0.10); }

/* ── Transaction detail cells ─────────────────────────────── */
.cell-trx {
  padding: 5px 10px;
  border-bottom: 1px solid #eef0f5;
  border-right: 1px solid #eef0f5;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 11.5px;
  color: #445;
}
.cell-trx-num {
  padding-left: 74px; /* indent-3 equivalent */
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: #334;
  font-weight: 500;
}
.cell-trx-date { color: #778; }
.cell-trx-desc {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #556;
}
.cell-trx-type {
  text-align: center;
  font-size: 10.5px;
  color: #778;
  border-right: 2px solid #dde2f0;
}

/* loading row */
.loading-row-cell {
  color: #aaa; font-style: italic; font-size: 11px;
}

/* ── Login page ───────────────────────────────────────────── */
body.login-body {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 52px; height: 52px;
  background: #1a1a2e;
  color: #ccd6f6;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: #8892b0;
}

.login-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: #900;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.btn-login {
  width: 100%;
  padding: 11px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
.btn-login:hover:not(:disabled) { background: #0f3460; }
.btn-login:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Navigation ───────────────────────────────────────────── */
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
}
header nav { display: flex; gap: 6px; }
.nav-link {
  color: #8892b0; text-decoration: none;
  font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #ccd6f6; }
.nav-link.active { background: rgba(255,255,255,0.12); color: #fff; }

.nav-user {
  font-size: 12px;
  color: #8892b0;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  white-space: nowrap;
}
.nav-user::before { content: '👤  '; font-size: 11px; }

.nav-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #8892b0;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-logout:hover { background: rgba(255,255,255,0.08); color: #ccd6f6; }

/* ── Toolbar (filters + refresh) ─────────────────────────── */
.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #667;
}

.filter-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d0d5e0;
  border-radius: 6px;
  font-size: 12px;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  width: 160px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-input:focus {
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}
.filter-input::placeholder { color: #aab; }

.btn-clear {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d0d5e0;
  border-radius: 6px;
  background: #fff;
  color: #667;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-clear:hover { background: #f0f2f5; color: #334; }

/* ── View mode toggle ─────────────────────────────────────── */
.view-mode-group {
  display: flex;
  border: 1px solid #d0d5e0;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.btn-view-mode {
  height: 34px;
  padding: 0 14px;
  background: #fff;
  color: #667;
  border: none;
  border-left: 1px solid #d0d5e0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn-view-mode:first-child { border-left: none; }
.btn-view-mode:hover:not(.active) { background: #f0f2f5; color: #334; }
.btn-view-mode.active {
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
}

.btn-export {
  height: 36px;
  padding: 0 18px;
  background: #1a7a4a;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-export:hover { background: #155f3a; }

.btn-refresh {
  height: 36px;
  padding: 0 18px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
.btn-refresh:hover:not(:disabled) { background: #0f3460; }
.btn-refresh:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Sync status banner ───────────────────────────────────── */
.sync-status {
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
}
.sync-success {
  background: #edfaf3;
  border: 1px solid #a8e6c5;
  color: #1a7a4a;
}
.sync-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: #900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sync-info {
  background: #f0f4ff;
  border: 1px solid #c0d0f0;
  color: #334;
}
.sync-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
  flex-shrink: 0;
}
.sync-dismiss:hover { opacity: 1; }

/* ── Financial Calendar page ──────────────────────────────── */
.cal-container { max-width: 1100px; margin: 0 auto; padding: 4px 0; }

.cal-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.cal-toolbar-left  { display: flex; align-items: flex-end; gap: 10px; }
.cal-toolbar-right { display: flex; align-items: center; gap: 10px; }

.year-selector { display: flex; gap: 6px; }
.year-input { width: 110px !important; }

.btn-load {
  height: 34px; padding: 0 14px;
  background: #1a1a2e; color: #fff;
  border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-load:hover { background: #0f3460; }

.btn-generate {
  height: 36px; padding: 0 16px;
  background: #0f3460; color: #fff;
  border: none; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.btn-generate:hover { background: #1a1a2e; }

.btn-add {
  height: 36px; padding: 0 16px;
  background: #1a7a4a; color: #fff;
  border: none; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.btn-add:hover { background: #155f3a; }

/* Calendar table */
#cal-table {
  border-collapse: collapse;
  width: 100%;
}
#cal-table thead th {
  background: #1a1a2e;
  color: #ccd6f6;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 10px 14px; text-align: center;
  white-space: nowrap; border-right: 1px solid #2a2a4e;
  position: sticky; top: 0; z-index: 5;
}
#cal-table thead th:first-child { text-align: center; min-width: 40px; }
#cal-table thead th.col-name    { text-align: left; min-width: 130px; }

#cal-table tbody tr { transition: background 0.1s; }
#cal-table tbody tr:hover { background: #f5f7ff !important; }

.cal-row { background: #fff; }
.cal-row.row-quarter { background: #f0f4ff; }
.cal-row.row-annual  { background: #fffbf0; }

#cal-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid #eef0f5;
  border-right: 1px solid #eef0f5;
  vertical-align: middle;
  white-space: nowrap;
}

.col-num     { text-align: center; color: #778; font-size: 12px; width: 40px; }
.col-name    { font-weight: 500; color: #1a1a2e; }
.col-type    { text-align: center; width: 90px; }
.col-date    { color: #445; font-size: 12px; min-width: 110px; }
.col-days    { text-align: center; font-variant-numeric: tabular-nums;
               font-family: 'SF Mono','Fira Code','Consolas',monospace;
               font-size: 12px; width: 80px; }
.col-actions { text-align: center; width: 80px; white-space: nowrap; }
.days-missing { color: #c0392b; font-style: italic; }

.btn-row-edit, .btn-row-delete {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 5px; border-radius: 4px;
  opacity: 0.7; transition: opacity 0.15s, background 0.15s;
}
.btn-row-edit:hover   { opacity: 1; background: #eef0f8; }
.btn-row-delete:hover { opacity: 1; background: #fff0f0; }

/* Period type badges */
.cal-badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 10px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-month   { background: #eef0f8; color: #556; }
.badge-quarter { background: #dce8ff; color: #1a4a9e; }
.badge-annual  { background: #fff3cd; color: #856404; }

.cal-empty-row td {
  text-align: center; color: #8892b0;
  padding: 40px 20px; font-style: italic;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 28px 32px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: #8892b0; padding: 2px 6px;
  border-radius: 4px; transition: color 0.15s;
}
.modal-close:hover { color: #1a1a2e; }

.modal-grid   { display: grid; grid-template-columns: 1fr 1fr;   gap: 16px; }
.modal-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.modal-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid #d0d5e0; border-radius: 6px;
  font-size: 13px; color: #1a1a2e; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}
.modal-input:focus {
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}
.modal-input[readonly] { background: #f7f8fc; color: #667; cursor: default; }
.modal-select { appearance: auto; }

.modal-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; margin-top: 20px;
}
.btn-cancel {
  padding: 9px 20px; background: #f0f2f5; color: #334;
  border: none; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-cancel:hover { background: #dde2f0; }

.modal-error {
  margin-top: 12px; padding: 10px 12px;
  background: #fff0f0; border: 1px solid #fcc;
  color: #900; font-size: 12px; border-radius: 6px;
}

.gen-desc {
  font-size: 12px; color: #667; line-height: 1.6;
  margin-bottom: 20px;
}
.gen-note {
  font-size: 11px; color: #8892b0; line-height: 1.5;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid #eef0f5;
}

/* ── Settings page ────────────────────────────────────────── */
.settings-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 0;
}
.settings-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 28px 32px;
}
.settings-title {
  font-size: 15px; font-weight: 600;
  color: #1a1a2e; margin-bottom: 8px;
}
.settings-desc {
  font-size: 12px; color: #667; margin-bottom: 24px; line-height: 1.5;
}
.settings-desc code {
  background: #f0f2f5; padding: 1px 6px;
  border-radius: 4px; font-size: 11px; color: #1a1a2e;
}

/* form groups */
.form-group {
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 18px;
}
.form-group label {
  font-size: 12px; font-weight: 600;
  color: #334; letter-spacing: 0.3px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  padding: 9px 12px;
  border: 1px solid #d0d5e0;
  border-radius: 6px;
  font-size: 13px; color: #1a1a2e;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus {
  border-color: #1a1a2e;
  box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}
.field-hint {
  font-size: 11px; color: #8892b0;
}

/* static (read-only) field */
.form-group--static { margin-bottom: 24px; }
.static-value {
  font-size: 13px; color: #334;
  padding: 9px 0;
}
.static-note {
  font-size: 11px; color: #8892b0; margin-left: 6px;
}

/* actions */
.form-actions {
  display: flex; align-items: center; gap: 16px;
  margin-top: 8px;
}
.btn-save {
  background: #1a1a2e; color: #fff;
  border: none; border-radius: 7px;
  padding: 10px 24px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-save:hover:not(:disabled) { background: #16213e; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* status message */
.status-msg { font-size: 12px; }
.status-success { color: #1a7a4a; }
.status-error   { color: #c0392b; }

/* ── User Management page ─────────────────────────────────────────────────── */
.users-container { max-width: 900px; margin: 0 auto; padding: 4px 0; }

.page-section-title { font-size: 15px; font-weight: 600; color: #1a1a2e; }

#users-table {
  border-collapse: collapse;
  width: 100%;
}
#users-table thead th {
  background: #1a1a2e;
  color: #ccd6f6;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 10px 14px; text-align: left;
  white-space: nowrap; border-right: 1px solid #2a2a4e;
  position: sticky; top: 0; z-index: 5;
}
#users-table thead th:last-child { text-align: center; }

#users-table tbody tr { transition: background 0.1s; }
#users-table tbody tr:hover { background: #f5f7ff !important; }
#users-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #eef0f5;
  border-right: 1px solid #eef0f5;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 12px;
}
.users-col-actions { text-align: center; width: 120px; }
.users-col-login   { color: #778; font-size: 11px; }

/* Profile and status badges */
.badge-admin    { background: #ffe4b5; color: #8b5e00; }
.badge-viewer   { background: #eef0f8; color: #556; }
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }

/* Action buttons in user rows */
.btn-row-action {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 3px 6px; border-radius: 4px;
  opacity: 0.75; transition: opacity 0.15s, background 0.15s;
}
.btn-row-action:hover { opacity: 1; background: #eef0f8; }

/* ── Login-page helpers (forgot / reset) ──────────────────────────────────── */
.login-footer {
  text-align: center;
  margin-top: 16px;
}
.login-link {
  font-size: 12px;
  color: #8892b0;
  text-decoration: none;
  transition: color 0.15s;
}
.login-link:hover { color: #1a1a2e; }

.login-msg {
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.5;
}
.login-msg-success {
  background: #edfaf3;
  border: 1px solid #a8e6c5;
  color: #1a7a4a;
}
.login-msg-error {
  background: #fff0f0;
  border: 1px solid #fcc;
  color: #900;
}
