:root {
  --bg: #f8eef8;
  --panel: #ffffff;
  --text: #21162f;
  --muted: #746b80;
  --line: #eadff0;
  --primary: #a02beb;
  --danger: #b42318;
  --success: #027a48;
  --accent-blue: #3197e8;
  --accent-green: #2fc7a5;
  --accent-coral: #f26984;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(242, 105, 132, 0.28), transparent 34%),
    radial-gradient(circle at top right, rgba(160, 43, 235, 0.24), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  padding: 28px;
  gap: 0;
}

.sidebar {
  background: var(--panel);
  border: 1px solid rgba(234, 223, 240, 0.9);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  padding: 24px 18px;
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 28px;
}

.sidebar-brand {
  display: block;
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 26px;
}

.sidebar-user {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.sidebar-user span,
.eyebrow {
  color: var(--muted);
  font-size: 0.85rem;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 11px 12px;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a:focus {
  background: #f7eafa;
  color: var(--primary);
}

.nav-label {
  display: inline;
}

.nav-section {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 12px 4px;
  opacity: 0.7;
}

.main-area {
  min-width: 0;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(234, 223, 240, 0.9);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
}

.topbar-logo {
  height: 160px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.topbar-address {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted, #6b7280);
  margin-top: 1px;
}

.public-topbar {
  background: var(--panel);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 28px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 18px 44px rgba(74, 35, 99, 0.07);
}

.stacked-panel {
  margin-top: 18px;
}

.form {
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.inline-form {
  max-width: 520px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  min-height: auto;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.button-link.secondary {
  background: #475467;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  background: #475467;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.compact-actions {
  margin-top: 0;
}

.calendar-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
}

.calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 6px solid var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
}

.calendar-event div {
  display: grid;
  gap: 3px;
}

.calendar-event span,
.calendar-event small {
  color: var(--muted);
}

.calendar-event.status-pending {
  border-left-color: #f79009;
}

.calendar-event.status-approved {
  border-left-color: var(--success);
}

.calendar-event.status-rejected,
.calendar-event.status-cancelled {
  border-left-color: var(--danger);
  opacity: 0.72;
}

.reservation-workspace {
  margin: 18px 0 22px;
}

.reservation-calendar {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.calendar-toolbar,
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 96px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.calendar-day:hover,
.calendar-day:focus {
  background: #f7eafa;
  color: var(--text);
}

.muted-day {
  background: #f8fafc;
  color: var(--muted);
}

.calendar-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.calendar-chip.status-pending {
  background: #f79009;
}

.calendar-chip.status-approved {
  background: var(--success);
}

.reservation-form {
  margin-top: 18px;
}

.slide-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 22, 47, 0.36);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.slide-panel-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(74, 35, 99, 0.12);
  z-index: 950;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.slide-panel.open {
  transform: translateX(0);
}

.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.slide-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.slide-panel-close {
  background: none;
  color: var(--muted);
  min-height: auto;
  padding: 4px 8px;
  font-size: 1.3rem;
  cursor: pointer;
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.slide-panel-body .form {
  max-width: 100%;
}

.slide-panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(74, 35, 99, 0.14);
  font-size: 0.92rem;
  transform: translateX(110%);
  transition: transform 0.3s ease;
}

.toast.visible {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid var(--success);
  color: var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

.calendar-day.has-event {
  background: #faf5ff;
}

.calendar-day .event-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
}

.calendar-day .event-dot.status-pending {
  background: #f79009;
}

.calendar-day .event-dot.status-approved {
  background: var(--success);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
}

.filter-actions {
  align-items: end;
  margin-top: 0;
}

.payment-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

.payment-badge.status-pending {
  background: #f79009;
}

.payment-badge.status-approved {
  background: var(--success);
}

.payment-badge.status-rejected {
  background: var(--danger);
}

.payment-badge.status-uploaded {
  background: #6366f1;
}

.payment-grid-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

.payment-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.payment-grid th,
.payment-grid td {
  border: 1px solid var(--line);
  padding: 10px 8px;
  text-align: center;
  font-size: 0.88rem;
}

.payment-grid th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.payment-grid-name {
  text-align: left !important;
  font-weight: 600;
  white-space: nowrap;
  min-width: 180px;
  background: #ffffff;
  position: sticky;
  left: 0;
  z-index: 1;
}

.payment-grid-cell {
  width: 48px;
  min-width: 48px;
  font-size: 1.1rem;
}

.payment-grid-cell.status-approved {
  background: #d1fae5;
  color: var(--success);
}

.payment-grid-cell.status-pending {
  background: #fef3c7;
  color: #b45309;
}

.payment-grid-cell.status-rejected {
  background: #fee2e2;
  color: var(--danger);
}

.payment-grid-cell.status-none {
  background: #f8fafc;
  color: var(--muted);
}

.payment-grid-cell.status-overdue {
  background: #fee2e2;
  color: #dc2626;
}

.payment-grid-empty {
  color: #d1d5db;
}

.payment-grid-cell a {
  text-decoration: none;
  color: inherit;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  background: linear-gradient(135deg, var(--accent-coral), #ee579e);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  min-height: 132px;
  padding: 22px;
}

.metric-card:nth-child(2) {
  background: linear-gradient(135deg, var(--accent-blue), #3f76db);
}

.metric-card:nth-child(3) {
  background: linear-gradient(135deg, var(--accent-green), #59d3b8);
}

.metric-card:nth-child(4) {
  background: linear-gradient(135deg, #9254de, #bd4be7);
}

.metric-card:nth-child(5) {
  background: linear-gradient(135deg, #f59e6c, #f26984);
}

.metric-card span {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar,
  .main-area {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page {
    width: min(100% - 28px, 1180px);
  }

  .filters,
  .metric-grid,
  .scan-layout,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    display: grid;
  }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-actions form {
  margin: 0;
}

.details {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
}

.details div {
  display: grid;
  gap: 4px;
}

.details dt {
  color: var(--muted);
  font-weight: 700;
}

.details dd {
  margin: 0;
}

.details-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.scan-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 420px);
  gap: 20px;
  align-items: start;
}

.scanner-box {
  display: grid;
  gap: 10px;
}

.scanner-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101828;
  object-fit: cover;
}

.scanner-status {
  color: var(--muted);
  font-size: 0.92rem;
}

.security-access-panel {
  min-height: min(560px, calc(100vh - 160px));
  display: grid;
  align-items: center;
}

.security-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 22px;
}

.security-mode-picker[hidden],
#access-workspace[hidden] {
  display: none !important;
}

#access-workspace.qr-active #start-scan,
#access-workspace.qr-active #stop-scan,
#access-workspace.qr-active button[type="submit"],
#access-workspace.qr-active label {
  display: none !important;
}

#access-workspace.qr-active #access-form {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.security-mode-button {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  border-radius: 14px;
  padding: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent-blue));
  box-shadow: 0 18px 42px rgba(49, 151, 232, 0.18);
}

.security-mode-button.pin-mode {
  background: linear-gradient(135deg, #475467, var(--accent-green));
}

.security-mode-button strong {
  color: #ffffff;
  font-size: 3.2rem;
  line-height: 1;
}

.security-mode-button span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  font-weight: 700;
}

.segmented-control {
  display: inline-flex;
  gap: 8px;
}

.segmented-control .active {
  background: var(--primary);
}

.qr-panel {
  max-width: 620px;
}

.qr-preview {
  display: grid;
  place-items: center;
  margin: 22px 0;
}

.qr-preview img {
  width: min(280px, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.messages {
  margin-bottom: 16px;
}

.message {
  margin: 0 0 8px;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--success);
}

.help-text {
  margin: -6px 0 0;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checkbox-row label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

.period-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.login-download {
  margin-top: 18px;
}

.oauth-actions {
  margin-top: 18px;
}

.login-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.download-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.download-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.download-item h2 {
  margin: 0 0 10px;
}

.muted-note {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.theme-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.theme-card h2 {
  margin: 14px 0 8px;
}

.theme-card p {
  color: var(--muted);
}

.theme-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 110px;
  border-radius: 10px;
  padding: 14px;
  background: #f8eef8;
}

.theme-preview span {
  border-radius: 8px;
}

.purplo-preview span:nth-child(1) {
  background: linear-gradient(135deg, var(--accent-coral), #ee579e);
}

.purplo-preview span:nth-child(2) {
  background: linear-gradient(135deg, var(--accent-blue), #3f76db);
}

.purplo-preview span:nth-child(3) {
  background: linear-gradient(135deg, var(--accent-green), #59d3b8);
}

.coral-preview {
  background:
    linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(255, 140, 66, 0.06)),
    #faf7f5;
}

.coral-preview span:nth-child(1) {
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.25);
}

.coral-preview span:nth-child(2) {
  background: linear-gradient(135deg, #ff8c42, #ffa366);
  box-shadow: 0 6px 16px rgba(255, 140, 66, 0.22);
}

.coral-preview span:nth-child(3) {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  box-shadow: 0 6px 16px rgba(78, 205, 196, 0.22);
}

.financial-preview {
  background:
    linear-gradient(135deg, rgba(240, 247, 255, 0.95), rgba(255, 255, 255, 0.8)),
    #f4f8fb;
}

.financial-preview span {
  border: 1px solid rgba(174, 200, 222, 0.45);
  box-shadow: 0 10px 26px rgba(84, 117, 146, 0.16);
}

.financial-preview span:nth-child(1) {
  background: linear-gradient(135deg, #8fc8f4, #d9edf9);
}

.financial-preview span:nth-child(2) {
  background: linear-gradient(135deg, #5fc2b1, #d6f1ea);
}

.financial-preview span:nth-child(3) {
  background: linear-gradient(135deg, #b8d98f, #eef7df);
}

.executive-preview {
  grid-template-columns: 0.75fr 1fr 1fr;
  background: linear-gradient(90deg, #1d1f21 0 30%, #f7f8fb 30% 100%);
}

.executive-preview span:nth-child(1) {
  background: #2e3033;
}

.executive-preview span:nth-child(2) {
  background: linear-gradient(135deg, #ffffff, #f0f3f6);
  border: 1px solid #e3e7ec;
}

.executive-preview span:nth-child(3) {
  background: linear-gradient(135deg, #1b8f63, #cfeee0);
}

.theme-badge {
  display: inline-flex;
  border-radius: 999px;
  background: #f7eafa;
  color: var(--primary);
  font-weight: 700;
  padding: 6px 10px;
}

.theme-financial {
  --bg: #f3f7fb;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #263444;
  --muted: #6b7b8c;
  --line: #dfeaf2;
  --primary: #2f8ec8;
  --accent-blue: #79bbed;
  --accent-green: #5fc2b1;
  --accent-coral: #b9d98f;
  background:
    radial-gradient(circle at top left, rgba(121, 187, 237, 0.28), transparent 34%),
    radial-gradient(circle at bottom right, rgba(95, 194, 177, 0.2), transparent 30%),
    var(--bg);
}

.theme-financial .sidebar,
.theme-financial .main-area,
.theme-financial .topbar,
.theme-financial .panel,
.theme-financial .metric-card,
.theme-financial .download-item,
.theme-financial .theme-card {
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 42px rgba(85, 116, 145, 0.12);
}

.theme-financial .sidebar-brand,
.theme-financial .side-nav a:hover,
.theme-financial .side-nav a:focus {
  color: #2f8ec8;
}

.theme-financial .side-nav a:hover,
.theme-financial .side-nav a:focus {
  background: #eaf5fb;
}

.theme-financial {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
}

.theme-financial .app-shell {
  gap: 28px;
  padding: 28px;
}

.theme-financial .sidebar {
  margin: 0;
  border: 1px solid rgba(201, 218, 232, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 255, 0.82)),
    rgba(255, 255, 255, 0.9);
}

.theme-financial .sidebar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.theme-financial .sidebar-user {
  border: 0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(224, 243, 255, 0.9), rgba(239, 251, 247, 0.86));
}

.theme-financial .sidebar-user strong {
  font-size: 0.98rem;
}

.theme-financial .sidebar-user span {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.theme-financial .side-nav {
  gap: 7px;
}

.theme-financial .side-nav a {
  min-height: 42px;
  border-radius: 12px;
  color: #5e7081;
  font-size: 0.94rem;
  font-weight: 700;
}

.theme-financial .side-nav a:hover,
.theme-financial .side-nav a:focus {
  color: #247cae;
  background: linear-gradient(135deg, rgba(229, 244, 253, 0.96), rgba(231, 248, 243, 0.88));
  box-shadow: inset 3px 0 0 #55b7e5;
}

.theme-financial .main-area {
  border: 1px solid rgba(210, 225, 236, 0.74);
  border-radius: 22px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(245, 250, 253, 0.46)),
    rgba(255, 255, 255, 0.55);
  box-shadow: 0 22px 70px rgba(78, 112, 143, 0.15);
}

.theme-financial .topbar {
  min-height: 72px;
  border: 1px solid rgba(212, 226, 237, 0.72);
  border-radius: 18px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.76);
}

.theme-financial .topbar strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.theme-financial .eyebrow {
  color: #75a6c5;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-financial .page {
  padding: 0;
}

.theme-financial .panel,
.theme-financial .download-item,
.theme-financial .theme-card {
  border: 1px solid rgba(207, 224, 237, 0.78);
  border-radius: 18px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 253, 255, 0.74)),
    rgba(255, 255, 255, 0.82);
}

.theme-financial .stacked-panel {
  margin-top: 22px;
}

.theme-financial h1 {
  margin-bottom: 18px;
  color: #223244;
  font-size: 2rem;
  font-weight: 800;
}

.theme-financial h2 {
  color: #263a4d;
  font-size: 1.18rem;
  font-weight: 800;
}

.theme-financial .section-header {
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(215, 229, 239, 0.8);
}

.theme-financial .metric-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 22px;
}

.theme-financial .metric-card {
  min-height: 132px;
  border: 1px solid rgba(203, 222, 237, 0.7);
  border-radius: 16px;
  padding: 22px;
  color: #253647;
  background:
    linear-gradient(135deg, rgba(233, 247, 255, 0.94), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.78);
  overflow: hidden;
  position: relative;
}

.theme-financial .metric-card::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -22px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(121, 187, 237, 0.22);
}

.theme-financial .metric-card:nth-child(2) {
  background: linear-gradient(135deg, rgba(232, 249, 245, 0.96), rgba(255, 255, 255, 0.62));
}

.theme-financial .metric-card:nth-child(2)::after {
  background: rgba(95, 194, 177, 0.22);
}

.theme-financial .metric-card:nth-child(3) {
  background: linear-gradient(135deg, rgba(244, 250, 232, 0.96), rgba(255, 255, 255, 0.62));
}

.theme-financial .metric-card:nth-child(3)::after {
  background: rgba(185, 217, 143, 0.25);
}

.theme-financial .metric-card span {
  color: #6c7f90;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-financial .metric-card strong {
  color: #1f3347;
  font-size: 2rem;
  font-weight: 800;
}

.theme-financial form.form,
.theme-financial .filters {
  gap: 18px;
}

.theme-financial label {
  color: #607286;
  font-size: 0.92rem;
  font-weight: 700;
}

.theme-financial input,
.theme-financial select,
.theme-financial textarea {
  min-height: 46px;
  border: 1px solid rgba(195, 216, 232, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.theme-financial input:focus,
.theme-financial select:focus,
.theme-financial textarea:focus {
  border-color: #70bce7;
  box-shadow: 0 0 0 4px rgba(112, 188, 231, 0.2);
}

.theme-financial button,
.theme-financial .button {
  border-radius: 12px;
  background: linear-gradient(135deg, #5fb1df, #43b99f);
  box-shadow: 0 12px 24px rgba(65, 159, 190, 0.22);
}

.theme-financial .secondary-button {
  color: #425668;
  background: rgba(235, 243, 249, 0.92);
  box-shadow: none;
}

.theme-financial .table-wrap {
  border: 1px solid rgba(207, 224, 237, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.theme-financial table {
  border-collapse: collapse;
}

.theme-financial th {
  color: #587086;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(235, 246, 252, 0.95), rgba(242, 249, 252, 0.92));
}

.theme-financial td {
  border-bottom: 1px solid rgba(220, 232, 240, 0.82);
  color: #2f4052;
}

.theme-financial tr:last-child td {
  border-bottom: 0;
}

.theme-financial .scanner-video,
.theme-financial .qr-preview img,
.theme-financial .message {
  border-radius: 14px;
}

@media (max-width: 900px) {
  .theme-financial .app-shell {
    padding: 14px;
    gap: 14px;
  }

  .theme-financial .main-area,
  .theme-financial .panel {
    padding: 18px;
    border-radius: 16px;
  }

  .theme-financial .metric-grid {
    grid-template-columns: 1fr;
  }
}

.theme-executive {
  --bg: #e7e9ee;
  --panel: #ffffff;
  --text: #171b2a;
  --muted: #6d7482;
  --line: #eceff3;
  --primary: #1f8f63;
  --accent-blue: #34495e;
  --accent-green: #1f8f63;
  --accent-coral: #f0b429;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: #e4e6eb;
}

.theme-executive,
html:has(.theme-executive) {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #f7f8fa;
}

.theme-executive .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  max-width: none;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  background: #f7f8fa;
  box-shadow: none;
}

.theme-executive .sidebar {
  margin: 0 !important;
  border: 0;
  border-radius: 0;
  padding: 26px 18px;
  min-height: 100vh;
  color: #d8dce1;
  background: linear-gradient(180deg, #242628, #1b1d1f);
  box-shadow: none;
}

.theme-executive .sidebar-brand {
  margin-bottom: 36px;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
}

.theme-executive .sidebar-user {
  border: 0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 28px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.theme-executive .sidebar-user span {
  color: #9da5ae;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.theme-executive .side-nav {
  gap: 8px;
}

.theme-executive .side-nav a {
  min-height: 38px;
  border-radius: 4px;
  color: #b8bec6;
  font-size: 0.88rem;
  font-weight: 700;
}

.theme-executive .side-nav a:hover,
.theme-executive .side-nav a:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
}

.theme-executive .main-area {
  min-width: 0;
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f7f8fa;
}

.theme-executive .topbar {
  min-height: 84px;
  border: 0;
  border-bottom: 1px solid #ebeef2;
  border-radius: 0;
  padding: 20px 28px;
  margin: 0;
  background: #ffffff;
  box-shadow: none;
}

.theme-executive .topbar strong {
  font-size: 1.22rem;
  font-weight: 800;
}

.theme-executive .eyebrow {
  color: #858c96;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: none;
}

.theme-executive .page {
  padding: 26px 28px 32px;
}

.theme-executive .panel {
  border: 1px solid #edf0f3;
  border-radius: 6px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(36, 43, 53, 0.05);
}

.theme-executive .stacked-panel {
  margin-top: 16px;
}

.theme-executive h1 {
  margin: 0 0 8px;
  color: #202536;
  font-size: 1.35rem;
  font-weight: 800;
}

.theme-executive h2 {
  color: #202536;
  font-size: 1rem;
  font-weight: 800;
}

.theme-executive p {
  color: #777f8c;
}

.theme-executive .section-header {
  align-items: center;
  margin-bottom: 20px;
}

.theme-executive .metric-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.theme-executive .metric-card {
  min-height: 118px;
  border: 1px solid #eef1f4;
  border-radius: 6px;
  padding: 18px;
  color: #202536;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(32, 38, 50, 0.04);
}

.theme-executive .metric-card span {
  color: #6d7482;
  font-size: 0.78rem;
  font-weight: 700;
}

.theme-executive .metric-card strong {
  margin-top: 12px;
  color: #171b2a;
  font-size: 1.95rem;
  font-weight: 800;
}

.theme-executive .metric-card:nth-child(1),
.theme-executive .metric-card:nth-child(2),
.theme-executive .metric-card:nth-child(3),
.theme-executive .metric-card:nth-child(4),
.theme-executive .metric-card:nth-child(5) {
  background: #ffffff;
}

.theme-executive .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.theme-executive label {
  color: #5d6571;
  font-size: 0.84rem;
  font-weight: 700;
}

.theme-executive input,
.theme-executive select,
.theme-executive textarea {
  min-height: 42px;
  border: 1px solid #e4e8ed;
  border-radius: 4px;
  background: #fbfcfd;
}

.theme-executive input:focus,
.theme-executive select:focus,
.theme-executive textarea:focus {
  border-color: #1f8f63;
  box-shadow: 0 0 0 3px rgba(31, 143, 99, 0.14);
}

.theme-executive button,
.theme-executive .button {
  border-radius: 4px;
  background: #1f8f63;
  box-shadow: none;
}

.theme-executive .secondary-button,
.theme-executive .button-link.secondary {
  color: #323947;
  background: #f0f2f5;
}

.theme-executive .table-wrap {
  border: 1px solid #edf0f3;
  border-radius: 6px;
  overflow: hidden;
}

.theme-executive th {
  color: #747c88;
  font-size: 0.74rem;
  font-weight: 800;
  background: #fafbfc;
}

.theme-executive td {
  border-bottom: 1px solid #edf0f3;
  color: #303746;
  font-size: 0.86rem;
}

.theme-executive tr:last-child td {
  border-bottom: 0;
}

.theme-executive .download-item,
.theme-executive .theme-card,
.theme-executive .qr-preview img,
.theme-executive .message {
  border-radius: 6px;
}

@media (max-width: 900px) {
  .theme-executive .app-shell {
    display: block;
    margin: 0;
    min-height: 100vh;
  }

  .theme-executive .sidebar {
    border-bottom: 1px solid #303236;
  }

  .theme-executive .page {
    padding: 16px;
  }

  .theme-executive .filters,
  .theme-executive .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .sidebar {
    border: 0;
    border-radius: 0;
    padding: 18px 14px;
  }

  .sidebar-brand {
    margin-bottom: 14px;
    font-size: 1.08rem;
  }

  .sidebar-user {
    margin-bottom: 14px;
    padding: 12px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
  }

  .main-area {
    border: 0;
    border-radius: 0;
  }

  .topbar {
    display: grid;
    gap: 12px;
    align-items: start;
    min-height: auto;
    padding: 16px 14px;
  }

  .topbar form,
  .topbar button {
    width: 100%;
  }

  .page {
    width: 100%;
    margin: 0;
    padding: 14px;
  }

  .panel {
    border-radius: 8px;
    padding: 16px;
  }

  .section-header {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.12rem;
  }

  .form,
  .inline-form {
    max-width: none;
    width: 100%;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-actions,
  .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  button,
  .button-link,
  .secondary-button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }

  .metric-card {
    min-height: 104px;
    padding: 18px;
  }

  .metric-card strong {
    font-size: 1.75rem;
  }

  .scan-layout,
  .details-grid,
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .security-access-panel {
    min-height: calc(100vh - 160px);
  }

  .security-mode-picker {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .security-mode-button {
    min-height: 180px;
  }

  .security-mode-button strong {
    font-size: 2.8rem;
  }

  .table-wrap {
    margin: 0 -8px;
    border-radius: 8px;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 0.88rem;
  }

  .qr-preview img {
    width: min(230px, 100%);
  }

  .download-item,
  .theme-card {
    padding: 14px;
  }

  .theme-financial .app-shell,
  .theme-executive .app-shell {
    display: block;
    padding: 0 !important;
  }

  .theme-financial .main-area,
  .theme-executive .main-area {
    min-height: auto;
    border-radius: 0;
  }

  .theme-financial .sidebar,
  .theme-executive .sidebar {
    min-height: auto;
    border-radius: 0;
    padding: 18px 14px;
  }

  .theme-financial .topbar,
  .theme-executive .topbar {
    min-height: auto;
    border-radius: 0;
    padding: 16px 14px;
  }

  .theme-financial .page,
  .theme-executive .page {
    padding: 14px;
  }

  .theme-financial .panel,
  .theme-executive .panel {
    padding: 16px;
    border-radius: 8px;
  }

  .theme-financial h1,
  .theme-executive h1 {
    font-size: 1.45rem;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    padding: 16px;
  }

  .page {
    width: calc(100% - 28px);
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .theme-financial .metric-grid,
  .theme-executive .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scan-layout {
    grid-template-columns: 1fr;
  }

  .theme-executive .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

.role-security .sidebar,
.role-seguridad .sidebar,
.role-security .topbar,
.role-seguridad .topbar {
  display: none;
}

.role-security .app-shell,
.role-seguridad .app-shell {
  display: block;
  padding: 0;
}

.role-security .main-area,
.role-seguridad .main-area {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: #f6f7fa;
}

.role-security .page,
.role-seguridad .page {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.security-app {
  color: #071426;
}

.security-dashboard {
  color: #17202c;
  padding-bottom: 28px;
  font-family: "Inter", Arial, sans-serif;
}

.role-security .security-dashboard h1,
.role-security .security-dashboard h2,
.role-security .security-dashboard strong,
.role-seguridad .security-dashboard h1,
.role-seguridad .security-dashboard h2,
.role-seguridad .security-dashboard strong {
  font-family: "Inter", Arial, sans-serif;
  letter-spacing: 0;
}

.security-dashboard-header,
.security-section-heading,
.security-shift-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.security-dashboard-kicker {
  margin: 0 0 4px;
  color: #667085;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.security-dashboard-header h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.security-live-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  color: #067647;
  font-size: 0.75rem;
  font-weight: 700;
}

.security-live-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 4px #d1fadf;
}

.security-shift-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  color: #ffffff;
  background: #102a43;
  box-shadow: 0 8px 22px rgba(16, 42, 67, 0.16);
}

.security-shift-card span,
.security-shift-card time {
  display: block;
  color: #d9e2ec;
  font-size: 0.78rem;
}

.security-shift-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.security-shift-card time {
  max-width: 145px;
  text-align: right;
  text-transform: capitalize;
}

.security-dashboard-section {
  margin-top: 24px;
}

.security-dashboard-section h2 {
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.security-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.security-quick-action {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  gap: 11px;
  padding: 14px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  color: #17202c;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
  text-decoration: none;
}

.security-quick-action.primary {
  min-height: 104px;
  color: #ffffff;
  border-color: #0b6e69;
  background: #0b6e69;
}

.security-quick-action.primary.pin {
  border-color: #102a43;
  background: #102a43;
}

.security-action-glyph {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 800;
  transition: all 0.2s ease;
}

.security-action-glyph svg {
  width: 24px;
  height: 24px;
}

.security-quick-action:hover .security-action-glyph {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
}

.security-quick-action.primary .security-action-glyph {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.security-quick-action strong,
.security-quick-action small {
  display: block;
}

.security-quick-action strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.security-quick-action small {
  margin-top: 4px;
  color: #667085;
  font-size: 0.72rem;
}

.security-quick-action.primary small {
  color: #d9f2ef;
}

.security-action-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  color: #ffffff;
  background: #d92d20;
  font-size: 0.7rem;
}

.security-daily-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.security-daily-summary article {
  min-width: 0;
  padding: 14px 9px;
  border-right: 1px solid #e4e7ec;
  text-align: center;
}

.security-daily-summary article:last-child {
  border-right: 0;
}

.security-daily-summary strong,
.security-daily-summary span {
  display: block;
}

.security-daily-summary strong {
  color: #102a43;
  font-size: 1.35rem;
}

.security-daily-summary span {
  margin-top: 5px;
  color: #667085;
  font-size: 0.65rem;
  line-height: 1.25;
}

.security-section-heading h2 {
  margin: 0;
}

.security-section-heading a {
  color: #0b6e69;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.security-recent-events,
.security-empty-state {
  margin-top: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #ffffff;
}

.security-recent-events article {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid #eef0f3;
}

.security-recent-events article:last-child {
  border-bottom: 0;
}

.security-event-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0b6e69;
}

.security-event-mark.exit {
  background: #f79009;
}

.security-recent-events strong,
.security-recent-events small {
  display: block;
}

.security-recent-events strong {
  font-size: 0.82rem;
}

.security-recent-events small,
.security-recent-events time {
  margin-top: 3px;
  color: #667085;
  font-size: 0.72rem;
}

.security-empty-state {
  display: grid;
  gap: 4px;
  padding: 22px;
  color: #667085;
  text-align: center;
}

.security-empty-state strong {
  color: #344054;
  font-size: 0.88rem;
}

.security-empty-state span {
  font-size: 0.76rem;
}

.security-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.security-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.security-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.security-brand strong {
  font-size: 1.7rem;
  font-weight: 800;
}

.security-shield,
.security-profile {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #ffffff;
  background: #061b31;
  text-decoration: none;
  font-weight: 800;
}

.security-profile {
  width: auto;
  min-width: 42px;
  padding: 0 14px;
  color: #061b31;
  background: #e8ebef;
}

.security-status-card,
.visitor-hero-card {
  border-radius: 18px;
  padding: 28px;
  color: #ffffff;
  background: linear-gradient(135deg, #061b31, #173957);
  box-shadow: 0 22px 50px rgba(6, 27, 49, 0.16);
}

.security-status-card span,
.visitor-hero-card span {
  color: #aebccc;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.security-status-card strong {
  display: block;
  margin: 10px 0 54px;
  font-size: 1.65rem;
}

.security-status-card p,
.security-status-card b,
.visitor-hero-card p {
  margin: 0;
}

.security-home h1 {
  margin: 32px 0 18px;
  color: #343b46;
  font-size: 1rem;
  text-transform: uppercase;
}

.security-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.security-action-card {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 178px;
  border: 1px solid #cfd4dc;
  border-radius: 16px;
  color: #071426;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(20, 31, 45, 0.08);
}

.security-action-card strong {
  font-size: 1.05rem;
  text-transform: uppercase;
}

.security-action-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: #ffffff;
  background: #17314d;
  font-weight: 800;
}

.pin-icon {
  background: #e6e8eb;
  color: #071426;
}

.security-qr-view {
  min-height: calc(100vh - 44px);
  padding-bottom: 22px;
  font-family: "Inter", Arial, sans-serif;
}

.security-app.qr-active > .security-app-header { display: none; }

.role-security .security-qr-view,
.role-security .security-qr-view h1,
.role-security .security-qr-view strong,
.role-security .security-qr-view button,
.role-security .security-qr-view a,
.role-seguridad .security-qr-view,
.role-seguridad .security-qr-view h1,
.role-seguridad .security-qr-view strong,
.role-seguridad .security-qr-view button,
.role-seguridad .security-qr-view a {
  font-family: "Inter", Arial, sans-serif;
  letter-spacing: 0;
}

.role-security .security-qr-view .security-primary-action,
.role-seguridad .security-qr-view .security-primary-action {
  border: 1px solid #102a43;
  color: #ffffff;
  background: #102a43;
  box-shadow: none;
}

.role-security .security-qr-view .security-secondary-action,
.role-seguridad .security-qr-view .security-secondary-action {
  border: 1px solid #b8c0ca;
  color: #102a43;
  background: #ffffff;
  box-shadow: none;
}

.security-scanner-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.security-scanner-header span { color: #667085; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.security-scanner-header h1 { margin: 2px 0 0; font-family: "Inter", Arial, sans-serif; font-size: 1.4rem; letter-spacing: 0; }

.security-back-link {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #102a43;
  background: #ffffff;
  font-size: 1.35rem;
  text-decoration: none;
}

.security-camera-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 54vh;
  overflow: hidden;
  border-radius: 8px;
  background: #091725;
}

.security-camera-placeholder { color: #32465a; font-size: 3.6rem; font-weight: 800; }

.security-qr-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.security-scan-guide {
  position: absolute;
  z-index: 2;
  width: min(62vw, 230px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(3, 12, 22, 0.38);
  pointer-events: none;
}

.security-scan-guide::before,
.security-scan-guide::after,
.security-scan-guide i::before,
.security-scan-guide i::after {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: #4dd4c8;
  border-style: solid;
  content: "";
}

.security-scan-guide::before { top: -3px; left: -3px; border-width: 4px 0 0 4px; }
.security-scan-guide::after { top: -3px; right: -3px; border-width: 4px 4px 0 0; }
.security-scan-guide i::before { bottom: -3px; left: -3px; border-width: 0 0 4px 4px; }
.security-scan-guide i::after { right: -3px; bottom: -3px; border-width: 0 4px 4px 0; }

.security-scan-status {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 4px solid #0b6e69;
  border-radius: 4px;
  color: #344054;
  background: #ecfdf3;
  text-align: left;
}

.security-scan-status strong { color: #102a43; font-size: 0.84rem; }
.security-scan-status span { font-size: 0.74rem; line-height: 1.35; }
.security-scan-status[data-state="denied"],
.security-scan-status[data-state="error"] { border-color: #d92d20; background: #fef3f2; }
.security-scan-status[data-state="validating"] { border-color: #f79009; background: #fffaeb; }

.security-scanner-instruction { margin: 13px 0 0; color: #344054; font-size: 0.84rem; font-weight: 700; text-align: center; }
.security-scanner-help { margin: 4px 0 14px; color: #667085; font-size: 0.74rem; text-align: center; }

.security-file-fallback,
.security-pin-alternative {
  display: grid;
  place-items: center;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: none;
}

.security-pin-alternative { margin-top: 0; }

#qr-retry-btn:not([hidden]) { margin-top: 10px; }

.security-file-fallback[hidden] { display: none; }

.security-panel-link {
  display: block;
  min-height: 44px;
  padding: 13px;
  color: #475467;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.security-video {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  object-fit: cover;
  background: #071426;
}

.security-pin-view {
  width: min(100%, 430px);
  min-height: calc(100vh - 110px);
  margin: 0 auto;
  padding-bottom: 28px;
  color: #17202c;
  font-family: "Inter", Arial, sans-serif;
}

.security-pin-header {
  margin-bottom: 0;
}

.security-pin-view h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.security-pin-context {
  margin-top: 18px;
}

.security-pin-context a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 8px;
  color: #102a43;
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.security-pin-entry-section {
  padding: 0;
}

.security-pin-help {
  margin: 12px 0 0;
  color: #667085;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.security-pin-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
}

.security-pin-input-wrap {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  text-align: center;
}

.security-pin-input-wrap span {
  color: #667085;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.security-pin-input-wrap input {
  width: 100%;
  min-height: 76px;
  border: 2px solid #102a43;
  border-radius: 8px;
  color: #102a43;
  background: #f8fafc;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-align: center;
  caret-color: #061b31;
}

.security-pin-input-wrap input:focus {
  border-color: #0b6e69;
  outline: 4px solid rgba(11, 110, 105, 0.14);
}

.security-pin-message {
  min-height: 24px;
  color: #444b55;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.security-pin-message .error {
  color: #b42318;
}

.security-pin-message .loading {
  color: #175cd3;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.pin-dots span {
  width: 12px;
  height: 12px;
  border: 2px solid #c4c8ce;
  border-radius: 50%;
}

.pin-dots span.filled {
  border-color: #0b6e69;
  background: #0b6e69;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-keypad button {
  min-height: 58px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  color: #071426;
  font-size: 1.65rem;
  font-weight: 800;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06);
}

.pin-keypad button:active {
  color: #ffffff;
  border-color: #102a43;
  background: #102a43;
}

.pin-keypad .muted-key {
  opacity: 0.25;
}

.security-pin-actions .security-quick-action {
  min-height: 74px;
}

.security-primary-action,
.security-secondary-action {
  width: 100%;
  min-height: 62px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
}

.security-primary-action {
  background: #061b31;
}

.security-primary-action:disabled {
  background: #b3bac3;
}

.security-secondary-action {
  border: 2px solid #c4c8ce;
  color: #27303a;
  background: transparent;
}

.security-result {
  display: grid;
  gap: 18px;
}

.security-result-state {
  display: grid;
  place-items: center;
  gap: 10px;
  margin: 18px 0;
  text-align: center;
}

.security-result-state span {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  color: #05713f;
  background: #71ef9f;
  font-size: 4rem;
}

.security-result-state.denied span {
  color: #b42318;
  background: #ffe3e0;
}

.security-result-state strong {
  color: #05713f;
  font-size: 2.1rem;
  text-transform: uppercase;
}

.security-result-state.denied strong {
  color: #b42318;
}

.security-result-state p {
  margin: 0;
}

.visitor-hero-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.visitor-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  border: 3px solid #9db0c5;
  border-radius: 50%;
  color: #061b31;
  background: #dbe3ec;
  font-size: 2rem;
  font-weight: 800;
}

.visitor-hero-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.35rem;
}

.security-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.security-info-grid article {
  min-height: 128px;
  border-radius: 16px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(20, 31, 45, 0.06);
}

.security-info-grid span {
  color: #5f6875;
  font-weight: 800;
}

.security-info-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 1.05rem;
}

.security-actions {
  display: grid;
  gap: 14px;
}


@media (max-width: 520px) {
  .role-security .page,
  .role-seguridad .page {
    padding: 18px;
  }

  .security-brand strong {
    font-size: 1.45rem;
  }

  .security-action-grid,
  .security-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .security-action-card {
    min-height: 150px;
    padding: 14px;
  }

  .security-action-icon {
    width: 66px;
    height: 66px;
  }

  .pin-keypad {
    gap: 18px 24px;
  }

  .security-dashboard-header h1 {
    font-size: 1.35rem;
  }
}

@media (max-width: 370px) {
  .role-security .page,
  .role-seguridad .page {
    padding: 14px;
  }

  .security-dashboard-header {
    align-items: flex-start;
    gap: 10px;
  }

  .security-live-status {
    max-width: 82px;
    line-height: 1.2;
  }

  .security-quick-action {
    min-height: 72px;
    padding: 11px;
  }

  .security-quick-action.primary {
    min-height: 98px;
  }

  .security-action-glyph {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .security-quick-action small {
    display: none;
  }

  .security-daily-summary article {
    padding: 12px 5px;
  }
}


/* ============================================================
   THEME: Coral Warm — Modern healthcare/service aesthetic
   Inspired by: Clean mobile UIs, coral-orange gradients,
   soft shadows, rounded cards, Poppins typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

.theme-coral {
  /* ── Color Tokens ── */
  --bg: #f4f1ee;
  --bg-warm: #faf7f5;
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.82);
  --text: #2d3436;
  --text-soft: #4a5568;
  --muted: #8896a6;
  --line: #e8e2dc;
  --line-soft: #f0ebe6;

  --primary: #ff6b6b;
  --primary-light: #ff8e8e;
  --primary-dark: #e85555;
  --secondary: #ff8c42;
  --secondary-light: #ffa366;
  --accent-blue: #5b9bd5;
  --accent-green: #4ecdc4;
  --accent-coral: #ff6b6b;
  --accent-orange: #ff8c42;
  --accent-yellow: #ffd93d;
  --danger: #e74c3c;
  --success: #2ecc71;
  --warning: #f39c12;

  --gradient-primary: linear-gradient(135deg, #ff6b6b 0%, #ff8c42 100%);
  --gradient-primary-soft: linear-gradient(135deg, rgba(255,107,107,0.12) 0%, rgba(255,140,66,0.08) 100%);
  --gradient-warm: linear-gradient(135deg, #ff8c42 0%, #ffd93d 100%);
  --gradient-cool: linear-gradient(135deg, #5b9bd5 0%, #4ecdc4 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);

  --shadow-sm: 0 2px 8px rgba(45, 52, 54, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 52, 54, 0.08);
  --shadow-lg: 0 16px 48px rgba(45, 52, 54, 0.10);
  --shadow-xl: 0 24px 64px rgba(45, 52, 54, 0.12);
  --shadow-glow: 0 8px 32px rgba(255, 107, 107, 0.20);
  --shadow-glow-orange: 0 8px 32px rgba(255, 140, 66, 0.18);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  font-family: 'Poppins', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
}

/* ── Body ── */
.theme-coral body {
  background:
    radial-gradient(ellipse at top left, rgba(255, 107, 107, 0.10), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(255, 140, 66, 0.08), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

/* ── App Shell ── */
.theme-coral .app-shell {
  gap: 24px;
  padding: 24px;
}

/* ── Sidebar ── */
.theme-coral .sidebar {
  background: var(--gradient-glass), var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  box-shadow: var(--shadow-lg);
}

.theme-coral .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  text-decoration: none;
}

.theme-coral .sidebar-brand::before {
  content: '';
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
}

.theme-coral .sidebar-user {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 24px;
  background: var(--gradient-primary-soft);
  border: 1px solid rgba(255, 107, 107, 0.12);
}

.theme-coral .sidebar-user strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.theme-coral .sidebar-user span,
.theme-coral .eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-coral .side-nav {
  gap: 6px;
}

.theme-coral .side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.theme-coral .side-nav a:hover,
.theme-coral .side-nav a:focus {
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  box-shadow: inset 3px 0 0 var(--primary);
}

.theme-coral .side-nav a.active {
  background: var(--gradient-primary);
  color: #ffffff;
}

.theme-coral .nav-section {
  color: var(--primary);
  opacity: 0.6;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 8px;
}
  box-shadow: var(--shadow-glow);
}

/* ── Main Area ── */
.theme-coral .main-area {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: var(--panel-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}

/* ── Topbar ── */
.theme-coral .topbar {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  min-height: 68px;
  padding: 0 28px;
}

.theme-coral .brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

/* ── Panels / Cards ── */
.theme-coral .panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease;
}

.theme-coral .panel:hover {
  box-shadow: var(--shadow-lg);
}

.theme-coral .section-header {
  margin-bottom: 24px;
}

.theme-coral .section-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.theme-coral .section-header p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

/* ── Forms ── */
.theme-coral .form {
  display: grid;
  gap: 18px;
  max-width: 440px;
}

.theme-coral label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.theme-coral input,
.theme-coral select,
.theme-coral textarea {
  min-height: 46px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--panel);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-coral input:focus,
.theme-coral select:focus,
.theme-coral textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.theme-coral input::placeholder {
  color: var(--muted);
}

/* ── Buttons ── */
.theme-coral button,
.theme-coral .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 20px;
  background: var(--gradient-primary);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s, box-shadow 0.2s;
}

.theme-coral button:hover,
.theme-coral .button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(255, 107, 107, 0.28);
}

.theme-coral button:active,
.theme-coral .button-link:active {
  transform: translateY(0);
}

.theme-coral .button-link.secondary {
  background: var(--panel);
  color: var(--text-soft);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.theme-coral .button-link.secondary:hover {
  background: var(--bg-warm);
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.theme-coral button.danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 8px 24px rgba(231, 76, 60, 0.20);
}

.theme-coral button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.theme-coral .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ── Tables ── */
.theme-coral .table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

.theme-coral table {
  width: 100%;
  border-collapse: collapse;
}

.theme-coral th,
.theme-coral td {
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
  text-align: left;
}

.theme-coral th {
  background: var(--bg-warm);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-coral tr:hover td {
  background: rgba(255, 107, 107, 0.03);
}

.theme-coral .row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Filters ── */
.theme-coral .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.theme-coral .filter-actions {
  align-items: end;
  margin-top: 0;
}

/* ── Details ── */
.theme-coral .details {
  display: grid;
  gap: 16px;
  margin: 20px 0 0;
}

.theme-coral .details div {
  display: grid;
  gap: 4px;
}

.theme-coral .details dt {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-coral .details dd {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}

/* ── Payment Badges ── */
.theme-coral .payment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.theme-coral .payment-badge.status-pending {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25);
}

.theme-coral .payment-badge.status-approved {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.25);
}

.theme-coral .payment-badge.status-rejected {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

/* ── Payment Grid ── */
.theme-coral .payment-grid-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

.theme-coral .payment-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.theme-coral .payment-grid th,
.theme-coral .payment-grid td {
  border: 1px solid var(--line-soft);
  padding: 12px 10px;
  text-align: center;
  font-size: 0.88rem;
}

.theme-coral .payment-grid th {
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.theme-coral .payment-grid-name {
  text-align: left !important;
  font-weight: 700;
  white-space: nowrap;
  min-width: 180px;
  background: var(--panel);
  position: sticky;
  left: 0;
  z-index: 1;
}

.theme-coral .payment-grid-cell {
  width: 52px;
  min-width: 52px;
  font-size: 1.15rem;
  border-radius: 0;
  transition: background 0.15s;
}

.theme-coral .payment-grid-cell.status-approved {
  background: rgba(46, 204, 113, 0.12);
  color: #27ae60;
}

.theme-coral .payment-grid-cell.status-pending {
  background: rgba(243, 156, 18, 0.10);
  color: #e67e22;
}

.theme-coral .payment-grid-cell.status-rejected {
  background: rgba(231, 76, 60, 0.10);
  color: #e74c3c;
}

.theme-coral .payment-grid-cell.status-none {
  background: var(--bg-warm);
  color: var(--line);
}

.theme-coral .payment-grid-cell.status-overdue {
  background: rgba(231, 76, 60, 0.10);
  color: #e74c3c;
}

.theme-coral .payment-grid-empty {
  color: var(--line);
}

.theme-coral .payment-grid-cell a {
  text-decoration: none;
  color: inherit;
}

/* ── Metric Cards ── */
.theme-coral .metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.theme-coral .metric-card {
  background: var(--gradient-primary);
  border: 0;
  border-radius: var(--radius-lg);
  color: #ffffff;
  min-height: 140px;
  padding: 24px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s, box-shadow 0.25s;
}

.theme-coral .metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(255, 107, 107, 0.28);
}

.theme-coral .metric-card:nth-child(2) {
  background: linear-gradient(135deg, var(--accent-blue), #4a8ac7);
  box-shadow: 0 8px 32px rgba(91, 155, 213, 0.20);
}

.theme-coral .metric-card:nth-child(3) {
  background: linear-gradient(135deg, var(--accent-green), #3dbdb5);
  box-shadow: 0 8px 32px rgba(78, 205, 196, 0.20);
}

.theme-coral .metric-card:nth-child(4) {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  box-shadow: 0 8px 32px rgba(155, 89, 182, 0.20);
}

.theme-coral .metric-card:nth-child(5) {
  background: var(--gradient-warm);
  box-shadow: var(--shadow-glow-orange);
}

.theme-coral .metric-card span {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 500;
}

.theme-coral .metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── Calendar ── */
.theme-coral .reservation-calendar {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.theme-coral .calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--gradient-primary-soft);
}

.theme-coral .calendar-weekdays span {
  padding: 12px 10px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}

.theme-coral .calendar-day {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 100px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 10px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}

.theme-coral .calendar-day:hover,
.theme-coral .calendar-day:focus {
  background: var(--gradient-primary-soft);
  color: var(--text);
}

.theme-coral .calendar-day.has-event {
  background: rgba(255, 107, 107, 0.04);
}

.theme-coral .muted-day {
  background: var(--bg-warm);
  color: var(--muted);
}

.theme-coral .calendar-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.theme-coral .calendar-chip.status-pending {
  background: linear-gradient(135deg, #f39c12, #e67e22);
}

.theme-coral .calendar-chip.status-approved {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

/* ── Calendar Events ── */
.theme-coral .calendar-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 24px;
}

.theme-coral .calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-left: 5px solid var(--muted);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.15s;
}

.theme-coral .calendar-event:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}

.theme-coral .calendar-event div {
  display: grid;
  gap: 3px;
}

.theme-coral .calendar-event span,
.theme-coral .calendar-event small {
  color: var(--muted);
  font-size: 0.88rem;
}

.theme-coral .calendar-event.status-pending {
  border-left-color: #f39c12;
}

.theme-coral .calendar-event.status-approved {
  border-left-color: #2ecc71;
}

.theme-coral .calendar-event.status-rejected,
.theme-coral .calendar-event.status-cancelled {
  border-left-color: #e74c3c;
  opacity: 0.75;
}

/* ── Slide Panel ── */
.theme-coral .slide-panel-overlay {
  background: rgba(45, 52, 54, 0.40);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.theme-coral .slide-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line-soft);
  box-shadow: -12px 0 48px rgba(45, 52, 54, 0.15);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.theme-coral .slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--gradient-primary-soft);
}

.theme-coral .slide-panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.theme-coral .slide-panel-close {
  background: var(--panel);
  color: var(--primary);
  min-height: auto;
  padding: 6px 10px;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.theme-coral .slide-panel-close:hover {
  background: var(--primary);
  color: #ffffff;
}

.theme-coral .slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.theme-coral .slide-panel-body .form {
  max-width: 100%;
}

.theme-coral .slide-panel-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 12px;
}

/* ── Toast ── */
.theme-coral .toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.theme-coral .toast {
  pointer-events: auto;
  min-width: 280px;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-coral .toast.visible {
  transform: translateX(0);
}

.theme-coral .toast.success {
  border-left: 4px solid var(--success);
  color: #27ae60;
}

.theme-coral .toast.error {
  border-left: 4px solid var(--danger);
  color: #e74c3c;
}

/* ── Messages ── */
.theme-coral .messages {
  margin-bottom: 18px;
}

.theme-coral .message {
  margin: 0 0 10px;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
}

.theme-coral .message.error {
  color: var(--danger);
  background: rgba(231, 76, 60, 0.06);
  border-color: rgba(231, 76, 60, 0.15);
}

.theme-coral .message.success {
  color: var(--success);
  background: rgba(46, 204, 113, 0.06);
  border-color: rgba(46, 204, 113, 0.15);
}

/* ── Security / QR ── */
.theme-coral .security-mode-button {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 230px;
  border-radius: var(--radius-xl);
  padding: 32px;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s, box-shadow 0.25s;
}

.theme-coral .security-mode-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 56px rgba(255, 107, 107, 0.30);
}

.theme-coral .security-mode-button.pin-mode {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  box-shadow: 0 8px 32px rgba(78, 205, 196, 0.20);
}

.theme-coral .security-mode-button strong {
  color: #ffffff;
  font-size: 3.4rem;
  line-height: 1;
  font-weight: 800;
}

.theme-coral .security-mode-button span {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  font-weight: 700;
}

.theme-coral .scanner-video {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

.theme-coral .security-result-state span {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  font-size: 4.2rem;
}

.theme-coral .security-result-state strong {
  font-size: 2.2rem;
  font-weight: 800;
}

.theme-coral .security-info-grid article {
  min-height: 136px;
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line-soft);
  transition: box-shadow 0.2s, transform 0.15s;
}

.theme-coral .security-info-grid article:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ── Visitor Card ── */
.theme-coral .visitor-hero-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.theme-coral .visitor-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  border: 3px solid var(--primary-light);
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--gradient-primary-soft);
  font-size: 2.1rem;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.theme-coral .visitor-hero-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── Login ── */
.theme-coral .login-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.theme-coral .download-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.theme-coral .download-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.theme-coral .download-item:hover {
  box-shadow: var(--shadow-md);
}

.theme-coral .download-item h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ── QR Panel ── */
.theme-coral .qr-preview img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-md);
}

/* ── Theme Grid ── */
.theme-coral .theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.theme-coral .theme-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.15s;
}

.theme-coral .theme-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.theme-coral .theme-card h2 {
  margin: 14px 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.theme-coral .theme-card p {
  color: var(--muted);
  font-size: 0.88rem;
}

.theme-coral .theme-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 116px;
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--gradient-primary-soft);
}

.theme-coral .theme-preview span {
  border-radius: var(--radius-md);
}

.theme-coral .theme-badge {
  display: inline-flex;
  border-radius: var(--radius-full);
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* ── Checkbox ── */
.theme-coral .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.theme-coral .checkbox-label input {
  min-height: auto;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ── Help Text ── */
.theme-coral .help-text {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.theme-coral .muted-note {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Segmented Control ── */
.theme-coral .segmented-control {
  display: inline-flex;
  gap: 6px;
  background: var(--bg-warm);
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid var(--line-soft);
}

.theme-coral .segmented-control .active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
}

/* ── Compact Actions ── */
.theme-coral .compact-actions {
  margin-top: 0;
}

/* ── Stacked Panel ── */
.theme-coral .stacked-panel {
  margin-top: 20px;
}

/* ── Inline Form ── */
.theme-coral .inline-form {
  max-width: 540px;
}

/* ── Reservation Form ── */
.theme-coral .reservation-form {
  margin-top: 20px;
}

.theme-coral .reservation-workspace {
  margin: 20px 0 24px;
}

/* ── Login Download ── */
.theme-coral .login-download {
  margin-top: 20px;
}

.theme-coral .oauth-actions {
  margin-top: 20px;
}

/* ── Public Topbar ── */
.theme-coral .public-topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}

/* ── Responsive ── */
@media (max-width: 820px) {
  .theme-coral .app-shell {
    display: block;
    padding: 0;
  }

  .theme-coral .sidebar,
  .theme-coral .main-area {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .theme-coral .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-coral .page {
    width: min(100% - 28px, 1180px);
  }

  .theme-coral .filters,
  .theme-coral .metric-grid,
  .theme-coral .scan-layout,
  .theme-coral .details-grid {
    grid-template-columns: 1fr;
  }

  .theme-coral .section-header {
    display: grid;
  }
}


/* ============================================================
   PANIC BUTTON — Mobile-first, responsive
   ============================================================ */

.panic-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 8000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: 0;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
  display: grid;
  place-items: center;
  transition: transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.panic-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.5);
}

.panic-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(231, 76, 60, 0.97);
  z-index: 10000;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.panic-overlay.active {
  display: grid;
}

.panic-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 360px;
  width: 100%;
}

.panic-overlay-icon {
  font-size: 3rem;
  line-height: 1;
  animation: panic-pulse 1s ease-in-out infinite;
}

@keyframes panic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.panic-overlay-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.02em;
}

.panic-overlay-info {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  margin: 0;
}

.panic-dismiss-btn {
  min-height: 52px;
  padding: 0 28px;
  font-size: 1rem;
  font-weight: 700;
  background: #fff;
  color: #e74c3c;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.panic-dismiss-btn:active {
  transform: scale(0.96);
}

@media (max-width: 480px) {
  .panic-fab {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }

  .panic-overlay {
    padding: 20px;
  }

  .panic-overlay-title {
    font-size: 1.3rem;
  }

  .panic-overlay-icon {
    font-size: 2.5rem;
  }

  .panic-dismiss-btn {
    width: 100%;
    min-height: 50px;
  }
}


/* ============================================================
   THEME: Nordic — Clean, light, minimal with emerald accents
   Inspired by: Notion, Linear, Scandinavian design
   Features: Clean typography, subtle shadows, emerald palette,
   pill buttons, smooth transitions, modern controls
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

.theme-nordic {
  /* ── Color Tokens ── */
  --bg: #f6f8f7;
  --bg-warm: #fafcfb;
  --panel: #ffffff;
  --text: #1a2e28;
  --text-soft: #3d5a50;
  --muted: #7a9589;
  --line: #dce5e0;
  --line-soft: #e8efe9;

  --primary: #10b981;
  --primary-light: #34d399;
  --primary-dark: #059669;
  --secondary: #0ea5e9;
  --secondary-light: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-emerald: #059669;
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --gradient-primary: linear-gradient(135deg, #10b981, #14b8a6);
  --gradient-primary-soft: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(20,184,166,0.05));
  --gradient-cool: linear-gradient(135deg, #3b82f6, #0ea5e9);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 24px rgba(0,0,0,0.07), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.08);

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  font-family: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Body ── */
.theme-nordic body {
  background: var(--bg);
  min-height: 100vh;
}

/* ── App Shell ── */
.theme-nordic .app-shell {
  gap: 20px;
  padding: 20px;
}

/* ── Sidebar ── */
.theme-nordic .sidebar {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  padding: 24px 16px;
  box-shadow: var(--shadow-sm);
}

.theme-nordic .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-dark);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-decoration: none;
}

.theme-nordic .sidebar-brand::before {
  content: '';
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  flex-shrink: 0;
}

.theme-nordic .sidebar-user {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 20px;
  background: var(--gradient-primary-soft);
  border: 1px solid rgba(16,185,129,0.1);
}

.theme-nordic .sidebar-user strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.theme-nordic .sidebar-user span,
.theme-nordic .eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-nordic .side-nav {
  gap: 4px;
}

.theme-nordic .side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0 12px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.theme-nordic .side-nav a:hover,
.theme-nordic .side-nav a:focus {
  background: rgba(16,185,129,0.06);
  color: var(--primary-dark);
}

.theme-nordic .side-nav a.active {
  background: var(--gradient-primary);
  color: #ffffff;
  font-weight: 600;
}

.theme-nordic .nav-section {
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  margin-top: 8px;
  padding-top: 12px;
}

/* ── Main Area ── */
.theme-nordic .main-area {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Topbar ── */
.theme-nordic .topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
  min-height: 60px;
  padding: 0 24px;
}

.theme-nordic .topbar > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.theme-nordic .eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  opacity: 0.8;
}

.theme-nordic .topbar strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.theme-nordic .brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.theme-nordic .topbar form button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: auto;
  box-shadow: none;
  transition: all 0.15s ease;
}

.theme-nordic .topbar form button:hover {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: var(--danger);
  transform: none;
}

/* ── Page ── */
.theme-nordic .page {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Panels ── */
.theme-nordic .panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}

.theme-nordic .panel:hover {
  box-shadow: var(--shadow-sm);
}

.theme-nordic .stacked-panel { margin-top: 18px; }

/* ── Section Headers ── */
.theme-nordic .section-header { margin-bottom: 22px; }

.theme-nordic .section-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.theme-nordic .section-header p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 4px 0 0;
}

/* ── Forms ── */
.theme-nordic .form {
  display: grid;
  gap: 18px;
  max-width: 420px;
}

.theme-nordic label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.theme-nordic input,
.theme-nordic select,
.theme-nordic textarea {
  min-height: 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-nordic input:focus,
.theme-nordic select:focus,
.theme-nordic textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

.theme-nordic input::placeholder { color: var(--muted); opacity: 0.7; }

/* ── Buttons ── */
.theme-nordic button,
.theme-nordic .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-full);
  padding: 0 20px;
  background: var(--gradient-primary);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(16,185,129,0.2);
  transition: all 0.15s ease;
}

.theme-nordic button:hover,
.theme-nordic .button-link:hover {
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
  transform: translateY(-1px);
}

.theme-nordic button:active,
.theme-nordic .button-link:active {
  transform: translateY(0);
}

.theme-nordic .button-link.secondary {
  background: var(--panel);
  color: var(--text-soft);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.theme-nordic .button-link.secondary:hover {
  background: var(--bg-warm);
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: none;
}

.theme-nordic button.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 8px rgba(239,68,68,0.2);
}

.theme-nordic button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.theme-nordic .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ── Tables ── */
.theme-nordic .table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

.theme-nordic table { width: 100%; border-collapse: collapse; }

.theme-nordic th,
.theme-nordic td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px;
  text-align: left;
}

.theme-nordic th {
  background: var(--bg-warm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-nordic tr:hover td { background: rgba(16,185,129,0.02); }

.theme-nordic .row-actions { display: flex; align-items: center; gap: 10px; }

/* ── Filters ── */
.theme-nordic .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.theme-nordic .filter-actions { align-items: end; margin-top: 0; }

/* ── Details ── */
.theme-nordic .details { display: grid; gap: 14px; margin: 18px 0 0; }
.theme-nordic .details div { display: grid; gap: 3px; }
.theme-nordic .details dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.theme-nordic .details dd { margin: 0; font-weight: 500; color: var(--text); }

/* ── Payment Badges ── */
.theme-nordic .payment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
}

.theme-nordic .payment-badge.status-pending { background: #f59e0b; }
.theme-nordic .payment-badge.status-approved { background: #10b981; }
.theme-nordic .payment-badge.status-rejected { background: #ef4444; }

/* ── Payment Grid ── */
.theme-nordic .payment-grid-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

.theme-nordic .payment-grid { width: 100%; border-collapse: collapse; min-width: 720px; }

.theme-nordic .payment-grid th,
.theme-nordic .payment-grid td {
  border: 1px solid var(--line-soft);
  padding: 10px 8px;
  text-align: center;
  font-size: 0.88rem;
}

.theme-nordic .payment-grid th {
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.theme-nordic .payment-grid-name {
  text-align: left !important;
  font-weight: 600;
  white-space: nowrap;
  min-width: 180px;
  background: var(--panel);
  position: sticky;
  left: 0;
  z-index: 1;
}

.theme-nordic .payment-grid-cell {
  width: 52px;
  min-width: 52px;
  font-size: 1.1rem;
  transition: background 0.1s;
}

.theme-nordic .payment-grid-cell.status-approved { background: rgba(16,185,129,0.08); color: #059669; }
.theme-nordic .payment-grid-cell.status-pending { background: rgba(245,158,11,0.08); color: #d97706; }
.theme-nordic .payment-grid-cell.status-rejected { background: rgba(239,68,68,0.08); color: #dc2626; }
.theme-nordic .payment-grid-cell.status-none { background: var(--bg-warm); color: var(--line); }
.theme-nordic .payment-grid-cell.status-overdue { background: rgba(239,68,68,0.08); color: #dc2626; }
.theme-nordic .payment-grid-empty { color: var(--line); }
.theme-nordic .payment-grid-cell a { text-decoration: none; color: inherit; }

/* ── Metric Cards ── */
.theme-nordic .metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.theme-nordic .metric-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  color: var(--text);
  min-height: 130px;
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.theme-nordic .metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.theme-nordic .metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.theme-nordic .metric-card:hover::before { opacity: 1; }

.theme-nordic .metric-card:nth-child(2)::before { background: var(--gradient-cool); }
.theme-nordic .metric-card:nth-child(3)::before { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.theme-nordic .metric-card:nth-child(4)::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.theme-nordic .metric-card:nth-child(5)::before { background: linear-gradient(135deg, #ef4444, #f87171); }

.theme-nordic .metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.theme-nordic .metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Calendar ── */
.theme-nordic .reservation-calendar {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}

.theme-nordic .calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-warm);
}

.theme-nordic .calendar-weekdays span {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}

.theme-nordic .calendar-day {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 96px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  transition: background 0.1s;
}

.theme-nordic .calendar-day:hover,
.theme-nordic .calendar-day:focus { background: rgba(16,185,129,0.04); }

.theme-nordic .calendar-day.has-event { background: rgba(16,185,129,0.03); }
.theme-nordic .muted-day { background: var(--bg-warm); color: var(--muted); }

.theme-nordic .calendar-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
}

.theme-nordic .calendar-chip.status-pending { background: #f59e0b; }
.theme-nordic .calendar-chip.status-approved { background: #10b981; }

/* Calendar Events */
.theme-nordic .calendar-list { display: grid; gap: 10px; margin: 18px 0 22px; }

.theme-nordic .calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--panel);
  transition: box-shadow 0.15s;
}

.theme-nordic .calendar-event:hover { box-shadow: var(--shadow-sm); }
.theme-nordic .calendar-event div { display: grid; gap: 3px; }
.theme-nordic .calendar-event span,
.theme-nordic .calendar-event small { color: var(--muted); font-size: 0.88rem; }
.theme-nordic .calendar-event.status-pending { border-left-color: #f59e0b; }
.theme-nordic .calendar-event.status-approved { border-left-color: #10b981; }
.theme-nordic .calendar-event.status-rejected,
.theme-nordic .calendar-event.status-cancelled { border-left-color: #ef4444; opacity: 0.75; }

/* ── Slide Panel ── */
.theme-nordic .slide-panel-overlay {
  background: rgba(26,46,40,0.3);
}

.theme-nordic .slide-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line-soft);
  box-shadow: -8px 0 32px rgba(0,0,0,0.08);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.theme-nordic .slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.theme-nordic .slide-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.theme-nordic .slide-panel-close {
  background: transparent;
  color: var(--muted);
  min-height: auto;
  padding: 6px 10px;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.theme-nordic .slide-panel-close:hover {
  background: rgba(239,68,68,0.06);
  color: var(--danger);
  transform: none;
}

.theme-nordic .slide-panel-body { flex: 1; overflow-y: auto; padding: 22px; }
.theme-nordic .slide-panel-body .form { max-width: 100%; }

.theme-nordic .slide-panel-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
}

/* ── Toast ── */
.theme-nordic .toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.theme-nordic .toast {
  pointer-events: auto;
  min-width: 260px;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-nordic .toast.visible { transform: translateX(0); }
.theme-nordic .toast.success { border-left: 4px solid var(--success); color: #059669; }
.theme-nordic .toast.error { border-left: 4px solid var(--danger); color: #dc2626; }

/* ── Messages ── */
.theme-nordic .messages { margin-bottom: 16px; }

.theme-nordic .message {
  margin: 0 0 8px;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  font-size: 0.9rem;
}

.theme-nordic .message.error { color: #dc2626; background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.12); }
.theme-nordic .message.success { color: #059669; background: rgba(16,185,129,0.04); border-color: rgba(16,185,129,0.12); }

/* ── Security / QR ── */
.theme-nordic .security-mode-button {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 220px;
  border-radius: var(--radius-xl);
  padding: 28px;
  background: var(--gradient-primary);
  box-shadow: 0 8px 24px rgba(16,185,129,0.2);
  transition: all 0.2s ease;
}

.theme-nordic .security-mode-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(16,185,129,0.28);
}

.theme-nordic .security-mode-button.pin-mode {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  box-shadow: 0 8px 24px rgba(14,165,233,0.2);
}

.theme-nordic .security-mode-button strong {
  color: #ffffff;
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 700;
}

.theme-nordic .security-mode-button span {
  color: rgba(255,255,255,0.92);
  font-size: 1rem;
  font-weight: 600;
}

.theme-nordic .scanner-video { border-radius: var(--radius-lg); border: 1px solid var(--line-soft); }

.theme-nordic .security-result-state span {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  font-size: 4rem;
}

.theme-nordic .security-result-state strong { font-size: 2.1rem; font-weight: 700; }

.theme-nordic .security-info-grid article {
  min-height: 130px;
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s;
}

.theme-nordic .security-info-grid article:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* ── Visitor Card ── */
.theme-nordic .visitor-hero-card { display: flex; align-items: center; gap: 18px; padding: 18px; }

.theme-nordic .visitor-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  border: 2px solid var(--primary-light);
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--gradient-primary-soft);
  font-size: 2rem;
  font-weight: 700;
}

.theme-nordic .visitor-hero-card strong {
  display: block;
  margin: 4px 0;
  font-size: 1.3rem;
  font-weight: 700;
}

/* ── Login / Downloads ── */
.theme-nordic .login-switch { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.theme-nordic .download-list { display: grid; gap: 16px; margin-top: 20px; }

.theme-nordic .download-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
  transition: box-shadow 0.15s;
}

.theme-nordic .download-item:hover { box-shadow: var(--shadow-sm); }
.theme-nordic .download-item h2 { margin: 0 0 8px; font-size: 1rem; font-weight: 700; }

.theme-nordic .qr-preview img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}

/* ── Theme Grid ── */
.theme-nordic .theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.theme-nordic .theme-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
  transition: all 0.15s;
}

.theme-nordic .theme-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.theme-nordic .theme-card h2 { margin: 12px 0 6px; font-size: 1rem; font-weight: 700; }
.theme-nordic .theme-card p { color: var(--muted); font-size: 0.85rem; }

.theme-nordic .theme-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 110px;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--gradient-primary-soft);
  border: 1px solid var(--line-soft);
}

.theme-nordic .theme-preview span { border-radius: var(--radius-md); }

.theme-nordic .nordic-preview {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(20,184,166,0.05));
}

.theme-nordic .theme-badge {
  display: inline-flex;
  border-radius: var(--radius-full);
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  padding: 5px 12px;
  font-size: 0.78rem;
}

/* ── Checkbox ── */
.theme-nordic .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.theme-nordic .checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.theme-nordic .checkbox-label input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.theme-nordic .checkbox-label input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
}

.theme-nordic .checkbox-label input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

.theme-nordic .help-text { margin: -4px 0 0; color: var(--muted); font-size: 0.82rem; }
.theme-nordic .muted-note { display: inline-flex; align-items: center; min-height: 42px; color: var(--muted); font-size: 0.88rem; }

/* ── Segmented Control ── */
.theme-nordic .segmented-control {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-warm);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--line-soft);
}

.theme-nordic .segmented-control .active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-radius: var(--radius-full);
}

/* ── Public Topbar ── */
.theme-nordic .public-topbar { background: var(--panel); border-bottom: 1px solid var(--line-soft); }

/* ── Misc ── */
.theme-nordic .compact-actions { margin-top: 0; }
.theme-nordic .inline-form { max-width: 520px; }
.theme-nordic .reservation-form { margin-top: 18px; }
.theme-nordic .reservation-workspace { margin: 18px 0 22px; }
.theme-nordic .login-download { margin-top: 18px; }
.theme-nordic .oauth-actions { margin-top: 18px; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .theme-nordic .app-shell {
    display: block;
    padding: 0;
  }

  .theme-nordic .sidebar,
  .theme-nordic .main-area {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .theme-nordic .page { width: min(100% - 28px, 1180px); }
  .theme-nordic .filters,
  .theme-nordic .metric-grid,
  .theme-nordic .scan-layout,
  .theme-nordic .details-grid { grid-template-columns: 1fr; }
  .theme-nordic .section-header { display: grid; }
}


/* ============================================================
   THEME: Graphite & Gold — Editorial luxury aesthetic
   Inspired by: premium publishing, fintech high-end, refined
   hospitality branding.
   Features: warm graphite neutrals on cream paper, refined gold
   accent, editorial serif headings (Fraunces) on Manrope body,
   hairline 1px rules, layered warm shadows, generous whitespace,
   uppercase tracked labels, tasteful gold rules.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700&display=swap');

.theme-gold {
  /* ── Neutrals (warm graphite on cream paper) ── */
  --bg: #f4f1ec;
  --bg-warm: #faf8f4;
  --panel: #ffffff;
  --paper: #fdfcf9;

  --text: #1c1b19;
  --text-soft: #3a3835;
  --muted: #8a8580;
  --muted-strong: #6b6660;

  --line: #e3ddd3;
  --line-soft: #ece7de;
  --line-hairline: #e8e2d8;

  /* ── Accent: refined gold ── */
  --primary: #c79a3a;
  --primary-light: #d9b25f;
  --primary-dark: #a87f23;
  --primary-soft: #f6ecd3;
  --primary-glow: rgba(199, 154, 58, 0.22);

  --secondary: #6b6660;
  --accent-blue: #4a5a6a;
  --accent-green: #5c7355;
  --accent-coral: #b8745a;
  --accent-plum: #6b4a5e;

  --danger: #a8453a;
  --danger-soft: #f3e3e0;
  --success: #4f7a4a;
  --success-soft: #e7efe4;
  --warning: #b8862a;

  /* ── Gradients ── */
  --gradient-primary: linear-gradient(135deg, #d9b25f 0%, #c79a3a 50%, #a87f23 100%);
  --gradient-primary-soft: linear-gradient(135deg, rgba(199,154,58,0.10) 0%, rgba(199,154,58,0.04) 100%);
  --gradient-paper: linear-gradient(180deg, #fdfcf9 0%, #faf8f4 100%);
  --gradient-gold-rule: linear-gradient(90deg, transparent, var(--primary) 18%, var(--primary) 82%, transparent);

  /* ── Shadows (warm, layered) ── */
  --shadow-xs: 0 1px 2px rgba(28, 27, 25, 0.04);
  --shadow-sm: 0 1px 3px rgba(28, 27, 25, 0.05), 0 1px 2px rgba(28, 27, 25, 0.03);
  --shadow-md: 0 4px 12px rgba(28, 27, 25, 0.06), 0 2px 4px rgba(28, 27, 25, 0.04);
  --shadow-lg: 0 12px 32px rgba(28, 27, 25, 0.08), 0 4px 10px rgba(28, 27, 25, 0.04);
  --shadow-xl: 0 24px 56px rgba(28, 27, 25, 0.10);
  --shadow-glow: 0 8px 24px rgba(199, 154, 58, 0.18);

  /* ── Radii (restrained, editorial) ── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  font-family: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Editorial headings: Fraunces serif ── */
.theme-gold h1,
.theme-gold h2,
.theme-gold .section-header h1,
.theme-gold .slide-panel-header h2 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
}

/* ── Body ── */
.theme-gold body {
  background:
    radial-gradient(ellipse at top left, rgba(199, 154, 58, 0.04), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* ── App Shell ── */
.theme-gold .app-shell {
  gap: 20px;
  padding: 20px;
}

/* ── Sidebar ── */
.theme-gold .sidebar {
  background: var(--gradient-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px 18px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 20px;
}

.theme-gold .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-decoration: none;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.theme-gold .sidebar-brand::before {
  content: '';
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.theme-gold .sidebar-user {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 22px;
  background: var(--gradient-primary-soft);
  border: 1px solid rgba(199, 154, 58, 0.14);
}

.theme-gold .sidebar-user strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.theme-gold .sidebar-user span,
.theme-gold .eyebrow {
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.theme-gold .side-nav {
  gap: 2px;
}

.theme-gold .side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0 12px;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}

.theme-gold .side-nav a:hover,
.theme-gold .side-nav a:focus {
  background: rgba(199, 154, 58, 0.07);
  color: var(--text);
}

.theme-gold .side-nav a:hover::before,
.theme-gold .side-nav a:focus::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 55%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.theme-gold .side-nav a.active {
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  border: 1px solid rgba(199, 154, 58, 0.18);
}

.theme-gold .nav-section {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding: 16px 12px 6px;
  opacity: 1;
}

/* ── Main Area ── */
.theme-gold .main-area {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 0;
  background: var(--gradient-paper);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ── Topbar ── */
.theme-gold .topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  min-height: 68px;
  padding: 0 28px;
  position: relative;
}

.theme-gold .topbar::after {
  content: '';
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: -1px;
  height: 2px;
  background: var(--gradient-gold-rule);
  opacity: 0.35;
}

.theme-gold .topbar > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.theme-gold .topbar strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.theme-gold .brand {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.theme-gold .topbar form button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  border-radius: var(--radius-full);
  padding: 7px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: auto;
  box-shadow: none;
  transition: all 0.15s ease;
}

.theme-gold .topbar form button:hover {
  background: var(--danger-soft);
  border-color: rgba(168, 69, 58, 0.3);
  color: var(--danger);
  transform: none;
  box-shadow: none;
}

/* ── Page ── */
.theme-gold .page {
  padding: 28px;
}

/* ── Panels ── */
.theme-gold .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.25s ease;
}

.theme-gold .panel:hover {
  box-shadow: var(--shadow-sm);
}

.theme-gold .stacked-panel { margin-top: 20px; }

/* ── Section Headers ── */
.theme-gold .section-header { margin-bottom: 24px; }

.theme-gold .section-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.theme-gold .section-header h1::after {
  content: '';
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 10px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.theme-gold .section-header p {
  color: var(--muted-strong);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

/* ── Headings hierarchy ── */
.theme-gold h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
}

.theme-gold h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.theme-gold p { color: var(--muted-strong); }

/* ── Forms ── */
.theme-gold .form {
  display: grid;
  gap: 20px;
  max-width: 440px;
}

.theme-gold label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-gold input,
.theme-gold select,
.theme-gold textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font: inherit;
  font-family: 'Manrope', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-warm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.theme-gold input:focus,
.theme-gold select:focus,
.theme-gold textarea:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(199, 154, 58, 0.12);
}

.theme-gold input::placeholder { color: var(--muted); opacity: 0.7; }

/* ── Buttons ── */
.theme-gold button,
.theme-gold .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--primary-dark);
  border-radius: var(--radius-full);
  padding: 0 22px;
  background: var(--gradient-primary);
  color: #1c1b19;
  cursor: pointer;
  font: inherit;
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-glow);
  transition: all 0.18s ease;
}

.theme-gold button:hover,
.theme-gold .button-link:hover {
  box-shadow: 0 12px 28px rgba(199, 154, 58, 0.28);
  transform: translateY(-1px);
}

.theme-gold button:active,
.theme-gold .button-link:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.theme-gold .button-link.secondary,
.theme-gold .secondary-button {
  background: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--line);
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-gold .button-link.secondary:hover,
.theme-gold .secondary-button:hover {
  background: var(--bg-warm);
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: none;
}

.theme-gold button.danger {
  background: linear-gradient(135deg, #c2554a, #a8453a);
  border-color: #8f3a31;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(168, 69, 58, 0.22);
}

.theme-gold button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.theme-gold .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* ── Tables ── */
.theme-gold .table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}

.theme-gold table { width: 100%; border-collapse: collapse; }

.theme-gold th,
.theme-gold td {
  border-bottom: 1px solid var(--line-hairline);
  padding: 13px 16px;
  text-align: left;
}

.theme-gold th {
  background: var(--bg-warm);
  color: var(--muted-strong);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-gold td {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.theme-gold tr:last-child td { border-bottom: 0; }
.theme-gold tr:hover td { background: rgba(199, 154, 58, 0.025); }

.theme-gold .row-actions { display: flex; align-items: center; gap: 10px; }

/* ── Filters ── */
.theme-gold .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.theme-gold .filter-actions { align-items: end; margin-top: 0; }

/* ── Details ── */
.theme-gold .details { display: grid; gap: 16px; margin: 20px 0 0; }
.theme-gold .details div { display: grid; gap: 4px; }
.theme-gold .details-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }

.theme-gold .details dt {
  color: var(--muted-strong);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-gold .details dd { margin: 0; font-weight: 500; color: var(--text); font-size: 0.95rem; }

/* ── Payment Badges ── */
.theme-gold .payment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  border: 1px solid transparent;
}

.theme-gold .payment-badge.status-pending {
  background: var(--warning);
  border-color: #9a7022;
}
.theme-gold .payment-badge.status-approved {
  background: var(--success);
  border-color: #3e6239;
}
.theme-gold .payment-badge.status-rejected {
  background: var(--danger);
  border-color: #873629;
}

/* ── Payment Grid ── */
.theme-gold .payment-grid-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}

.theme-gold .payment-grid { width: 100%; border-collapse: collapse; min-width: 720px; }

.theme-gold .payment-grid th,
.theme-gold .payment-grid td {
  border: 1px solid var(--line-hairline);
  padding: 11px 8px;
  text-align: center;
  font-size: 0.88rem;
}

.theme-gold .payment-grid th {
  background: var(--gradient-primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.theme-gold .payment-grid-name {
  text-align: left !important;
  font-weight: 700;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.92rem;
  white-space: nowrap;
  min-width: 180px;
  background: var(--panel);
  position: sticky;
  left: 0;
  z-index: 1;
}

.theme-gold .payment-grid-cell {
  width: 52px;
  min-width: 52px;
  font-size: 1.1rem;
  transition: background 0.1s;
}

.theme-gold .payment-grid-cell.status-approved { background: rgba(79, 122, 74, 0.12); color: var(--success); }
.theme-gold .payment-grid-cell.status-pending { background: rgba(184, 134, 42, 0.12); color: #8a651f; }
.theme-gold .payment-grid-cell.status-rejected { background: rgba(168, 69, 58, 0.10); color: var(--danger); }
.theme-gold .payment-grid-cell.status-none { background: var(--bg-warm); color: var(--line); }
.theme-gold .payment-grid-cell.status-overdue { background: rgba(168, 69, 58, 0.10); color: var(--danger); }
.theme-gold .payment-grid-empty { color: var(--line); }
.theme-gold .payment-grid-cell a { text-decoration: none; color: inherit; }

/* ── Metric Cards (restrained, editorial KPI cards) ── */
.theme-gold .metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.theme-gold .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  min-height: 134px;
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.theme-gold .metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.85;
}

.theme-gold .metric-card:nth-child(2)::before { background: linear-gradient(90deg, #4a5a6a, #6b7c8d); }
.theme-gold .metric-card:nth-child(3)::before { background: linear-gradient(90deg, #5c7355, #7a9470); }
.theme-gold .metric-card:nth-child(4)::before { background: linear-gradient(90deg, #b8745a, #d49a82); }
.theme-gold .metric-card:nth-child(5)::before { background: linear-gradient(90deg, #6b4a5e, #8a6276); }

.theme-gold .metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.theme-gold .metric-card span {
  display: block;
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.theme-gold .metric-card strong {
  display: block;
  margin-top: 12px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Calendar ── */
.theme-gold .reservation-calendar {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}

.theme-gold .calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-warm);
}

.theme-gold .calendar-toolbar strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
}

.theme-gold .calendar-weekdays span {
  padding: 11px 8px;
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--bg-warm);
}

.theme-gold .calendar-day {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 98px;
  border: 0;
  border-right: 1px solid var(--line-hairline);
  border-bottom: 1px solid var(--line-hairline);
  border-radius: 0;
  padding: 9px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
}

.theme-gold .calendar-day:hover,
.theme-gold .calendar-day:focus {
  background: var(--gradient-primary-soft);
  color: var(--text);
}

.theme-gold .calendar-day.has-event { background: rgba(199, 154, 58, 0.04); }
.theme-gold .muted-day { background: var(--bg-warm); color: var(--muted); }

.theme-gold .calendar-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.theme-gold .calendar-chip.status-pending { background: var(--warning); }
.theme-gold .calendar-chip.status-approved { background: var(--success); }

/* Calendar Events */
.theme-gold .calendar-list { display: grid; gap: 11px; margin: 20px 0 22px; }

.theme-gold .calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  background: var(--panel);
  transition: box-shadow 0.18s, transform 0.12s;
}

.theme-gold .calendar-event:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.theme-gold .calendar-event div { display: grid; gap: 3px; }
.theme-gold .calendar-event span,
.theme-gold .calendar-event small { color: var(--muted-strong); font-size: 0.88rem; }

.theme-gold .calendar-event.status-pending { border-left-color: var(--warning); }
.theme-gold .calendar-event.status-approved { border-left-color: var(--success); }
.theme-gold .calendar-event.status-rejected,
.theme-gold .calendar-event.status-cancelled { border-left-color: var(--danger); opacity: 0.72; }

/* ── Slide Panel ── */
.theme-gold .slide-panel-overlay {
  background: rgba(28, 27, 25, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.theme-gold .slide-panel {
  width: min(440px, 100%);
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(28, 27, 25, 0.12);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.theme-gold .slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--gradient-primary-soft);
  position: relative;
}

.theme-gold .slide-panel-header::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: -1px;
  height: 2px;
  background: var(--gradient-gold-rule);
  opacity: 0.3;
}

.theme-gold .slide-panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.theme-gold .slide-panel-close {
  background: var(--panel);
  color: var(--muted-strong);
  min-height: auto;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.theme-gold .slide-panel-close:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(168, 69, 58, 0.2);
  transform: none;
  box-shadow: none;
}

.theme-gold .slide-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.theme-gold .slide-panel-body .form { max-width: 100%; }

.theme-gold .slide-panel-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-warm);
  display: flex;
  gap: 12px;
}

/* ── Toast ── */
.theme-gold .toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.theme-gold .toast {
  pointer-events: auto;
  min-width: 280px;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-gold .toast.visible { transform: translateX(0); }
.theme-gold .toast.success { border-left: 3px solid var(--success); color: var(--success); }
.theme-gold .toast.error { border-left: 3px solid var(--danger); color: var(--danger); }

/* ── Messages ── */
.theme-gold .messages { margin-bottom: 18px; }

.theme-gold .message {
  margin: 0 0 10px;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.theme-gold .message.error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(168, 69, 58, 0.18);
}
.theme-gold .message.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(79, 122, 74, 0.18);
}

/* ── Security / QR mode picker ── */
.theme-gold .security-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 22px;
}

.theme-gold .security-mode-button {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 220px;
  border-radius: var(--radius-xl);
  padding: 30px;
  background: var(--gradient-primary);
  border: 1px solid var(--primary-dark);
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
}

.theme-gold .security-mode-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(199, 154, 58, 0.3);
}

.theme-gold .security-mode-button.pin-mode {
  background: linear-gradient(135deg, #4a5a6a, #5c6c7d);
  border-color: #3a4756;
  box-shadow: 0 8px 24px rgba(74, 90, 106, 0.22);
}

.theme-gold .security-mode-button strong {
  color: #ffffff;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 600;
}

.theme-gold .security-mode-button span {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.theme-gold .scanner-video { border-radius: var(--radius-lg); border: 1px solid var(--line); }

.theme-gold .security-result-state span {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  font-size: 4rem;
}

.theme-gold .security-result-state strong { font-family: 'Fraunces', Georgia, serif; font-size: 2.1rem; font-weight: 600; }

.theme-gold .security-info-grid article {
  min-height: 132px;
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s;
}

.theme-gold .security-info-grid article:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* ── Visitor Card ── */
.theme-gold .visitor-hero-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #2a2825, #1c1b19);
  color: #f4f1ec;
  border: 1px solid #3a3835;
  box-shadow: var(--shadow-lg);
}

.theme-gold .visitor-hero-card span {
  color: var(--primary-light);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.theme-gold .visitor-hero-card strong {
  display: block;
  margin: 6px 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
}

.theme-gold .visitor-hero-card p { color: #b8b3ac; }

.theme-gold .visitor-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--gradient-primary);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

/* ── Login / Downloads ── */
.theme-gold .login-switch { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.theme-gold .download-list { display: grid; gap: 18px; margin-top: 22px; }

.theme-gold .download-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--panel);
  transition: box-shadow 0.18s, transform 0.12s;
}

.theme-gold .download-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.theme-gold .download-item h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── QR Panel ── */
.theme-gold .qr-preview img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

/* ── Theme Grid (selector) ── */
.theme-gold .theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.theme-gold .theme-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--panel);
  transition: all 0.2s;
}

.theme-gold .theme-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.theme-gold .theme-card h2 {
  margin: 14px 0 6px;
  font-size: 1.1rem;
  font-weight: 600;
}

.theme-gold .theme-card p { color: var(--muted-strong); font-size: 0.88rem; }

.theme-gold .theme-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 112px;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--gradient-primary-soft);
  border: 1px solid rgba(199, 154, 58, 0.12);
}

.theme-gold .theme-preview span { border-radius: var(--radius-sm); }

.theme-gold .theme-badge {
  display: inline-flex;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: #1c1b19;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
}

/* ── Checkbox ── */
.theme-gold .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
}

.theme-gold .checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-height: auto;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.theme-gold .checkbox-label input[type="checkbox"]:checked {
  background: var(--gradient-primary);
  border-color: var(--primary-dark);
}

.theme-gold .checkbox-label input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #1c1b19;
  font-size: 0.72rem;
  font-weight: 700;
}

.theme-gold .checkbox-label input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(199, 154, 58, 0.18);
}

/* ── Segmented Control ── */
.theme-gold .segmented-control {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-warm);
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid var(--line);
}

.theme-gold .segmented-control a,
.theme-gold .segmented-control button {
  background: transparent;
  border: 0;
  color: var(--muted-strong);
  border-radius: var(--radius-full);
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 32px;
  padding: 0 16px;
}

.theme-gold .segmented-control .active {
  background: var(--gradient-primary);
  color: #1c1b19;
}

/* ── Help text & muted notes ── */
.theme-gold .help-text { margin: -6px 0 0; color: var(--muted); font-size: 0.82rem; }

.theme-gold .muted-note {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Public Topbar ── */
.theme-gold .public-topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

/* ── Misc ── */
.theme-gold .compact-actions { margin-top: 0; }
.theme-gold .inline-form { max-width: 540px; }
.theme-gold .reservation-form { margin-top: 20px; }
.theme-gold .reservation-workspace { margin: 20px 0 24px; }
.theme-gold .login-download { margin-top: 20px; }
.theme-gold .oauth-actions { margin-top: 20px; }
.theme-gold .scanner-box { display: grid; gap: 10px; }
.theme-gold .scanner-status { color: var(--muted-strong); font-size: 0.9rem; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .theme-gold .app-shell {
    display: block;
    padding: 0;
  }

  .theme-gold .sidebar,
  .theme-gold .main-area {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .theme-gold .sidebar { position: static; }

  .theme-gold .page { width: min(100% - 28px, 1180px); padding: 18px; }
  .theme-gold .filters,
  .theme-gold .metric-grid,
  .theme-gold .scan-layout,
  .theme-gold .details-grid { grid-template-columns: 1fr; }
  .theme-gold .section-header { display: grid; }
  .theme-gold .panel { padding: 20px; }
}


/* ============================================================
   PREVIEW: Graphite & Gold — paleta para el selector de temas
   ============================================================ */

.gold-preview {
  background:
    linear-gradient(135deg, rgba(199, 154, 58, 0.06), rgba(199, 154, 58, 0.02)),
    #faf8f4;
  border: 1px solid rgba(199, 154, 58, 0.14);
}

/* Muestra 1 — degradado dorado (acento principal) */
.gold-preview span:nth-child(1) {
  background: linear-gradient(135deg, #d9b25f 0%, #c79a3a 50%, #a87f23 100%);
  box-shadow: 0 6px 16px rgba(199, 154, 58, 0.28);
}

/* Muestra 2 — grafito cálido (neutral) */
.gold-preview span:nth-child(2) {
  background: linear-gradient(135deg, #3a3835, #1c1b19);
  box-shadow: 0 6px 16px rgba(28, 27, 25, 0.22);
}

/* Muestra 3 — papel crema con filete dorado (editorial) */
.gold-preview span:nth-child(3) {
  background: linear-gradient(135deg, #ffffff, #faf8f4);
  border: 1px solid #e3ddd3;
  border-top: 2px solid #c79a3a;
  box-shadow: 0 6px 16px rgba(28, 27, 25, 0.10);
}

.onboarding-panel {
  max-width: 500px;
  margin: 40px auto;
}

.onboarding-form {
  max-width: 100%;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.onboarding-grid input {
  width: 100%;
  box-sizing: border-box;
}

.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  vertical-align: middle;
}

.btn-approve {
  background: #22c55e;
  color: #fff;
}

.btn-approve:hover {
  background: #16a34a;
}

.btn-reject {
  background: #ef4444;
  color: #fff;
}

.btn-reject:hover {
  background: #dc2626;
}

.last-payments-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
}

.last-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.last-pay-type {
  color: var(--text-soft);
  font-weight: 500;
  white-space: nowrap;
}

.last-pay-date {
  color: #16a34a;
  font-weight: 600;
  white-space: nowrap;
}

.last-pay-none {
  color: #dc2626;
  font-style: italic;
  font-weight: 500;
  font-size: 0.82rem;
}

.last-payments-panel {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.last-payments-panel h3 {
  font-size: 0.95rem;
  margin: 0 0 12px 0;
  color: var(--text);
  font-weight: 600;
}

.last-payments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.last-payments-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.last-payments-item:last-child {
  border-bottom: none;
}

.last-payments-type {
  font-weight: 500;
  font-size: 0.9rem;
}

.last-payments-date {
  font-size: 0.88rem;
  color: #16a34a;
  font-weight: 600;
}

.last-payments-none {
  font-size: 0.88rem;
  color: #dc2626;
  font-style: italic;
}

.share-btn {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

.copy-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.copy-btn-inline:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.copy-btn-inline:disabled {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.share-links {
  display: none;
  gap: 8px;
  margin-top: 8px;
}

.share-links.visible {
  display: flex;
}

.share-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}

.share-link:hover {
  opacity: 0.85;
  color: #fff;
}

.share-link.whatsapp {
  background: #25d366;
}

.share-link.telegram {
  background: #0088cc;
}

.delivery-pending-card {
  max-width: 500px;
  margin: 0 auto 16px;
  padding: 16px;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.delivery-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delivery-card-icon {
  font-size: 1.8rem;
}

.delivery-card-header strong {
  display: block;
  font-size: 1rem;
  color: #92400e;
}

.delivery-card-status {
  font-size: 0.82rem;
  color: #b45309;
}

.delivery-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #78716c;
}

.delivery-countdown {
  font-weight: 600;
  color: #dc2626;
}

.delivery-card-desc {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #57534e;
}

.delivery-status-text {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--ui-ink);
  background: #f1f5f9;
  white-space: nowrap;
  align-self: start;
}

.status-active .delivery-status-text { background: #dcfce7; color: #166534; }
.status-used .delivery-status-text { background: #dbeafe; color: #1e40af; }
.status-cancelled .delivery-status-text,
.status-expired .delivery-status-text { background: #fee2e2; color: #991b1b; }

.delivery-resolved-banner {
  max-width: 500px;
  margin: 0 auto 12px;
  padding: 12px 16px;
  background: #dcfce7;
  border: 1px solid #22c55e;
  border-radius: 8px;
  color: #166534;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.delivery-create-form {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delivery-notify-btn {
  background: #f59e0b;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
}

.delivery-notify-btn:hover {
  background: #d97706;
}

.delivery-grid-cell {
  text-align: center;
  padding: 8px 4px;
}

.delivery-active-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #f59e0b;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.delivery-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delivery-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  gap: 12px;
}

.delivery-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.delivery-item-info strong {
  font-size: 0.95rem;
  color: #92400e;
}

.delivery-item-info span {
  font-size: 0.82rem;
  color: #78716c;
}

.delivery-item-desc {
  font-style: italic;
}

.delivery-item-time {
  font-size: 0.78rem;
  color: #a8a29e;
}

.delivery-register-btn {
  background: #22c55e;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  white-space: nowrap;
}

.delivery-register-btn:hover {
  background: #16a34a;
}

@media (max-width: 500px) {
  .onboarding-panel {
    margin: 20px 12px;
    padding: 20px 16px;
  }

  .onboarding-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pagination-btn:hover:not([disabled]):not(.active) {
  background: var(--line);
}

.pagination-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  cursor: default;
}

.pagination-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-dots {
  padding: 6px 6px;
  color: var(--muted);
  font-size: 13px;
}

/* ============================================================
   System Redesign 2026 - operational workspace for Stitch handoff
   ============================================================ */

:root {
  --ui-bg: #eef2f6;
  --ui-surface: #ffffff;
  --ui-surface-2: #f8fafc;
  --ui-ink: #111827;
  --ui-ink-soft: #475467;
  --ui-muted: #667085;
  --ui-line: #d9e0e8;
  --ui-line-strong: #b8c2cc;
  --ui-blue: #174ea6;
  --ui-teal: #0b7a75;
  --ui-green: #11875d;
  --ui-amber: #b7791f;
  --ui-red: #b42318;
  --ui-violet: #6941c6;
  --ui-radius: 8px;
  --ui-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  --ui-shadow-sm: 0 3px 10px rgba(17, 24, 39, 0.06);
}

body {
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-family: "Inter", Arial, sans-serif;
}

body[class*="role-"] .app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  padding: 0;
  background:
    linear-gradient(180deg, #f6f8fb 0%, #eef2f6 42%, #e8edf3 100%);
}

body[class*="role-"] .sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: none;
  padding: 18px 14px;
  border: 0;
  border-right: 1px solid var(--ui-line);
  border-radius: 0;
  background: #111827;
  color: #ffffff;
}

body[class*="role-"] .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  margin: 0 4px 18px;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 0;
  color: #111827;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 900;
}

img.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.sidebar-residential-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 920px) {
  body[class*="role-"] .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    margin: 0;
    padding: 4px 0;
  }

  img.brand-mark {
    width: 19px;
    height: 19px;
    padding: 2px;
  }

  .sidebar-residential-logo {
    width: 50%;
    height: auto;
    max-width: 180px;
  }

  body[class*="role-"] .sidebar-brand .nav-label {
    display: none;
  }
}

body[class*="role-"] .sidebar-user {
  gap: 5px;
  margin: 0 4px 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--ui-radius);
  background: rgba(255, 255, 255, 0.07);
}

body[class*="role-"] .sidebar-user strong {
  color: #ffffff;
  font-size: 0.92rem;
}

body[class*="role-"] .sidebar-user span {
  color: #cbd5e1;
  font-size: 0.78rem;
  text-transform: uppercase;
}

body[class*="role-"] .side-nav {
  display: grid;
  gap: 4px;
}

.sidebar-logout {
  display: none;
}

.nav-logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: var(--ui-radius);
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.nav-logout-link:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.nav-logout-link .nav-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

body[class*="role-"] .side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: var(--ui-radius);
  color: #d5dde8;
  font-size: 0.88rem;
  font-weight: 700;
}

body[class*="role-"] .side-nav a::before {
  display: none;
}

.nav-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 0;
  color: inherit;
  background: none;
  padding: 0;
  box-sizing: border-box;
  transition: color 0.15s ease;
}

body[class*="role-"] .side-nav a:hover .nav-icon,
body[class*="role-"] .side-nav a:focus .nav-icon {
  color: rgba(255, 255, 255, 0.85);
}

body[class*="role-"] .side-nav a.active .nav-icon {
  color: #ffffff;
}

body[class*="role-"] .side-nav a:hover,
body[class*="role-"] .side-nav a:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

body[class*="role-"] .side-nav a:hover::before,
body[class*="role-"] .side-nav a:focus::before {
  background: #ffffff;
}

body[class*="role-"] .nav-section {
  padding: 15px 10px 6px;
  color: #94a3b8;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

body[class*="role-"] .main-area {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[class*="role-"] .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--ui-line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

body[class*="role-"] .topbar strong {
  display: block;
  margin-top: 3px;
  color: var(--ui-ink);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

body[class*="role-"] .eyebrow {
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body[class*="role-"] .topbar button {
  min-height: 38px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: #ffffff;
  font-weight: 800;
}

body[class*="role-"] .page {
  width: min(100% - 48px, 1320px);
  margin: 24px auto 48px;
}

.panel,
.stacked-panel,
.download-item,
.theme-card,
.reservation-calendar,
.security-recent-events,
.security-empty-state,
.security-pin-form,
.payment-grid-wrap,
.last-payments-panel,
.delivery-pending-card,
.delivery-item,
.visitor-hero-card,
.security-info-grid article {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.panel {
  padding: 22px;
}

.section-header {
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ui-line);
}

.section-header h1,
.panel h1,
.panel h2,
.security-dashboard h1,
.security-dashboard h2 {
  margin-top: 0;
  color: var(--ui-ink);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  letter-spacing: 0;
}

.section-header p,
.panel p,
.help-text,
.muted-note {
  color: var(--ui-muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: #ffffff;
  font: inherit;
}

textarea {
  min-height: 108px;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ui-blue);
  outline: 3px solid rgba(23, 78, 166, 0.14);
}

label {
  color: var(--ui-ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

button,
.button-link,
.security-primary-action,
.security-secondary-action {
  min-height: 42px;
  border-radius: var(--ui-radius);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

button,
.button-link,
.security-primary-action {
  background: var(--ui-blue);
}

.button-link.secondary,
.security-secondary-action,
.secondary-button {
  border: 1px solid var(--ui-line-strong);
  color: var(--ui-ink);
  background: #ffffff;
}

button.danger {
  background: var(--ui-red);
}

.actions,
.row-actions,
.compact-actions {
  gap: 8px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 118px;
  border-radius: var(--ui-radius);
  padding: 18px;
  box-shadow: var(--ui-shadow-sm);
}

.metric-card:nth-child(1) { background: #174ea6; }
.metric-card:nth-child(2) { background: #0b7a75; }
.metric-card:nth-child(3) { background: #11875d; }
.metric-card:nth-child(4) { background: #6941c6; }
.metric-card:nth-child(5) { background: #b7791f; }

.table-wrap,
.payment-grid-wrap {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #ffffff;
  overflow: auto;
}

table,
.payment-grid {
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td,
.payment-grid th,
.payment-grid td {
  border-bottom: 1px solid var(--ui-line);
  padding: 12px;
}

th,
.payment-grid th {
  color: var(--ui-muted);
  background: var(--ui-surface-2);
  font-size: 0.76rem;
  text-transform: uppercase;
}

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

.filters {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
}

.calendar-event,
.calendar-list,
.reservation-workspace,
.details,
.download-list {
  gap: 12px;
}

.calendar-event {
  border-color: var(--ui-line);
  border-left-width: 5px;
  border-radius: var(--ui-radius);
}

.calendar-toolbar {
  background: var(--ui-surface-2);
}

.calendar-day {
  min-height: 108px;
  color: var(--ui-ink);
}

.calendar-day:hover,
.calendar-day:focus {
  background: #eef6ff;
}

.payment-badge,
.calendar-chip,
.pagination-btn {
  border-radius: 999px;
}

.payment-badge.status-approved,
.calendar-chip.status-approved {
  background: var(--ui-green);
}

.payment-badge.status-pending,
.calendar-chip.status-pending {
  background: var(--ui-amber);
}

.payment-badge.status-rejected {
  background: var(--ui-red);
}

.message {
  border-radius: var(--ui-radius);
  border-color: var(--ui-line);
  background: #ffffff;
  box-shadow: var(--ui-shadow-sm);
}

.message.error {
  border-left: 4px solid var(--ui-red);
}

.message.success {
  border-left: 4px solid var(--ui-green);
}

.security-dashboard,
.security-app {
  color: var(--ui-ink);
  font-family: "Inter", Arial, sans-serif;
}

.security-shift-card,
.visitor-hero-card {
  border: 0;
  color: #ffffff;
  background: #111827;
}

.security-quick-action {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-sm);
}

.security-quick-action.primary {
  border-color: var(--ui-teal);
  background: var(--ui-teal);
}

.security-quick-action.primary.pin {
  border-color: #111827;
  background: #111827;
}

.security-daily-summary {
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-sm);
}

.security-daily-summary strong {
  color: var(--ui-blue);
}

.security-pin-input-wrap input {
  border-color: #111827;
  border-radius: var(--ui-radius);
}

.pin-keypad button {
  border-radius: var(--ui-radius);
}

.role-resident .sidebar {
  background: #12343b;
}

.role-resident .nav-icon {
  color: rgba(255, 255, 255, 0.45);
}

.role-security .sidebar,
.role-seguridad .sidebar {
  background: #0f172a;
}

.role-security .nav-icon,
.role-seguridad .nav-icon {
  color: rgba(255, 255, 255, 0.45);
}

.role-admin .sidebar,
.role-directivo .sidebar {
  background: #171421;
}

.role-admin .nav-icon,
.role-directivo .nav-icon {
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 920px) {
  body[class*="role-"] .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  body[class*="role-"] .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 10px 12px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  body[class*="role-"] .sidebar-brand {
    min-height: 36px;
    margin: 0 0 8px;
  }

  body[class*="role-"] .sidebar-user,
  body[class*="role-"] .nav-section {
    display: none;
  }

  body[class*="role-"] .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  body[class*="role-"] .side-nav a {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 7px 10px 7px 7px;
    scroll-snap-align: start;
  }

  body[class*="role-"] .side-nav a .nav-icon {
    flex-basis: 32px;
  }

  body[class*="role-"] .topbar {
    position: static;
    min-height: 58px;
    padding: 0 14px;
  }

  body[class*="role-"] .page {
    width: min(100% - 24px, 720px);
    margin: 16px auto 34px;
  }

  .panel,
  .security-pin-form {
    padding: 16px;
  }

  .section-header {
    display: grid;
    gap: 12px;
  }

  .metric-grid,
  .security-quick-actions,
  .security-daily-summary,
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-toolbar {
    display: grid;
  }
}

@media (max-width: 560px) {
  body[class*="role-"] .topbar form {
    display: none;
  }

  body[class*="role-"] .page {
    width: calc(100% - 18px);
    margin-top: 10px;
  }

  .panel,
  .security-pin-form {
    padding: 14px;
  }

  .metric-grid,
  .security-quick-actions,
  .security-daily-summary,
  .filters,
  .calendar-event {
    grid-template-columns: 1fr;
  }

  .security-daily-summary article {
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
  }

  .security-daily-summary article:last-child {
    border-bottom: 0;
  }

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

.ops-workspace {
  display: grid;
  gap: 18px;
}

.ops-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(135deg, rgba(23, 78, 166, 0.09), transparent 42%),
    var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.ops-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-hero h1 {
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.05;
}

.ops-hero p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--ui-muted);
}

.ops-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ops-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.ops-action.primary {
  border-color: var(--ui-blue);
  color: #ffffff;
  background: var(--ui-blue);
}

.ops-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.ops-metrics article {
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.ops-metrics span,
.ops-metrics small {
  display: block;
  color: var(--ui-muted);
}

.ops-metrics span {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-metrics strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--ui-blue);
  font-size: 2.2rem;
  line-height: 1;
}

.ops-metrics .attention strong {
  color: var(--ui-red);
}

.ops-board {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ops-filter-panel,
.ops-data-panel {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.ops-filter-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.ops-filter-panel h2,
.ops-data-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.ops-filter-form {
  display: grid;
  gap: 12px;
}

.ops-board-main {
  display: grid;
  gap: 16px;
}

.ops-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ops-data-panel {
  overflow: hidden;
}

.ops-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-2);
}

.ops-panel-heading b {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ui-blue);
  font-size: 0.9rem;
}

.ops-list,
.ops-compact-list,
.resident-delivery-list,
.resident-link-list {
  display: grid;
}

.ops-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ui-line);
}

.ops-list-row:last-child,
.ops-compact-list article:last-child,
.resident-delivery-card:last-child,
.resident-link-list a:last-child {
  border-bottom: 0;
}

.ops-list-row strong,
.ops-compact-list strong,
.resident-delivery-card strong,
.resident-link-list strong {
  display: block;
  color: var(--ui-ink);
}

.ops-list-row span,
.ops-list-row time,
.ops-compact-list span,
.ops-compact-list time,
.resident-delivery-card span,
.resident-link-list span {
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.ops-compact-list article {
  display: grid;
  gap: 3px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ui-line);
}

.ops-empty {
  padding: 18px;
  color: var(--ui-muted);
  background: var(--ui-surface);
}

.resident-hero {
  background:
    linear-gradient(135deg, rgba(11, 122, 117, 0.12), transparent 44%),
    var(--ui-surface);
}

.ops-residence-chip {
  min-width: 190px;
  padding: 14px;
  border-radius: var(--ui-radius);
  color: #ffffff;
  background: #12343b;
}

.ops-residence-chip span,
.ops-residence-chip strong {
  display: block;
}

.ops-residence-chip span {
  color: #c5d9dd;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-residence-chip strong {
  margin-top: 4px;
  font-size: 1.05rem;
}

.resident-welcome-card {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 20px 24px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: linear-gradient(135deg, rgba(11, 122, 117, 0.06), var(--ui-surface) 50%);
  box-shadow: var(--ui-shadow-sm);
}

.resident-welcome-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: #ffffff;
  background: var(--ui-teal);
}

.resident-welcome-icon svg {
  width: 30px;
  height: 30px;
}

.resident-welcome-info {
  min-width: 0;
  margin-top: -8px;
}

.resident-welcome-greeting {
  display: block;
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resident-welcome-name {
  margin: 2px 0 0;
  color: var(--ui-ink);
  font-size: 1.3rem;
  line-height: 1.2;
}

.resident-welcome-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
}

.resident-welcome-detail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ui-muted);
  font-size: 0.8rem;
}

.resident-welcome-detail svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.resident-phone-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.resident-phone-link:hover {
  color: var(--ui-teal);
}

.resident-welcome-logo {
  flex-shrink: 0;
  margin: -12px 0;
}

.resident-welcome-logo img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 14px;
  background: transparent;
  padding: 0;
}

.resident-welcome-residential {
  display: block;
  color: var(--ui-teal);
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 680px) {
  .resident-welcome-card {
    flex-direction: column;
    text-align: center;
    padding: 18px 16px;
  }

  .resident-welcome-details {
    justify-content: center;
  }
}

.resident-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.delivery-wide {
  grid-column: span 2;
}

.resident-action-card {
  min-height: 146px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  text-decoration: none;
}

.resident-action-card span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  font-weight: 900;
  transition: all 0.2s ease;
}

.resident-action-card span svg {
  width: 26px;
  height: 26px;
}

.resident-action-card:hover span {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.14);
}

.resident-action-card strong {
  display: block;
  margin-top: 18px;
  font-size: 1.05rem;
}

.resident-action-card small {
  display: block;
  margin-top: 5px;
  color: var(--ui-muted);
}

.resident-action-card.primary {
  color: #ffffff;
  border-color: var(--ui-teal);
  background: var(--ui-teal);
}

.resident-action-card.dark {
  color: #ffffff;
  border-color: #111827;
  background: #111827;
}

.resident-action-card.primary small,
.resident-action-card.dark small {
  color: rgba(255, 255, 255, 0.78);
}

.resident-action-card.primary span,
.resident-action-card.dark span {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.resident-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.delivery-create-form {
  margin: 0;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
}

.delivery-notify-btn {
  background: var(--ui-teal);
}

.resident-delivery-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ui-line);
  background: #ffffff;
}

.resident-link-list a {
  display: grid;
  gap: 3px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-ink);
  text-decoration: none;
}

.resident-link-list a:hover,
.resident-link-list a:focus {
  background: #eef6ff;
}

@media (max-width: 1080px) {
  .ops-metrics,
  .resident-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-board,
  .resident-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .ops-filter-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .ops-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .ops-hero-actions {
    justify-content: stretch;
  }

  .ops-hero-actions .ops-action,
  .ops-residence-chip {
    width: 100%;
  }

  .ops-metrics,
  .ops-two-column,
  .resident-action-grid {
    grid-template-columns: 1fr;
  }

  .ops-list-row {
    grid-template-columns: 1fr;
  }
}

.maint-workspace,
.capture-workspace {
  display: grid;
  gap: 18px;
}

.maint-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.maint-summary article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.maint-summary span,
.maint-record-meta span {
  display: block;
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.maint-summary strong {
  display: block;
  margin-top: 10px;
  color: var(--ui-blue);
  font-size: 2rem;
  line-height: 1;
}

.maint-section {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
}

.maint-card-list {
  display: grid;
}

.maint-record {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(150px, 0.35fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ui-line);
}

.maint-record:last-child {
  border-bottom: 0;
}

.maint-record.muted,
.area-card.muted {
  background: #f8fafc;
  opacity: 0.78;
}

.maint-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--ui-radius);
  color: #ffffff;
  background: var(--ui-blue);
  font-size: 0.92rem;
  font-weight: 900;
}

.table-area-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-area-info .maint-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.maint-record-main strong,
.maint-record-main span,
.maint-record-main small,
.maint-record-meta strong,
.maint-record-meta small {
  display: block;
}

.maint-record-main strong,
.maint-record-meta strong {
  color: var(--ui-ink);
}

.maint-record-main span,
.maint-record-main small,
.maint-record-meta small {
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.maint-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.maint-actions a,
.maint-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.maint-actions button.danger {
  color: #ffffff;
  border-color: var(--ui-red);
  background: var(--ui-red);
}

.area-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
  padding: 16px;
}

.area-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: #ffffff;
  box-shadow: var(--ui-shadow-sm);
}

.area-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.area-card-top b {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ui-green);
  font-size: 0.72rem;
}

.area-card.muted .area-card-top b {
  background: var(--ui-muted);
}

.area-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.area-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.area-card dt {
  color: var(--ui-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.area-card dd {
  margin: 3px 0 0;
  color: var(--ui-ink);
  font-weight: 800;
}

.capture-form {
  display: grid;
  gap: 14px;
}

.capture-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.capture-step {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--ui-radius);
  color: #ffffff;
  background: #111827;
  font-weight: 900;
}

.capture-content h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.capture-grid.thirds {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.capture-grid .wide {
  grid-column: 1 / -1;
}

.capture-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--ui-shadow);
}

@media (max-width: 880px) {
  .maint-record {
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
  }

  .maint-record-meta,
  .maint-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .capture-grid,
  .capture-grid.thirds {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .maint-summary {
    grid-template-columns: 1fr;
  }

  .capture-card {
    grid-template-columns: 1fr;
  }

  .capture-footer {
    display: grid;
  }
}

.review-workspace,
.guard-workspace {
  display: grid;
  gap: 18px;
}

.review-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.review-filter.compact {
  grid-template-columns: repeat(2, minmax(190px, 1fr)) auto auto;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.review-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.review-title-row h2,
.reservation-review-card h2,
.timeline-card h2,
.guard-delivery-main h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 1.1rem;
}

.review-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.review-facts dt,
.area-card dt {
  color: var(--ui-muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-facts dd {
  margin: 3px 0 0;
  color: var(--ui-ink);
  font-weight: 800;
}

.review-history-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.review-history-strip span {
  display: inline-flex;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ui-muted);
  background: var(--ui-surface-2);
  font-size: 0.78rem;
}

.review-history-strip b {
  color: var(--ui-ink);
}

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-actions a,
.review-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.review-actions button {
  color: #ffffff;
  border-color: var(--ui-blue);
  background: var(--ui-blue);
}

.review-actions button.danger {
  border-color: var(--ui-red);
  background: var(--ui-red);
}

.reservation-review-grid {
  display: grid;
  gap: 14px;
}

.reservation-review-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-left: 6px solid var(--ui-amber);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.reservation-review-card.status-approved {
  border-left-color: var(--ui-green);
}

.reservation-review-card.status-rejected,
.reservation-review-card.status-cancelled {
  border-left-color: var(--ui-red);
}

.reservation-date {
  display: grid;
  place-items: center;
  min-height: 70px;
  border-radius: var(--ui-radius);
  color: #ffffff;
  background: #111827;
}

.reservation-date span {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}

.reservation-date small {
  color: #cbd5e1;
  text-transform: uppercase;
}

.review-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ui-amber);
  font-size: 0.76rem;
  font-weight: 900;
}

.status-approved .review-status {
  background: var(--ui-green);
}

.status-rejected .review-status,
.status-cancelled .review-status {
  background: var(--ui-red);
}

.security-timeline {
  display: grid;
  gap: 12px;
}

.security-timeline-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.timeline-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ui-teal);
  font-weight: 900;
}

