* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.card {
  width: 100%;
  max-width: 520px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.card.wide {
  max-width: 100%;
  margin-top: 25px;
}

h1, h2 {
  margin-top: 0;
}

p {
  color: #cbd5e1;
}

ul {
  line-height: 1.9;
}

.badge {
  display: inline-block;
  background: #facc15;
  color: #111827;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: bold;
  margin: 10px 0;
}

a.button,
button {
  display: inline-block;
  background: #facc15;
  color: #111827;
  border: 0;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  margin-top: 10px;
}

a.secondary {
  background: #334155;
  color: #e5e7eb;
  margin-left: 8px;
}

label {
  display: block;
  margin-top: 15px;
  margin-bottom: 6px;
  color: #cbd5e1;
}

input {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
}

.alert {
  background: #7f1d1d;
  color: #fecaca;
  padding: 12px;
  border-radius: 10px;
  margin: 12px 0;
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  color: #93c5fd;
}

.topbar {
  height: 64px;
  background: #020617;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.logout {
  margin: 0;
  padding: 8px 12px;
  background: #334155;
  color: #fff;
}

.dashboard {
  padding: 30px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.stat {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 22px;
}

.stat span {
  display: block;
  color: #94a3b8;
  margin-bottom: 10px;
}

.stat strong {
  font-size: 22px;
}

pre {
  white-space: pre-wrap;
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 15px;
  color: #d1d5db;
}

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

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover {
  color: #facc15;
}

select {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  overflow: hidden;
}

th, td {
  border-bottom: 1px solid #1f2937;
  padding: 12px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  color: #facc15;
  background: #020617;
}

.pill {
  display: inline-block;
  background: #1e293b;
  color: #e5e7eb;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button.small {
  padding: 7px 10px;
  font-size: 12px;
  margin-top: 0;
}

.note {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  margin-top: 18px;
  color: #cbd5e1;
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover {
  color: #facc15;
}

select {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  border-bottom: 1px solid #1f2937;
  padding: 12px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  color: #facc15;
  background: #020617;
}

.pill {
  display: inline-block;
  background: #1e293b;
  color: #e5e7eb;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button.small {
  padding: 7px 10px;
  font-size: 12px;
  margin-top: 0;
}

.note {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  margin-top: 18px;
  color: #cbd5e1;
}

.checkbox-box {
  background: #020617;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
}

.check-label {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.check-label input {
  width: auto;
}

.muted {
  color: #94a3b8;
  font-size: 13px;
}

button.danger {
  background: #7f1d1d;
  color: #fecaca;
}

/* ================================
   AccessMate Mobile UI Upgrade
   Bigger touch-friendly mobile view
================================ */

@media (max-width: 768px) {
  body {
    font-size: 18px;
    overflow-x: hidden;
  }

  .topbar {
    height: auto;
    min-height: 72px;
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar strong {
    font-size: 20px;
    width: 100%;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    gap: 10px;
    padding-bottom: 6px;
  }

  .nav a {
    font-size: 16px;
    background: #111827;
    border: 1px solid #334155;
    padding: 10px 14px;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  .logout {
    width: 100%;
    font-size: 17px;
    padding: 14px;
  }

  .dashboard {
    padding: 18px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.2;
  }

  h2 {
    font-size: 24px;
  }

  p,
  label,
  .note,
  td,
  th {
    font-size: 17px;
  }

  .card {
    max-width: 100%;
    padding: 22px;
    border-radius: 18px;
  }

  .card.wide {
    padding: 22px;
    margin-top: 20px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stat {
    padding: 22px;
  }

  .stat span {
    font-size: 17px;
  }

  .stat strong {
    font-size: 25px;
  }

  input,
  select {
    font-size: 18px;
    padding: 17px;
    min-height: 58px;
    border-radius: 14px;
  }

  label {
    margin-top: 20px;
    margin-bottom: 8px;
  }

  button,
  a.button {
    font-size: 18px;
    padding: 16px 20px;
    min-height: 56px;
    border-radius: 14px;
  }

  button.small {
    font-size: 16px;
    padding: 13px 15px;
    min-height: 48px;
  }

  .actions {
    flex-direction: column;
    gap: 10px;
  }

  .actions form,
  .actions button {
    width: 100%;
  }

  .pill {
    font-size: 15px;
    padding: 7px 12px;
  }

  .checkbox-box {
    padding: 18px;
  }

  .check-label {
    font-size: 17px;
    align-items: flex-start;
    gap: 14px;
    line-height: 1.4;
  }

  .check-label input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: 14px;
  }

  th,
  td {
    padding: 15px;
  }

  pre {
    font-size: 15px;
    line-height: 1.5;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .dashboard {
    padding: 14px;
  }

  .card,
  .card.wide {
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 23px;
  }

  input,
  select,
  button,
  a.button {
    width: 100%;
  }

  .nav a {
    font-size: 15px;
    padding: 10px 12px;
  }
}

/* Mobile stacked menu */
@media (max-width: 768px) {
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 14px 16px;
    gap: 12px;
  }

  .topbar strong {
    width: 100%;
    font-size: 22px;
  }

  .nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    overflow: visible;
    white-space: normal;
  }

  .nav a {
    display: block;
    width: 100%;
    font-size: 17px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #111827;
    border: 1px solid #334155;
    color: #e5e7eb;
    text-align: left;
  }

  .nav a:hover {
    color: #facc15;
    border-color: #facc15;
  }

  .topbar form {
    width: 100%;
  }

  .logout {
    width: 100%;
    font-size: 17px;
    padding: 14px 16px;
    border-radius: 12px;
  }
}

/* ================================
   AccessMate Mobile Dropdown Menu
================================ */

.mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 14px 16px;
    gap: 12px;
  }

  .topbar strong {
    width: 100%;
    font-size: 22px;
  }

  .mobile-menu-btn {
    display: block;
    width: 100%;
    background: #facc15;
    color: #111827;
    border: 0;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 16px;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
  }

  .topbar .nav,
  .topbar form {
    display: none;
  }

  .topbar.menu-open .nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    overflow: visible;
    white-space: normal;
  }

  .topbar.menu-open .nav a {
    display: block;
    width: 100%;
    font-size: 17px;
    padding: 15px 16px;
    border-radius: 12px;
    background: #111827;
    border: 1px solid #334155;
    color: #e5e7eb;
    text-align: center;
  }

  .topbar.menu-open .nav a:hover {
    color: #facc15;
    border-color: #facc15;
  }

  .topbar.menu-open form {
    display: block;
    width: 100%;
  }

  .topbar.menu-open .logout {
    width: 100%;
    font-size: 17px;
    padding: 15px 16px;
    border-radius: 12px;
    background: #334155;
    color: #ffffff;
  }
}

/* ================================
   AccessMate Theme Switcher
================================ */

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-switcher label {
  margin: 0;
  font-size: 13px;
  color: inherit;
}

.theme-switcher select {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px;
}

/* Theme 1: White background, black text */
html[data-theme="light-black"] body {
  background: #ffffff;
  color: #111827;
}

html[data-theme="light-black"] .topbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
}

html[data-theme="light-black"] .dashboard,
html[data-theme="light-black"] .page {
  background: #ffffff;
  color: #111827;
}

html[data-theme="light-black"] .card,
html[data-theme="light-black"] .stat,
html[data-theme="light-black"] .note,
html[data-theme="light-black"] .checkbox-box {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: #111827;
}

html[data-theme="light-black"] p,
html[data-theme="light-black"] label,
html[data-theme="light-black"] .muted,
html[data-theme="light-black"] .stat span {
  color: #374151;
}

html[data-theme="light-black"] input,
html[data-theme="light-black"] select,
html[data-theme="light-black"] pre {
  background: #ffffff;
  color: #111827;
  border-color: #cbd5e1;
}

html[data-theme="light-black"] th {
  background: #e5e7eb;
  color: #111827;
}

html[data-theme="light-black"] td {
  color: #111827;
  border-bottom-color: #e5e7eb;
}

html[data-theme="light-black"] .nav a {
  color: #111827;
}

html[data-theme="light-black"] .nav a:hover {
  color: #ca8a04;
}

html[data-theme="light-black"] .pill {
  background: #e5e7eb;
  color: #111827;
}

/* Theme 2: Black background, yellow text */
html[data-theme="black-yellow"] body {
  background: #000000;
  color: #facc15;
}

html[data-theme="black-yellow"] .topbar {
  background: #000000;
  border-bottom: 1px solid #3f3f46;
  color: #facc15;
}

html[data-theme="black-yellow"] .dashboard,
html[data-theme="black-yellow"] .page {
  background: #000000;
  color: #facc15;
}

html[data-theme="black-yellow"] .card,
html[data-theme="black-yellow"] .stat,
html[data-theme="black-yellow"] .note,
html[data-theme="black-yellow"] .checkbox-box {
  background: #050505;
  border-color: #3f3f46;
  color: #facc15;
}

html[data-theme="black-yellow"] p,
html[data-theme="black-yellow"] label,
html[data-theme="black-yellow"] .muted,
html[data-theme="black-yellow"] .stat span,
html[data-theme="black-yellow"] td {
  color: #facc15;
}

html[data-theme="black-yellow"] input,
html[data-theme="black-yellow"] select,
html[data-theme="black-yellow"] pre {
  background: #000000;
  color: #facc15;
  border-color: #52525b;
}

html[data-theme="black-yellow"] th {
  background: #000000;
  color: #facc15;
}

html[data-theme="black-yellow"] .nav a {
  color: #facc15;
}

html[data-theme="black-yellow"] .nav a:hover {
  color: #ffffff;
}

html[data-theme="black-yellow"] .pill {
  background: #18181b;
  color: #facc15;
}

/* Theme 3: Black background, white text */
html[data-theme="black-white"] body {
  background: #000000;
  color: #ffffff;
}

html[data-theme="black-white"] .topbar {
  background: #000000;
  border-bottom: 1px solid #1f2937;
  color: #ffffff;
}

html[data-theme="black-white"] .dashboard,
html[data-theme="black-white"] .page {
  background: #000000;
  color: #ffffff;
}

html[data-theme="black-white"] .card,
html[data-theme="black-white"] .stat,
html[data-theme="black-white"] .note,
html[data-theme="black-white"] .checkbox-box {
  background: #050505;
  border-color: #1f2937;
  color: #ffffff;
}

html[data-theme="black-white"] p,
html[data-theme="black-white"] label,
html[data-theme="black-white"] .muted,
html[data-theme="black-white"] .stat span,
html[data-theme="black-white"] td {
  color: #e5e7eb;
}

html[data-theme="black-white"] input,
html[data-theme="black-white"] select,
html[data-theme="black-white"] pre {
  background: #000000;
  color: #ffffff;
  border-color: #334155;
}

html[data-theme="black-white"] th {
  background: #000000;
  color: #ffffff;
}

html[data-theme="black-white"] .nav a {
  color: #ffffff;
}

html[data-theme="black-white"] .nav a:hover {
  color: #facc15;
}

html[data-theme="black-white"] .pill {
  background: #111827;
  color: #ffffff;
}

/* Shared buttons */
html[data-theme="light-black"] button,
html[data-theme="light-black"] a.button,
html[data-theme="black-yellow"] button,
html[data-theme="black-yellow"] a.button,
html[data-theme="black-white"] button,
html[data-theme="black-white"] a.button {
  background: #facc15;
  color: #111827;
}

html[data-theme="light-black"] button.danger,
html[data-theme="black-yellow"] button.danger,
html[data-theme="black-white"] button.danger {
  background: #7f1d1d;
  color: #fecaca;
}

/* Mobile theme switcher */
@media (max-width: 768px) {
  .theme-switcher {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .theme-switcher label {
    font-size: 15px;
  }

  .theme-switcher select {
    width: 100%;
    font-size: 17px;
    min-height: 52px;
    padding: 14px;
  }
}
