:root {
  color-scheme: light;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: #172026;
  background: #f4f6f8;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(126, 34, 206, 0.08), transparent 34rem),
    #f4f6f8;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #d9e0e6;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

h1, h2 {
  margin: 0;
}

h1 {
  color: #172026;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 .brand-link,
h1 .brand-link:visited,
h1 .brand-link:active,
h1 .brand-link:focus {
  color: #7e22ce;
  text-decoration: none;
}

h1 .brand-link:hover {
  color: #5b21b6;
}

.page-separator {
  color: #94a3b8;
  font-weight: 650;
  margin: 0 10px;
}

.page-title {
  color: #172026;
}

h1::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 28px;
  margin-right: 12px;
  border-radius: 999px;
  background: #7e22ce;
  vertical-align: -6px;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 750;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

a {
  color: #0b684c;
  text-decoration: none;
}

header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d9e0e6;
  border-radius: 6px;
  background: #ffffff;
  color: #344451;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

header nav a:hover {
  border-color: #7e22ce;
  color: #7e22ce;
  background: #faf5ff;
}

header nav a[href="logout.php"] {
  border-color: #f1c5c5;
  color: #9f1d1d;
}

main {
  display: grid;
  gap: 24px;
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

section, .login-box {
  background: #ffffff;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #e6ebef;
  text-align: left;
}

th {
  color: #50616d;
  font-size: 13px;
  text-transform: uppercase;
}

input, textarea, button {
  font: inherit;
}

input:not(.form-control), textarea:not(.form-control) {
  border: 1px solid #c8d2da;
  border-radius: 6px;
  padding: 10px 12px;
}

button:not(.btn):not(.btn-close):not(.swal2-confirm):not(.swal2-cancel):not(.swal2-deny) {
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: #0b684c;
  color: #ffffff;
  cursor: pointer;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

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

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-box {
  width: min(420px, calc(100vw - 32px));
}

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

.login-box label {
  display: grid;
  gap: 6px;
}

.error {
  color: #a32929;
}

.qr-page {
  grid-template-columns: 380px minmax(260px, 1fr);
  align-items: start;
}

.qr-page #qr {
  background: #ffffff;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  padding: 10px;
  width: 360px;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.qr-page #qr img,
.qr-page #qr canvas {
  display: block;
}

.qr-page textarea {
  min-height: 360px;
  resize: vertical;
  width: 100%;
}

.qr-details {
  display: grid;
  gap: 10px;
}

.qr-details p {
  margin: 0;
  color: #50616d;
  word-break: break-all;
}

.table-icon {
  display: inline-block;
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d9e0e6;
}

.table-icon-empty {
  background: #f4f6f8;
}

.btn {
  border-radius: 6px;
  font-weight: 650;
}

.branding-preview {
  max-width: 220px;
  max-height: 90px;
  object-fit: contain;
  border: 1px solid #d9e0e6;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.background-preview {
  max-width: 260px;
  max-height: 150px;
  object-fit: cover;
}

@media (max-width: 800px) {
  header, nav {
    align-items: flex-start;
    flex-direction: column;
  }

  header {
    position: static;
  }

  .toolbar, .qr-page {
    grid-template-columns: 1fr;
  }
}