.security-timeline-item.exit .timeline-mark {
  background: var(--ui-amber);
}

.timeline-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.timeline-card p,
.timeline-card small {
  display: block;
  margin: 6px 0 0;
  color: var(--ui-muted);
}

.timeline-photos {
  display: flex;
  gap: 8px;
}

.timeline-photos img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  object-fit: cover;
}

.guard-delivery-list {
  display: grid;
  gap: 14px;
}

.guard-delivery-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.guard-delivery-main p,
.guard-delivery-main span {
  display: block;
  color: var(--ui-muted);
}

.guard-capture-actions {
  display: grid !important;
  gap: 10px !important;
  margin-top: 0 !important;
}

.guard-capture-actions .delivery-photo-btn,
.guard-capture-actions .delivery-register-btn {
  width: 100% !important;
  min-height: 42px !important;
  border-radius: var(--ui-radius) !important;
  font-weight: 800 !important;
}

@media (max-width: 900px) {
  .review-filter,
  .review-filter.compact,
  .review-card,
  .reservation-review-card,
  .guard-delivery-card {
    grid-template-columns: 1fr;
  }

  .review-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .review-facts,
  .timeline-card {
    grid-template-columns: 1fr;
  }

  .security-timeline-item {
    grid-template-columns: 1fr;
  }
}

