﻿:root {
  --bg: #f6f8fc;
  --ink: #11121a;
  --muted: #4f5b6b;
  --line: #d9e1ef;
  --card: #fff;
  --accent: #f3d106;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.35;
  background:
    radial-gradient(1100px 520px at 0% -20%, rgba(243, 209, 6, 0.22), transparent 60%),
    linear-gradient(140deg, var(--bg), #eef4ff);
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

.app-shell {
  width: min(1120px, calc(100% - 20px));
  max-width: 100%;
  min-width: 0;
  margin: 14px auto 26px;
  display: grid;
  gap: 12px;
}

.panel {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 14px;
}

.header-panel {
  border-left: 8px solid var(--accent);
  min-height: 230px;
  display: flex;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.header-brand img {
  width: clamp(70px, 10vw, 96px);
  height: auto;
}

.brand-content {
  width: 100%;
  min-width: 0;
}

.header-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-topline .lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #dbe5f4;
  border-radius: 999px;
  background: #fff;
}

.header-topline .lang-picker span {
  font-weight: 800;
}

.header-topline .lang-picker select {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(0.92rem, 1.5vw, 1.15rem);
  line-height: 1.2;
}

h2 {
  font-size: 1.05rem;
}

.lang-picker {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: min(220px, 100%);
  color: var(--muted);
}

.group-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.as-link {
  border: 0;
  background: transparent;
  color: #0f4c8a;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-content {
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
}

#app-content .panel {
  border-color: #f1d56b;
  background:
    radial-gradient(640px 240px at 0% 0%, rgba(243, 209, 6, 0.22), transparent 65%),
    linear-gradient(150deg, #fffdf2, #ffffff 62%);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}

input,
select,
button {
  border-radius: 10px;
  font-size: 0.95rem;
}

input,
select {
  border: 1px solid #cfd8e8;
  padding: 10px 11px;
  width: 100%;
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

button {
  border: 0;
  padding: 10px 14px;
  background: linear-gradient(140deg, #17151a, #2a2631);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ref-banner {
  border: 1px solid #dce6f6;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(140deg, rgba(243, 209, 6, 0.2), rgba(255, 255, 255, 0.95));
  margin-bottom: 10px;
}

.mini-summary {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ref-link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ref-link-row input {
  flex: 1 1 340px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.qr-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.qr-wrap img {
  width: 188px;
  height: 188px;
  border: 1px solid #d8deea;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid #e4ebf7;
  padding: 10px 8px;
  text-align: left;
  font-size: 0.92rem;
  white-space: normal;
  word-break: break-word;
}

th {
  background: #f8fbff;
}

.error {
  color: #b91c1c;
  min-height: 1.2rem;
  margin-top: 10px;
}

.settings-msg {
  color: #0f766e;
  min-height: 1.2rem;
  margin-top: 10px;
}

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

  .action-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: calc(100% - 12px);
    margin-top: 8px;
  }

  .header-panel {
    min-height: 200px;
  }

  .panel {
    border-radius: 12px;
    padding: 12px;
  }

  .header-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-brand img {
    width: 56px;
  }  .header-topline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-topline .lang-picker {
    width: auto;
    max-width: 220px;
    padding: 4px 8px;
  }

  .header-topline .lang-picker span {
    display: none;
  }

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

  .qr-wrap img {
    width: 210px;
    height: 210px;
  }

  button {
    width: 100%;
  }

  .table-wrap {
    border: 1px solid #dbe5f4;
    border-radius: 10px;
    background: #fff;
  }

  .table-wrap table {
    min-width: 520px;
  }

  th,
  td {
    font-size: 0.84rem;
    padding: 8px 6px;
  }
}

.support-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
}

.support-fab summary {
  list-style: none;
  cursor: pointer;
  background: #11121a;
  color: #fff;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(20, 28, 46, 0.16);
}

.support-fab summary::-webkit-details-marker {
  display: none;
}

.support-fab summary::marker {
  content: "";
}

.support-menu {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(20, 28, 46, 0.12);
  overflow: hidden;
  min-width: 220px;
}

.support-menu a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
}

.support-menu a:hover {
  background: #f4f7ff;
}



