:root {
  --bg: #edf3f9;
  --bg-deep: #dbe7f3;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line: #d4e0ec;
  --line-strong: #bfd0e1;
  --text: #13324d;
  --muted: #67809a;
  --accent: #0f4f7c;
  --accent-strong: #0b3e62;
  --accent-soft: #e8f1f9;
  --danger: #b64040;
  --soft: #eef4fa;
  --shadow: 0 26px 70px rgba(15, 53, 88, 0.12);
  --shadow-soft: 0 14px 36px rgba(15, 53, 88, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 134, 185, 0.18), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(15, 79, 124, 0.08), transparent 26%),
    linear-gradient(180deg, #f6faff 0%, var(--bg) 100%);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(16, 72, 112, 0.98), rgba(10, 49, 80, 0.98));
  color: #f3f9ff;
  box-shadow: 0 28px 70px rgba(10, 42, 69, 0.22);
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
}

.sidebar h1,
.main h2,
.admin-card h3,
.generator-card h3 {
  margin: 0;
  font-style: normal;
  text-shadow: none;
}

.sidebar h1,
.main h2 {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}

.sidebar h1 {
  margin-top: 6px;
  font-size: 1.64rem;
  line-height: 1.12;
  font-weight: 400;
}

.sidebar-copy {
  margin: 14px 0 0;
  max-width: 250px;
  color: rgba(243, 249, 255, 0.82);
  line-height: 1.7;
  font-size: 0.98rem;
  font-weight: 400;
}

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 700;
}

.sidebar .eyebrow,
.status-label {
  color: rgba(214, 231, 247, 0.84);
}

.brand-logo,
.auth-logo {
  display: block;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.brand-logo {
  width: 140px;
  height: auto;
  aspect-ratio: auto;
  max-width: 100%;
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(5, 27, 46, 0.22);
}

.auth-logo {
  width: 82px;
  height: auto;
  margin-bottom: 16px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--soft);
  box-shadow: var(--shadow-soft);
}

.status-card,
.panel,
.admin-card,
.generator-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.status-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}

.status-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.status-value {
  margin-top: 10px;
  font-size: 1.46rem;
  line-height: 1.1;
  font-weight: 400;
  color: #ffffff;
}

.status-meta {
  margin-top: 12px;
  color: rgba(239, 247, 255, 0.8);
  line-height: 1.65;
  font-weight: 400;
}

.main {
  display: grid;
  gap: 20px;
  align-content: start;
}

.panel {
  padding: 28px;
  backdrop-filter: blur(8px);
}

.auth-panel {
  max-width: 720px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-head h2 {
  font-size: 1.58rem;
  line-height: 1.12;
  font-weight: 400;
}

.panel-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

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

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--muted);
}

input,
select,
textarea,
button {
  border-radius: 16px;
  border: 1px solid var(--line);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #89add0;
  box-shadow: 0 0 0 4px rgba(79, 134, 185, 0.14);
}

button {
  padding: 13px 18px;
  cursor: pointer;
  background: #ffffff;
  color: var(--text);
  font-weight: 400;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

button.primary {
  background: linear-gradient(180deg, #0f5a8f, #0d4a75);
  border-color: #0d4a75;
  color: #f7fbff;
  box-shadow: 0 14px 28px rgba(13, 74, 117, 0.22);
  font-weight: 500;
}

button.primary:hover {
  background: linear-gradient(180deg, #12649d, #0d4a75);
}

.hint,
.warning {
  margin: 16px 0 0;
  line-height: 1.65;
  color: var(--muted);
}

.warning {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1px solid #c8ddf0;
  color: #325879;
}

.generator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.generator-card {
  padding: 22px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.generator-card h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.generator-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 400;
}

.workspace-frame {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-card {
  padding: 22px;
  background: #fcfeff;
}

.admin-card h3 {
  font-size: 1.24rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.table-wrap {
  overflow: auto;
  margin-top: 18px;
  border: 1px solid var(--soft);
  border-radius: 20px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-weight: 500;
  background: #f7fbff;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.inline-check input {
  width: auto;
  accent-color: var(--accent);
}

.inline-check label {
  display: inline;
  font-weight: 400;
  color: var(--muted);
}

.message-panel {
  background: rgba(255, 255, 255, 0.98);
}

.message-panel #messageBox {
  font-size: 0.98rem;
  line-height: 1.65;
  font-weight: 400;
}

.generator-card button,
#refreshButton,
#closeWorkspaceButton,
#previewUploadButton {
  font-weight: 400;
}

.hidden {
  display: none !important;
}

.ok {
  color: var(--accent);
}

.bad {
  color: var(--danger);
}

code {
  color: var(--accent-strong);
  font-family: "SFMono-Regular", Consolas, monospace;
}

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

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 860px) {
  .page-shell {
    padding: 16px;
    gap: 16px;
  }

  .sidebar,
  .panel,
  .admin-card {
    padding: 20px;
    border-radius: 24px;
  }

  .panel-head h2,
  .sidebar h1 {
    font-size: 1.5rem;
  }

  .form-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    width: 120px;
  }
}