/* Resident operations redesign */
.resident-ops-workspace {
  display: grid;
  gap: 18px;
}

.resident-ops-hero {
  background:
    linear-gradient(135deg, rgba(8, 34, 46, 0.94), rgba(17, 93, 88, 0.9)),
    radial-gradient(circle at 86% 14%, rgba(240, 196, 96, 0.38), transparent 34%);
}

.resident-ops-hero .ops-action.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.resident-ledger-grid,
.payment-command-grid,
.reservation-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.resident-ledger-panel,
.payment-year-card,
.payment-history-panel,
.reservation-calendar-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--ui-shadow-soft);
}

.resident-ledger-panel.accent-panel {
  background: #f7fbfa;
}

.resident-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.resident-panel-heading h2 {
  margin: 3px 0 0;
  font-size: 1rem;
  color: var(--ui-ink);
}

.resident-count {
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ui-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.resident-record-list {
  display: grid;
  gap: 10px;
}

.resident-record-list.compact {
  gap: 8px;
}

.resident-record-card,
.resident-delivery-card,
.payment-history-card,
.resident-reservation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--ui-line);
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.resident-record-card.status-active,
.resident-delivery-card.status-active,
.resident-reservation-card.status-approved {
  border-left-color: #149a7a;
}

.resident-record-card.status-used,
.resident-delivery-card.status-used {
  border-left-color: #2563eb;
}

.resident-record-card.status-expired,
.resident-record-card.status-disabled,
.resident-delivery-card.status-expired,
.resident-delivery-card.status-cancelled,
.resident-reservation-card.status-rejected,
.resident-reservation-card.status-cancelled {
  border-left-color: #dc2626;
}

.resident-reservation-card.status-pending,
.payment-history-card {
  border-left-color: #d97706;
}

.resident-record-main h3,
.resident-delivery-card h3,
.payment-history-card h3,
.resident-reservation-card h3 {
  margin: 2px 0 4px;
  font-size: 0.98rem;
  color: var(--ui-ink);
}

.resident-record-main p,
.resident-delivery-card p,
.payment-history-card p,
.resident-reservation-card p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.record-type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f5f2;
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 800;
}

.resident-record-meta {
  justify-self: end;
}

.resident-evidence-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ui-muted);
  font-size: 0.8rem;
}

.resident-evidence-row img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--ui-line);
}

.resident-card-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.resident-card-actions a,
.resident-card-actions button,
.quick-submit-bar a,
.quick-submit-bar button {
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.84rem;
}

.payment-year-stack {
  display: grid;
  gap: 12px;
}

.payment-month-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(68px, 1fr));
  gap: 8px;
}

.payment-month-tile {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 72px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #f8fafc;
}

.payment-month-tile span {
  color: var(--ui-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.payment-month-tile strong,
.payment-month-tile a {
  color: var(--ui-ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.payment-month-tile.status-approved {
  background: #eaf8f2;
  border-color: #9bd8c0;
}

.payment-month-tile.status-pending {
  background: #fff7e6;
  border-color: #f4c46c;
}

.payment-month-tile.status-rejected,
.payment-month-tile.status-overdue {
  background: #fff1f2;
  border-color: #f5a5a8;
}

.payment-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  color: var(--ui-muted);
  font-size: 0.78rem;
}

.payment-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.payment-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.payment-legend i.status-approved { background: #149a7a; }
.payment-legend i.status-pending { background: #d97706; }
.payment-legend i.status-rejected { background: #dc2626; }
.payment-legend i.status-overdue { background: #991b1b; }

.reservation-area-filter {
  align-items: end;
}

.reservation-calendar-card .calendar-toolbar {
  margin-bottom: 14px;
}

.reservation-calendar-card .reservation-calendar {
  border: 0;
  padding: 0;
  box-shadow: none;
}

.reservation-calendar-card .calendar-grid {
  gap: 7px;
}

.reservation-calendar-card .calendar-day {
  min-height: 78px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
}

.quick-access-shell {
  display: grid;
  gap: 14px;
}

.quick-form-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-soft);
}

.quick-form-card.primary {
  border-left: 5px solid #149a7a;
}

.quick-step-index {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #08222e;
  color: #fff;
  font-weight: 900;
}

.quick-form-fields {
  display: grid;
  gap: 9px;
}

.quick-form-fields label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ui-muted);
}

.required-dot {
  color: #dc2626;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-row strong {
  color: var(--ui-ink);
}

.toggle-row p {
  margin: 4px 0 0;
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.switch-control {
  position: relative;
  display: inline-flex;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch-control input {
  position: absolute;
  opacity: 0;
}

.switch-control span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch-control span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.switch-control input:checked + span {
  background: #149a7a;
}

.switch-control input:checked + span::after {
  transform: translateX(24px);
}

.quick-period-grid {
  grid-template-columns: 1fr 1fr;
}

.quick-submit-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 960px) {
  .resident-ledger-grid,
  .payment-command-grid,
  .reservation-command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .resident-record-card,
  .resident-delivery-card,
  .payment-history-card,
  .resident-reservation-card {
    grid-template-columns: 1fr;
  }

  .resident-record-meta {
    justify-self: start;
  }

  .payment-month-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-form-card {
    grid-template-columns: 1fr;
  }

  .quick-step-index {
    width: 46px;
    height: 46px;
  }

  .quick-period-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin catalogs, services and settings redesign */
.catalog-workspace,
.settings-workspace,
.service-form-workspace {
  display: grid;
  gap: 18px;
}

.catalog-card-grid,
.service-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.catalog-card,
.service-review-card,
.settings-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: var(--ui-shadow-soft);
}

.catalog-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-left: 5px solid #149a7a;
}

.catalog-card.is-disabled {
  border-left-color: #dc2626;
  background: #fff8f8;
}

.catalog-card-main h2,
.service-review-main h2,
.settings-card-head h2 {
  margin: 3px 0 6px;
  color: var(--ui-ink);
  font-size: 1rem;
}

.catalog-card-main p,
.service-review-main p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.catalog-state-row {
  display: flex;
  justify-content: flex-start;
}

.catalog-actions,
.service-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-actions a,
.catalog-actions button,
.service-review-actions a,
.service-review-actions button {
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.84rem;
}

.compact-capture-card {
  max-width: 760px;
}

.catalog-toggle {
  margin-top: 12px;
}

.form-command-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--ui-line);
  padding-top: 16px;
}

.service-review-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-left: 5px solid #d97706;
}

.service-review-card.status-active {
  border-left-color: #149a7a;
}

.service-review-card.status-hidden {
  border-left-color: #dc2626;
}

.service-review-main blockquote {
  margin: 12px 0 0;
  border-left: 3px solid #d8ebe7;
  padding-left: 10px;
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.service-review-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.service-review-stats a {
  color: #dc2626;
  font-weight: 800;
}

.ghost-action {
  pointer-events: none;
  opacity: 0.72;
}

.service-capture-card {
  max-width: 920px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-field {
  grid-column: 1 / -1;
}

.settings-grid-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.settings-card {
  padding: 16px;
}

.settings-card.span-two,
.settings-command-bar {
  grid-column: 1 / -1;
}

.settings-card-head {
  margin-bottom: 14px;
}

.settings-toggle-list {
  display: grid;
  gap: 10px;
}

.settings-toggle-list.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--ui-ink);
  font-weight: 700;
}

.setting-toggle.child {
  margin-left: 18px;
  background: #fff;
}

.setting-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #149a7a;
  flex: 0 0 auto;
}

.settings-command-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-soft);
}

@media (max-width: 900px) {
  .settings-grid-form,
  .settings-toggle-list.two-column,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .settings-card.span-two,
  .settings-command-bar {
    grid-column: auto;
  }

  .setting-toggle.child {
    margin-left: 0;
  }
}

/* Roles, payment states and surveys redesign */
.status-flow-grid,
.role-card-grid,
.survey-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.status-flow-card,
.role-card,
.survey-card,
.survey-vote-card,
.survey-results-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: var(--ui-shadow-soft);
}

.status-flow-card,
.survey-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-left: 5px solid #94a3b8;
}

.status-flow-card.status-approved,
.survey-card.status-active {
  border-left-color: #149a7a;
}

.status-flow-card.status-pending,
.status-flow-card.status-uploaded,
.survey-card.status-scheduled {
  border-left-color: #d97706;
}

.status-flow-card.status-rejected,
.survey-card.status-closed {
  border-left-color: #dc2626;
}

.status-flow-card h2,
.role-card h2,
.survey-card h2,
.survey-vote-form h2 {
  margin: 3px 0 6px;
  color: var(--ui-ink);
  font-size: 1rem;
}

.status-flow-card p,
.survey-card p,
.role-card p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.status-flow-meta,
.survey-card-stats,
.survey-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.status-flow-meta,
.survey-card-stats {
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.role-card {
  padding: 16px;
}

.role-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.role-card-head a,
.survey-card-actions a,
.survey-card-actions button {
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.84rem;
}

.role-permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.role-permission-grid span {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 9px;
  color: var(--ui-muted);
  background: #f8fafc;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.role-permission-grid span.enabled {
  color: #0f766e;
  background: #e8f5f2;
  border-color: #9bd8c0;
}

.role-capture-card,
.survey-capture-card {
  max-width: 980px;
}

.badge-preview-row,
.survey-option-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.survey-option-list {
  display: grid;
}

.survey-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.survey-option-row button {
  min-height: 42px;
  border-radius: 8px;
}

.survey-vote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.survey-vote-card,
.survey-results-card {
  padding: 16px;
}

.survey-status-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.survey-vote-form {
  display: grid;
  gap: 14px;
}

.survey-choice-list {
  display: grid;
  gap: 10px;
}

.survey-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: var(--ui-ink);
  font-weight: 700;
}

.survey-choice input {
  width: 18px;
  height: 18px;
  accent-color: #149a7a;
}

.survey-result-list {
  display: grid;
  gap: 14px;
}

.survey-result-row {
  display: grid;
  gap: 7px;
}

.survey-result-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ui-ink);
  font-size: 0.86rem;
}

.survey-result-row strong {
  color: var(--ui-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.survey-result-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.survey-result-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #149a7a;
}

@media (max-width: 900px) {
  .survey-vote-grid {
    grid-template-columns: 1fr;
  }

  .role-permission-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .survey-option-row,
  .role-card-head {
    grid-template-columns: 1fr;
  }

  .role-card-head {
    display: grid;
  }
}

/* Resident directory, favorites and access detail redesign */
.favorite-view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  overflow: hidden;
  width: fit-content;
}

.favorite-view-toggle .toggle-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ui-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  transition: all 0.2s ease;
}

.favorite-view-toggle .toggle-btn:hover {
  color: var(--ui-ink);
  background: rgba(0,0,0,0.03);
}

.favorite-view-toggle .toggle-btn.active {
  color: #ffffff;
  background: var(--ui-teal);
}

.payment-year-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.year-chip {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ui-muted);
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.year-chip:hover {
  color: var(--ui-ink);
  border-color: var(--ui-teal);
}

.year-chip.active {
  color: #ffffff;
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

.resident-service-grid,
.favorite-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.resident-search-filter {
  align-items: end;
}

.resident-service-card,
.favorite-card,
.access-token-card,
.access-info-card,
.pin-confirm-card,
.receipt-preview-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: var(--ui-shadow-soft);
}

.resident-service-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-left: 5px solid #149a7a;
}

.resident-service-main h2,
.favorite-main h2,
.access-info-card h2 {
  margin: 3px 0 5px;
  color: var(--ui-ink);
  font-size: 1rem;
}

.resident-service-main p,
.favorite-main p {
  margin: 0;
  color: var(--ui-muted);
}

.resident-service-main blockquote {
  margin: 10px 0;
  padding-left: 10px;
  border-left: 3px solid #d8ebe7;
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.resident-service-main small {
  display: block;
  color: var(--ui-muted);
  font-size: 0.78rem;
}

.resident-service-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.resident-service-actions a,
.resident-service-actions button,
.favorite-actions a,
.favorite-actions button {
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.84rem;
}

.resident-service-actions button.is-active {
  background: #d97706;
}

.muted-action {
  background: #f1f5f9;
  color: var(--ui-muted);
}

.favorite-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border-left: 5px solid #149a7a;
}

.favorite-card.is-disabled {
  border-left-color: #dc2626;
  background: #fff8f8;
}

.favorite-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #08222e;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}

.favorite-main span {
  display: inline-flex;
  margin-top: 6px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
}

.favorite-card.is-disabled .favorite-main span {
  color: #dc2626;
}

.favorite-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-capture-card,
.favorite-capture-card,
.payment-edit-card {
  max-width: 980px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.access-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.access-token-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px;
}

.access-token-card img {
  width: min(100%, 320px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--ui-line);
  background: #fff;
}

.qr-welcome-card {
  margin-bottom: 16px;
}

.pin-display,
.pin-confirm-card > strong {
  color: #08222e;
  font-size: clamp(2rem, 8vw, 4rem);
  letter-spacing: 0.12em;
  line-height: 1;
}

.access-info-card,
.pin-confirm-card {
  padding: 16px;
}

.detail-grid-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.detail-grid-list div {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.detail-grid-list dt {
  color: var(--ui-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid-list dd {
  margin: 3px 0 0;
  color: var(--ui-ink);
  font-weight: 800;
}

.pin-confirm-card {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.receipt-preview-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
}

.receipt-preview-card img {
  width: min(100%, 340px);
  border-radius: 8px;
  border: 1px solid var(--ui-line);
}

.chip-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.access-share-card {
  background: var(--ui-surface, #fff);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  padding: 20px;
}

.access-bottom-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 0;
}

.access-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface, #fff);
  color: var(--ui-ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  text-decoration: none;
  text-align: center;
}

.access-action-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.access-action-btn:hover,
.access-action-btn:focus-visible {
  border-color: var(--primary);
  background: var(--primary-ghost, rgba(139, 92, 246, 0.06));
}

.access-action-btn.danger {
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
}

.access-action-btn.danger:hover,
.access-action-btn.danger:focus-visible {
  background: var(--danger-ghost, rgba(220, 38, 38, 0.06));
  border-color: var(--danger, #dc2626);
}

.access-disable-form {
  display: contents;
}

.access-volver-link {
  color: var(--primary);
}

.btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.btn-grid a,
.btn-grid button,
.btn-grid .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface, #fff);
  color: var(--ui-ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  text-decoration: none;
  text-align: center;
}

.btn-grid a:hover,
.btn-grid a:focus-visible,
.btn-grid button:hover,
.btn-grid button:focus-visible,
.btn-grid .button-link:hover,
.btn-grid .button-link:focus-visible {
  border-color: var(--primary);
  background: var(--primary-ghost, rgba(139, 92, 246, 0.06));
}

.btn-grid .danger,
.btn-grid button.danger {
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
}

.btn-grid .danger:hover,
.btn-grid .danger:focus-visible,
.btn-grid button.danger:hover,
.btn-grid button.danger:focus-visible {
  background: var(--danger-ghost, rgba(220, 38, 38, 0.06));
  border-color: var(--danger, #dc2626);
}

.btn-grid .secondary-button,
.btn-grid .button-link.secondary {
  border-color: var(--ui-line);
  color: var(--ui-text-soft);
}

.btn-grid .secondary-button:hover,
.btn-grid .secondary-button:focus-visible,
.btn-grid .button-link.secondary:hover,
.btn-grid .button-link.secondary:focus-visible {
  border-color: var(--primary);
  background: var(--primary-ghost, rgba(139, 92, 246, 0.06));
}

.btn-grid .action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface, #fff);
  color: var(--ui-ink);
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}

.btn-grid .action-icon:hover,
.btn-grid .action-icon:focus-visible {
  border-color: var(--primary);
  background: var(--primary-ghost, rgba(139, 92, 246, 0.06));
}

.btn-grid .action-icon.danger {
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
}

.btn-grid .action-icon.danger:hover,
.btn-grid .action-icon.danger:focus-visible {
  background: var(--danger-ghost, rgba(220, 38, 38, 0.06));
  border-color: var(--danger, #dc2626);
}

.access-volver-link:hover {
  background: var(--primary-ghost, rgba(139, 92, 246, 0.08));
}

@media (max-width: 900px) {
  .access-detail-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .favorite-card,
  .detail-grid-list {
    grid-template-columns: 1fr;
  }

  .favorite-actions {
    justify-content: flex-start;
  }
}

/* Import, reports and analysis boards redesign */
.import-workspace,
.service-report-workspace,
.payment-board-workspace,
.payment-history-workspace {
  display: grid;
  gap: 18px;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.import-schema-card,
.import-upload-card,
.import-summary-grid article,
.import-error-card,
.service-report-card,
.audit-card,
.payment-board-row,
.survey-result-summary article {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: var(--ui-shadow-soft);
}

.import-schema-card,
.import-upload-card,
.import-error-card,
.service-report-card,
.audit-card,
.payment-board-row {
  padding: 16px;
}

.import-upload-card {
  display: grid;
  gap: 12px;
}

.import-upload-card h2,
.import-error-card h2,
.service-report-card h2,
.payment-board-resident h2 {
  margin: 3px 0 6px;
  color: var(--ui-ink);
  font-size: 1rem;
}

.import-upload-card p,
.service-report-card p,
.audit-card p,
.payment-board-resident p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.schema-list {
  display: grid;
  gap: 8px;
}

.schema-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.schema-list strong {
  color: var(--ui-ink);
}

.schema-list span {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
}

.schema-list em {
  grid-column: 1 / -1;
  color: var(--ui-muted);
  font-style: normal;
  font-size: 0.8rem;
}

.import-summary-grid,
.survey-result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.import-summary-grid article,
.survey-result-summary article {
  padding: 14px;
}

.import-summary-grid span,
.survey-result-summary span {
  display: block;
  color: var(--ui-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  font-weight: 800;
}

.import-summary-grid strong,
.survey-result-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ui-ink);
  font-size: 1.6rem;
}

.import-summary-grid article.success strong,
.success-empty {
  color: #0f766e;
}

.import-summary-grid article.warning strong {
  color: #d97706;
}

.import-error-grid,
.service-report-list,
.audit-timeline,
.payment-board-list {
  display: grid;
  gap: 12px;
}

.import-error-card {
  border-left: 5px solid #dc2626;
}

.import-error-card p {
  margin: 8px 0 0;
  color: #991b1b;
}

.admin-results {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--ui-shadow-soft);
}

.service-report-card {
  display: grid;
  gap: 10px;
  border-left: 5px solid #dc2626;
}

.audit-card {
  display: grid;
  gap: 10px;
  border-left: 5px solid #2563eb;
}

.audit-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-card small {
  color: var(--ui-muted);
  font-weight: 800;
}

.payment-board-filter {
  align-items: end;
}

.payment-board-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.payment-board-resident {
  display: grid;
  align-content: center;
  border-right: 1px solid var(--ui-line);
  padding-right: 12px;
}

.payment-board-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  gap: 8px;
}

@media (max-width: 960px) {
  .import-grid,
  .payment-board-row {
    grid-template-columns: 1fr;
  }

  .payment-board-resident {
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
    padding: 0 0 12px;
  }
}

@media (max-width: 640px) {
  .payment-board-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Final detail forms redesign */
.payment-edit-grid,
.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.payment-admin-card,
.profile-password-card {
  max-width: none;
}

.pending-service-stack {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.pending-service-stack article {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.pending-service-stack strong {
  color: var(--ui-ink);
}

.pending-service-stack span {
  color: var(--ui-muted);
  font-size: 0.82rem;
}

.area-event-list {
  display: grid;
  gap: 12px;
}

.profile-grid .access-info-card {
  padding: 16px;
}

@media (max-width: 900px) {
  .payment-edit-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile module menu and resident priority actions */
.hamburger-button {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.hamburger-button .hamburger-icon {
  width: 22px;
  height: 22px;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
}

body.menu-locked {
  overflow: hidden;
}

.role-resident .resident-action-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.resident-action-card.delivery-priority {
  color: #ffffff;
  border-color: #0f766e;
  background: linear-gradient(135deg, #0f766e, #12343b);
}

.resident-action-card.delivery-priority small {
  color: rgba(255, 255, 255, 0.78);
}

.resident-action-card.delivery-priority span {
  background: rgba(255, 255, 255, 0.18);
}

.delivery-priority-panel {
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), #ffffff 42%);
}

.delivery-priority-panel .ops-panel-heading {
  border-bottom: 1px solid rgba(15, 118, 110, 0.16);
}

.resident-delivery-list-top .resident-delivery-card {
  border-left: 5px solid #0f766e;
}

.delivery-action-form {
  margin: 0;
  align-content: start;
  border-radius: var(--ui-radius);
}

.delivery-action-form label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
}

.delivery-action-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #0f172a;
  background: #ffffff;
  padding: 0 10px;
  font-weight: 800;
}

.delivery-action-form button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border-radius: 8px;
  color: #0f172a;
  background: #ffffff;
  font-weight: 900;
}

.resident-dashboard-secondary {
  grid-template-columns: minmax(0, 1fr);
}

.role-resident .delivery-action-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-height: 146px;
  padding: 16px;
}

.delivery-action-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.delivery-action-head span {
  margin: 0;
}

.delivery-action-head strong {
  margin: 0;
}

.delivery-action-head small {
  margin-top: 4px;
}

.delivery-action-controls {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
}

.delivery-action-form .delivery-action-controls select {
  flex: 1;
  min-height: 30px;
  margin: 0;
  font-size: 0.8rem;
}

.delivery-action-form .delivery-action-controls button {
  width: auto;
  min-width: 76px;
  min-height: 30px;
  margin: 0;
  padding: 0 10px;
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .role-resident .delivery-action-form {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .role-resident .delivery-action-form .delivery-action-head strong,
  .role-resident .delivery-action-form .delivery-action-head small {
    grid-column: auto;
  }

  .delivery-action-controls {
    grid-template-columns: 1fr;
  }

  .delivery-action-form .delivery-action-controls button {
    width: 100%;
  }
}

.resident-delivery-create-card {
  min-height: 146px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ui-ink);
}

.resident-delivery-create-card .delivery-action-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.resident-delivery-create-card strong {
  display: block;
  margin: 0;
  color: var(--ui-ink);
  font-size: 1rem;
  text-align: center;
}

.resident-delivery-create-card .delivery-action-controls {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.resident-delivery-create-card select {
  min-height: 30px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ui-ink);
  background: #f8fafc;
  font-weight: 800;
  font-size: 0.8rem;
}

.resident-delivery-create-card button {
  min-width: 76px;
  min-height: 30px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-weight: 900;
}

.resident-delivery-create-card .delivery-action-head > span svg {
  width: 26px;
  height: 26px;
}

.resident-delivery-create-card small {
  display: block;
  color: var(--ui-muted);
  font-size: 0.75rem;
}
}

@media (max-width: 700px) {
  .resident-delivery-create-card {
    min-height: 0;
  }
}

@media (max-width: 1180px) {
  body[class*="role-"] .app-shell {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  body[class*="role-"] .hamburger-button {
    display: flex;
    flex: 0 0 auto;
  }

  body[class*="role-"] .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    bottom: 0;
    z-index: 90 !important;
    width: min(86vw, 330px);
    height: 100vh !important;
    max-height: none !important;
    padding: 18px 14px;
    border-radius: 0;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  body[class*="role-"] .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  body[class*="role-"] .sidebar-brand {
    margin-bottom: 14px;
  }

  body[class*="role-"] .sidebar-user,
  body[class*="role-"] .nav-section {
    display: grid;
  }

  body[class*="role-"] .side-nav {
    display: grid !important;
    gap: 2px;
    overflow: visible;
    padding-bottom: 24px;
  }

  body[class*="role-"] .side-nav a {
    width: 100%;
    min-height: 38px;
  }

  body[class*="role-"] .main-area {
    min-height: 100vh;
  }

  body[class*="role-"] .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    gap: 12px;
    justify-content: flex-start;
    padding: 0 14px;
  }

  body[class*="role-"] .topbar > div {
    min-width: 0;
    flex: 1;
  }

  body[class*="role-"] .topbar form {
    margin-left: auto;
  }

  body[class*="role-"] .topbar form button {
    min-width: 0;
    padding-inline: 10px;
  }

  .role-resident .resident-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .role-resident .resident-action-card {
    min-height: 150px;
  }
}

@media (max-width: 700px) {
  .role-resident .resident-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .role-resident .resident-action-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 16px 12px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    -webkit-tap-highlight-color: transparent;
  }

  .role-resident .resident-action-card:active {
    transform: scale(0.96);
  }

  .role-resident .resident-action-card span {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.1);
    margin: 0;
  }

  .role-resident .resident-action-card span svg {
    width: 28px;
    height: 28px;
  }

  .role-resident .resident-action-card strong {
    margin-top: 0;
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .role-resident .resident-action-card small {
    display: none;
  }

  .role-resident .resident-action-card.primary {
    background: linear-gradient(145deg, rgba(15,118,110,0.5), rgba(15,118,110,0.25));
    border-color: rgba(15,118,110,0.3);
  }

  .role-resident .resident-action-card.dark {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
    border-color: rgba(255,255,255,0.12);
  }

  .role-resident .resident-delivery-create-card {
    flex: 0 0 130px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 16px 12px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
  }

  .role-resident .resident-delivery-create-card .delivery-action-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .role-resident .resident-delivery-create-card .delivery-action-head > span {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.1);
  }

  .role-resident .resident-delivery-create-card .delivery-action-head > span svg {
    width: 28px;
    height: 28px;
  }

  .role-resident .resident-delivery-create-card .delivery-action-head strong {
    font-size: 0.82rem;
  }

  .role-resident .resident-delivery-create-card .delivery-action-head small {
    display: none;
  }

  .role-resident .resident-delivery-create-card .delivery-action-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .role-resident .resident-delivery-create-card button {
    width: 100%;
    min-height: 36px;
    font-size: 0.82rem;
  }
}

/* Final responsive shell pass: desktop keeps the module rail, mobile uses a drawer. */
@media (min-width: 981px) {
  body[class*="role-"] .app-shell {
    display: grid !important;
    grid-template-columns: 280px minmax(0, 1fr) !important;
    min-height: 100vh !important;
    padding: 0 !important;
  }

  body[class*="role-"] .sidebar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 20 !important;
    width: auto !important;
    height: 100vh !important;
    max-height: none !important;
    transform: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body[class*="role-"] .hamburger-button,
  body[class*="role-"] .nav-scrim {
    display: none !important;
  }

  body[class*="role-"] .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-width: 0;
  }
}

body[class*="role-"] .main-area,
body[class*="role-"] .page {
  min-width: 0;
}

.role-resident .resident-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 980px) {
  body[class*="role-"] .app-shell {
    display: block !important;
    min-height: 100vh;
    padding: 0;
  }

  body[class*="role-"] .hamburger-button {
    display: grid !important;
    flex: 0 0 42px;
  }

  body[class*="role-"] .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 90 !important;
    width: min(86vw, 330px) !important;
    height: 100dvh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 18px 14px !important;
    border-radius: 0 !important;
    transform: translateX(-104%) !important;
    transition: transform 0.22s ease;
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.25) !important;
  }

  body[class*="role-"] .app-shell.menu-open .sidebar {
    transform: translateX(0) !important;
  }

  body[class*="role-"] .sidebar-brand {
    margin-bottom: 14px;
  }

  body[class*="role-"] .sidebar-user,
  body[class*="role-"] .nav-section {
    display: grid !important;
  }

  body[class*="role-"] .side-nav {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: 1fr !important;
    gap: 2px !important;
    overflow: visible !important;
    padding-bottom: 24px;
  }

  body[class*="role-"] .side-nav a {
    width: 100% !important;
    min-height: 38px;
    justify-content: flex-start;
  }

  body[class*="role-"] .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 0 12px;
  }

  body[class*="role-"] .topbar > div {
    min-width: 0;
  }

  body[class*="role-"] .topbar strong,
  body[class*="role-"] .topbar .eyebrow {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[class*="role-"] .topbar form {
    margin-left: 0;
  }

  body[class*="role-"] .topbar form button {
    min-width: 0;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .role-resident .resident-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .role-resident .resident-action-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  body[class*="role-"] .page {
    padding-inline: 14px;
  }

  body[class*="role-"] .topbar {
    min-height: 62px;
  }

  body[class*="role-"] .topbar form button {
    font-size: 0;
  }

  body[class*="role-"] .topbar form button::after {
    content: "Salir";
    font-size: 0.82rem;
  }
}

/* Admin payment edit polish */
.admin-payment-edit-workspace {
  max-width: 1380px;
  margin-inline: auto;
}

.admin-payment-edit-workspace .ops-hero {
  align-items: center;
  padding: 28px 32px;
}

.admin-payment-edit-workspace .ops-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.admin-payment-edit-workspace .payment-edit-grid {
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.05fr) minmax(360px, 1fr);
  gap: 22px;
}

.admin-payment-edit-workspace .access-info-card,
.admin-payment-form-card {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--ui-shadow-sm);
}

.admin-payment-edit-workspace .access-info-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.admin-payment-edit-workspace .resident-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-payment-edit-workspace .resident-panel-heading h2 {
  margin: 4px 0 0;
  color: var(--ui-ink);
  font-size: 1.25rem;
}

.admin-receipt-panel {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(20, 154, 122, 0.32);
  border-radius: 8px;
  background: #eefbf7;
}

.admin-receipt-panel strong {
  color: var(--ui-ink);
  font-size: 1.02rem;
}

.admin-receipt-panel p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.86rem;
}

.admin-receipt-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  margin-top: 4px;
  border-radius: 999px;
  padding: 0 16px;
  color: #ffffff;
  background: #0f766e;
  font-weight: 900;
}

.admin-receipt-panel.is-empty {
  border-color: var(--ui-line);
  background: #f8fafc;
}

.admin-receipt-view {
  position: sticky;
  top: 88px;
  align-self: start;
  display: grid;
  grid-template-rows: auto minmax(420px, calc(100vh - 220px));
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--ui-shadow-sm);
}

.admin-receipt-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--ui-line);
  background: #f8fafc;
}

.admin-receipt-view-head h2 {
  margin: 3px 0;
  color: var(--ui-ink);
  font-size: 1.05rem;
}

.admin-receipt-view-head p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.admin-receipt-view-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  color: #ffffff;
  background: #0f766e;
  font-weight: 900;
}

.admin-receipt-frame {
  min-height: 0;
  overflow: auto;
  background: #e5e7eb;
}

.admin-receipt-frame img {
  display: block;
  width: 100%;
  min-height: 100%;
  object-fit: contain;
  background: #f8fafc;
}

.admin-receipt-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #ffffff;
}

.admin-receipt-empty {
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  color: var(--ui-muted);
}

.admin-receipt-empty strong {
  color: var(--ui-ink);
  font-size: 1.05rem;
}

.admin-receipt-empty p {
  margin: 0;
}

.admin-payment-form-card {
  display: grid;
  overflow: hidden;
}

.admin-payment-section {
  display: grid;
  gap: 18px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--ui-line);
}

.admin-payment-section header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-payment-section header > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  color: #526174;
  background: #f8fafc;
  font-weight: 900;
}

.admin-payment-section h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 1.18rem;
  line-height: 1.2;
}

.admin-payment-section p {
  margin: 4px 0 0;
  color: var(--ui-muted);
  font-size: 0.88rem;
}

.payment-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.payment-type-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 56px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ui-ink);
  font-weight: 850;
}

.payment-type-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #149a7a;
}

.payment-type-option:has(input:checked) {
  border-color: rgba(20, 154, 122, 0.45);
  background: #eefbf7;
}

.payment-type-suggested {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 10px;
}

.catalog-amount {
  font-weight: 700;
  color: #0f766e;
}

.admin-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-payment-fields label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #526174;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-payment-fields input,
.admin-payment-fields select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ui-ink);
  background: #ffffff;
  font: inherit;
  font-weight: 750;
  text-transform: none;
}

.admin-payment-notes {
  grid-column: 1 / -1;
}

.admin-payment-form-card .form-command-bar {
  justify-content: flex-end;
  padding: 20px 26px;
  border-top: 0;
  background: #f8fafc;
}

.admin-payment-form-card .form-command-bar button,
.admin-payment-form-card .form-command-bar .button-link {
  min-width: 150px;
  min-height: 46px;
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .admin-payment-edit-workspace .payment-edit-grid {
    grid-template-columns: 1fr;
  }

  .admin-receipt-view {
    position: static;
    grid-template-rows: auto minmax(360px, 56vh);
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .admin-payment-edit-workspace .ops-hero {
    align-items: flex-start;
    padding: 22px;
  }

  .admin-payment-section,
  .admin-payment-form-card .form-command-bar {
    padding: 18px;
  }

  .admin-payment-section header,
  .admin-payment-fields {
    grid-template-columns: 1fr;
  }

  .admin-payment-form-card .form-command-bar {
    display: grid;
  }

  .admin-payment-form-card .form-command-bar button,
  .admin-payment-form-card .form-command-bar .button-link {
    width: 100%;
  }
}

/* Shared stepped forms: fixes legacy capture-section layouts across modules. */
.catalog-form-workspace,
.service-form-workspace,
.role-form-workspace,
.survey-form-workspace,
.resident-form-workspace {
  max-width: 1120px;
  margin-inline: auto;
}

.capture-card:has(.capture-section) {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  overflow: hidden;
}

.compact-capture-card:has(.capture-section) {
  max-width: 860px;
}

.capture-section {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 22px;
  border-bottom: 1px solid var(--ui-line);
}

.capture-section:last-of-type {
  border-bottom: 0;
}

.capture-index {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  color: #526174;
  background: #f8fafc;
  font-weight: 900;
}

.capture-section h2 {
  margin: 0 0 16px;
  color: var(--ui-ink);
  font-size: 1.18rem;
  line-height: 1.2;
}

.capture-section label:not(.checkbox-label):not(.setting-toggle):not(.payment-type-option):not(.switch-control) {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: #526174;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.capture-section input:not([type="checkbox"]):not([type="radio"]),
.capture-section select,
.capture-section textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ui-ink);
  background: #ffffff;
  font: inherit;
  font-weight: 750;
  text-transform: none;
}

.capture-section textarea {
  min-height: 108px;
  padding-block: 12px;
  resize: vertical;
}

.capture-section .form-grid,
.capture-section .capture-grid {
  align-items: start;
}

.capture-card:has(.capture-section) .form-command-bar {
  padding: 18px 22px;
  border-top: 1px solid var(--ui-line);
  background: #f8fafc;
}

.capture-card:has(.capture-section) .form-command-bar button,
.capture-card:has(.capture-section) .form-command-bar .button-link {
  min-width: 150px;
  min-height: 44px;
  border-radius: 999px;
}

.badge-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-label.catalog-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 42px;
  margin: 0;
  padding: 0;
  color: var(--ui-ink);
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: none;
}

.checkbox-label.catalog-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #149a7a;
}

@media (max-width: 760px) {
  .capture-section {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .capture-index {
    width: 40px;
    height: 40px;
  }

  .capture-card:has(.capture-section) .form-command-bar {
    display: grid;
    padding: 18px;
  }

  .capture-card:has(.capture-section) .form-command-bar button,
  .capture-card:has(.capture-section) .form-command-bar .button-link {
    width: 100%;
  }
}

/* Payment review layout refinement: form and context stay readable, receipt stays beside them. */
@media (min-width: 1181px) {
  .admin-payment-edit-workspace {
    max-width: 1480px;
  }

  .admin-payment-edit-workspace .payment-edit-grid {
    display: grid;
    grid-template-columns: minmax(620px, 1fr) minmax(420px, 0.72fr);
    grid-template-areas:
      "context receipt"
      "form receipt";
    align-items: start;
  }

  .admin-payment-edit-workspace .access-info-card {
    grid-area: context;
    min-width: 0;
  }

  .admin-payment-edit-workspace .admin-payment-form-card {
    grid-area: form;
    min-width: 0;
  }

  .admin-payment-edit-workspace .admin-receipt-view {
    grid-area: receipt;
    min-width: 0;
  }

  .admin-payment-edit-workspace .resident-panel-heading {
    align-items: center;
    flex-wrap: wrap;
  }

  .admin-payment-edit-workspace .resident-panel-heading h2 {
    font-size: 1.7rem;
    line-height: 1.05;
  }

  .admin-payment-edit-workspace .resident-panel-heading .payment-badge {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .admin-payment-edit-workspace .detail-grid-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-payment-edit-workspace .pending-service-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-payment-edit-workspace .pending-service-stack .ops-kicker {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1500px) and (min-width: 1181px) {
  .admin-payment-edit-workspace .payment-edit-grid {
    grid-template-columns: minmax(560px, 1fr) minmax(380px, 0.68fr);
  }

  .admin-payment-edit-workspace .pending-service-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .admin-payment-edit-workspace .resident-panel-heading {
    display: grid;
  }

  .admin-payment-edit-workspace .resident-panel-heading .payment-badge {
    justify-self: start;
  }
}

/* Admin payments table */
.payments-table-workspace {
  max-width: 1480px;
  margin-inline: auto;
}

.admin-payments-table-card {
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--ui-shadow-sm);
}

.admin-payments-table-scroll {
  overflow-x: auto;
}

.admin-payments-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.admin-payments-table th,
.admin-payments-table td {
  border-bottom: 1px solid var(--ui-line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.admin-payments-table th {
  color: #526174;
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-payments-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-payments-table tbody tr.needs-assignment {
  background: #fffdf5;
}

.admin-payments-table td > strong {
  display: block;
  color: var(--ui-ink);
  font-weight: 900;
}

.admin-payments-table td > span {
  display: block;
  margin-top: 4px;
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.payment-service-list {
  display: grid;
  gap: 6px;
}

.payment-service-list span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 10px;
  color: #526174;
  background: #f8fafc;
  font-size: 0.82rem;
}

.payment-service-list b {
  color: var(--ui-ink);
}

.payment-missing,
.approval-warning {
  color: #b45309 !important;
  font-weight: 900;
}

.approval-warning {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.table-link {
  color: #0f766e;
  font-weight: 900;
}

.payment-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 132px;
}

.payment-row-actions form {
  margin: 0;
}

.payment-row-actions a,
.payment-row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  color: #0f172a;
  background: #ffffff;
  font-weight: 900;
}

.payment-row-actions button {
  color: #ffffff;
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.payment-row-actions button.danger {
  border-color: #b91c1c;
  background: #b91c1c;
}

.payment-row-actions .needs-edit {
  color: #ffffff;
  border-color: #b45309;
  background: #b45309;
}

@media (max-width: 900px) {
  .admin-payments-table,
  .admin-payments-table thead,
  .admin-payments-table tbody,
  .admin-payments-table th,
  .admin-payments-table td,
  .admin-payments-table tr {
    display: block;
    min-width: 0;
  }

  .admin-payments-table thead {
    display: none;
  }

  .admin-payments-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
    background: #eef2f7;
  }

  .admin-payments-table tr {
    overflow: hidden;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    background: #ffffff;
  }

  .admin-payments-table td {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--ui-line);
    padding: 12px;
  }

  .admin-payments-table td::before {
    content: attr(data-label);
    color: #526174;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .payment-row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .admin-payments-table td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .payment-row-actions {
    grid-template-columns: 1fr;
  }
}

/* Bulk payment review controls */
.admin-payments-bulk-form {
  display: grid;
  gap: 12px;
}

.bulk-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--ui-shadow-sm);
}

.bulk-command-bar.bottom {
  position: sticky;
  bottom: 12px;
  z-index: 10;
}

.bulk-command-bar strong {
  display: block;
  color: var(--ui-ink);
  font-weight: 900;
}

.bulk-command-bar span {
  display: block;
  margin-top: 3px;
  color: var(--ui-muted);
  font-size: 0.84rem;
}

.bulk-command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.bulk-command-actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: #0f766e;
  font-weight: 900;
}

.bulk-command-actions button[value="save"] {
  color: #0f172a;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.bulk-edit-table {
  min-width: 1280px;
}

.bulk-edit-table th:first-child,
.bulk-edit-table td:first-child {
  width: 76px;
}

.payment-select-box {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0;
  color: #526174;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-select-box input {
  width: 20px;
  height: 20px;
  accent-color: #0f766e;
}

.bulk-service-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 7px;
  min-width: 300px;
}

.bulk-service-options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin: 0;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #f8fafc;
  color: var(--ui-ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.bulk-service-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #0f766e;
}

.bulk-service-options label:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.35);
  background: #eefbf7;
}

.table-control {
  width: 100%;
  min-width: 112px;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ui-ink);
  background: #ffffff;
  font-weight: 800;
}

.year-control,
.amount-control {
  min-width: 96px;
}

.admin-payments-table td small {
  display: block;
  margin-top: 5px;
  color: var(--ui-muted);
  font-size: 0.76rem;
}

@media (max-width: 900px) {
  .bulk-command-bar {
    align-items: stretch;
    display: grid;
  }

  .bulk-command-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bulk-edit-table {
    min-width: 0;
  }

  .bulk-service-options {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .bulk-command-actions {
    grid-template-columns: 1fr;
  }

  .bulk-command-bar.bottom {
    bottom: 8px;
  }
}

/* Compact desktop bulk table: everything stays visible without horizontal work. */
@media (min-width: 901px) {
  .payments-table-workspace {
    max-width: none;
  }

  .admin-payments-table-scroll {
    overflow-x: visible;
  }

  .bulk-edit-table {
    min-width: 0;
    table-layout: fixed;
  }

  .bulk-edit-table th,
  .bulk-edit-table td {
    padding: 9px 7px;
  }

  .bulk-edit-table th:first-child,
  .bulk-edit-table td:first-child {
    width: 58px;
  }

  .bulk-edit-table th:nth-child(2),
  .bulk-edit-table td:nth-child(2) {
    width: 17%;
  }

  .bulk-edit-table th:nth-child(3),
  .bulk-edit-table td:nth-child(3) {
    width: 30%;
  }

  .bulk-edit-table th:nth-child(4),
  .bulk-edit-table td:nth-child(4) {
    width: 15%;
  }

  .bulk-edit-table th:nth-child(5),
  .bulk-edit-table td:nth-child(5) {
    width: 8%;
  }

  .bulk-edit-table th:nth-child(6),
  .bulk-edit-table td:nth-child(6) {
    width: 13%;
  }

  .bulk-edit-table th:nth-child(7),
  .bulk-edit-table td:nth-child(7) {
    width: 11%;
  }

  .bulk-service-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
  }

  .bulk-service-options label {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 4px;
    min-height: 32px;
    padding: 5px 6px;
    font-size: 0.66rem;
    line-height: 1.05;
  }

  .period-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 5px;
  }

  .table-control {
    min-width: 0;
    min-height: 34px;
    padding: 0 7px;
    font-size: 0.78rem;
  }

  .year-control,
  .amount-control {
    min-width: 0;
  }

  .payment-row-actions {
    min-width: 0;
    gap: 5px;
  }

  .payment-row-actions.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .payment-row-actions a,
  .payment-row-actions button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 0.72rem;
  }

  .admin-payments-table td > strong {
    font-size: 0.86rem;
  }

  .admin-payments-table td > span,
  .admin-payments-table td small {
    font-size: 0.72rem;
  }
}

.payment-select-all {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  color: #526174;
  font-size: 0.68rem;
  font-weight: 900;
}

.payment-select-all input {
  width: 18px;
  height: 18px;
  accent-color: #0f766e;
}

.payment-select-box {
  place-items: center;
}

.payment-select-box input {
  margin: 0;
}

.payment-row-actions.compact {
  grid-template-columns: repeat(4, 34px);
  justify-content: end;
}

.payment-row-actions .action-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: none;
  border-radius: 8px;
  padding: 0;
  margin: 0;
  color: #0f172a;
  background: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
}

.payment-row-actions .action-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.payment-row-actions .action-icon:hover {
  background: #f1f5f9;
}

.payment-row-actions .action-icon.receipt-action {
  color: #0f766e;
}

.payment-row-actions .action-icon.danger {
  color: #ffffff;
  border-color: #b91c1c;
  background: #b91c1c;
}

.payment-row-actions .action-icon.danger:hover {
  background: #991b1b;
}

.payment-row-actions .action-icon.disabled {
  color: #94a3b8;
  background: #f8fafc;
  cursor: default;
}
