:root {
  --bg: #f5efe3;
  --bg-soft: #fffaf0;
  --card: rgba(255, 251, 245, 0.9);
  --card-strong: #fffdfa;
  --line: rgba(94, 72, 48, 0.14);
  --text: #1f2432;
  --muted: #6f7483;
  --navy: #12233f;
  --red: #a41f1f;
  --red-soft: #fff0eb;
  --green: #1f7a52;
  --green-soft: #ebfff4;
  --amber: #b56a18;
  --amber-soft: #fff7e8;
  --slate: #5d6678;
  --shadow: 0 22px 55px rgba(56, 34, 17, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(207, 49, 49, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(18, 35, 63, 0.08), transparent 34%),
    linear-gradient(180deg, #f8f2e7 0%, #f4efe7 45%, #efe8dd 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.shell-header {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ba2f21, #7f1111);
  color: #fff8f2;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 30px rgba(127, 17, 17, 0.3);
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.86rem;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(27, 22, 16, 0.06);
}

.user-chip-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.shell-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 24px 40px;
}

.nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.nav-pills a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.86);
  border: 1px solid var(--line);
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(27, 22, 16, 0.05);
}

.nav-pills a.active {
  background: linear-gradient(135deg, #132644, #2d496d);
  color: #fff;
  border-color: transparent;
}

.nav-count,
.support-unread-badge,
.floating-ticket-alert__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a30f1e, #d92d20);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(169, 32, 32, 0.28);
}

.nav-pills a.active .nav-count {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.floating-ticket-alert {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 0 0 18px auto;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 244, 244, 0.98), rgba(255, 233, 233, 0.96));
  border: 1px solid rgba(193, 31, 31, 0.16);
  color: #7f1418;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(109, 21, 21, 0.14);
}

.floating-ticket-alert__label {
  font-weight: 800;
}

.message-banner {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff6d9;
  border: 1px solid rgba(181, 106, 24, 0.22);
  color: #6d4900;
  font-weight: 700;
}

.hero-card,
.card {
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.95), rgba(255, 249, 242, 0.92));
  border: 1px solid rgba(125, 95, 63, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 18px;
}

.compact-hero {
  padding: 24px 28px;
}

.hero-card h1,
h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 0.95;
  color: #0f1730;
}

h2, h3 {
  margin: 0;
  color: #16213a;
}

.hero-copy,
.hint,
p,
li {
  color: var(--muted);
}

.hero-copy {
  max-width: 780px;
  font-size: 1rem;
  line-height: 1.6;
  margin: 14px 0 0;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.hero-pill,
.preset-chip,
.helper-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.hero-pill,
.preset-chip {
  background: rgba(255, 252, 248, 0.9);
  border: 1px solid var(--line);
}

.preset-chip {
  flex-direction: column;
  align-items: flex-start;
  border-radius: 18px;
  min-width: 140px;
}

.preset-chip small,
.hero-pill {
  font-size: 0.88rem;
  color: var(--muted);
}

.preset-chip-block {
  width: 100%;
}

.helper-badge {
  background: rgba(18, 35, 63, 0.08);
  color: var(--navy);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #8d4d27;
}

.stats-grid,
.panel-grid,
.license-grid,
.grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small {
  display: block;
}

.stat-card span {
  opacity: 0.82;
  font-size: 0.9rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 2.3rem;
  line-height: 0.95;
}

.stat-card small {
  opacity: 0.84;
}

.stat-card-red {
  background: linear-gradient(135deg, #7e1212, #b53022);
}

.stat-card-green {
  background: linear-gradient(135deg, #0f5b3c, #249060);
}

.stat-card-amber {
  background: linear-gradient(135deg, #845215, #d38f28);
}

.stat-card-slate {
  background: linear-gradient(135deg, #243448, #506179);
}

.panel-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  margin-bottom: 18px;
}

.support-folder-grid,
.support-ticket-grid {
  display: grid;
  gap: 18px;
}

.support-folder {
  display: grid;
  gap: 18px;
}

.support-folder-head,
.support-mini-ticket__top,
.support-mini-ticket__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.support-folder-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.support-ticket-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.backup-folder-grid,
.backup-license-grid,
.backup-record-list {
  display: grid;
  gap: 18px;
}

.backup-folder,
.backup-license {
  margin-bottom: 0;
}

.backup-folder summary,
.backup-license summary {
  list-style: none;
  cursor: pointer;
}

.backup-folder summary::-webkit-details-marker,
.backup-license summary::-webkit-details-marker {
  display: none;
}

.backup-folder-summary,
.backup-license-summary,
.backup-record-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.backup-folder-copy h2,
.backup-license-summary h3,
.backup-record strong {
  margin: 0;
}

.backup-folder-badges,
.backup-record-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.backup-license-grid {
  margin-top: 18px;
}

.backup-license {
  border-radius: 24px;
  border: 1px solid rgba(125, 95, 63, 0.12);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 247, 239, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.backup-license-summary {
  padding: 18px 20px;
}

.backup-license-body {
  display: grid;
  gap: 16px;
  padding: 0 20px 20px;
  border-top: 1px solid rgba(125, 95, 63, 0.10);
}

.backup-record {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(125, 95, 63, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.backup-record-meta {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.backup-record-object {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 243, 0.9);
  border: 1px solid rgba(90, 71, 46, 0.12);
  color: #3d4a61;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.backup-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.backup-status-badge-ok {
  background: rgba(15, 106, 70, 0.12);
  color: #0f6a46;
  border: 1px solid rgba(15, 106, 70, 0.16);
}

.backup-status-badge-warn {
  background: rgba(181, 106, 24, 0.12);
  color: #8d5700;
  border: 1px solid rgba(181, 106, 24, 0.16);
}

.support-mini-ticket {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(125, 95, 63, 0.12);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 247, 239, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.support-mini-ticket.is-unread {
  border-color: rgba(193, 31, 31, 0.24);
  box-shadow: 0 16px 30px rgba(173, 45, 45, 0.08);
}

.support-mini-ticket h3 {
  margin: 0;
}

.support-mini-ticket p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.support-mini-ticket__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stack-column {
  display: grid;
  gap: 18px;
}

.card {
  padding: 24px;
  margin-bottom: 18px;
}

.card-form,
.card-side {
  margin-bottom: 0;
}

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

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

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

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

label {
  display: block;
  font-weight: 700;
  color: #1c2438;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(90, 71, 46, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(18, 35, 63, 0.3);
  box-shadow: 0 0 0 4px rgba(18, 35, 63, 0.08);
}

.mode-section {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 251, 246, 0.76);
  border: 1px solid rgba(90, 71, 46, 0.12);
}

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

.mode-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  cursor: pointer;
}

.mode-option input {
  width: auto;
  margin: 2px 0 0;
  padding: 0;
  box-shadow: none;
}

.mode-option strong,
.mode-option small {
  display: block;
}

.mode-option small {
  margin-top: 4px;
  color: var(--muted);
}

.conditional-block,
.event-box,
.result {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 250, 243, 0.9);
  border: 1px solid rgba(90, 71, 46, 0.12);
}

.default-plan-strip,
.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button,
.button {
  appearance: none;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #152744, #2e4b73);
  color: #fff;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  box-shadow: 0 14px 28px rgba(18, 35, 63, 0.18);
}

.button-ghost {
  background: rgba(255, 253, 250, 0.9);
  color: var(--navy);
  border: 1px solid rgba(18, 35, 63, 0.12);
  box-shadow: none;
}

.button-soft {
  background: linear-gradient(135deg, #0f6a46, #279d69);
}

.button-danger {
  background: linear-gradient(135deg, #811313, #c73725);
}

.section-head {
  margin: 8px 0 12px;
}

.license-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.license-card {
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.95), rgba(255, 248, 238, 0.92));
  border: 1px solid rgba(125, 95, 63, 0.12);
  box-shadow: var(--shadow);
}

.license-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.license-card-head p {
  margin: 6px 0 0;
  font-weight: 700;
  color: var(--muted);
}

.license-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.license-meta span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8e7b65;
  margin-bottom: 4px;
}

.license-meta strong {
  display: block;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-active {
  background: var(--green-soft);
  color: var(--green);
}

.status-revoked {
  background: var(--red-soft);
  color: var(--red);
}

.status-expired,
.status-past_due,
.status-canceled {
  background: #f0f1f6;
  color: #5d6678;
}

.status-scheduled {
  background: var(--amber-soft);
  color: var(--amber);
}

.alert-strip {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff0dc;
  color: #8d5700;
  font-weight: 700;
}

.event-box {
  margin-bottom: 14px;
}

.event-box p {
  margin: 8px 0 0;
}

.result-highlight {
  background: linear-gradient(135deg, rgba(15, 106, 70, 0.1), rgba(39, 157, 105, 0.14));
  border-color: rgba(15, 106, 70, 0.18);
}

.result strong {
  display: block;
  margin: 6px 0;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(90, 71, 46, 0.1);
  font-size: 0.93rem;
  vertical-align: top;
}

th {
  color: #7d5b38;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 248, 239, 0.86);
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 16px;
  border-radius: 18px;
  background: #1a2236;
  color: #ebeff8;
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 24px 40px;
}

@media (max-width: 1100px) {
  .stats-grid,
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .shell-header,
  .shell-main,
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .shell-header {
    flex-direction: column;
    align-items: stretch;
  }

  .user-panel {
    justify-content: space-between;
  }

  .stats-grid,
  .panel-grid,
  .field-grid,
  .mode-grid,
  .license-meta {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .card,
  .license-card {
    border-radius: 22px;
    padding: 20px;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row form,
  .button-row .button,
  .button-row button {
    width: 100%;
  }

  .floating-ticket-alert,
  .support-folder-badges,
  .backup-folder-badges {
    width: 100%;
    justify-content: space-between;
  }

  .support-folder-head,
  .support-mini-ticket__top,
  .support-mini-ticket__footer,
  .backup-folder-summary,
  .backup-license-summary,
  .backup-record-top {
    flex-direction: column;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    padding: 14px 0;
    border-bottom: 1px solid rgba(90, 71, 46, 0.12);
  }

  td {
    border: none;
    padding: 6px 0;
  }
}
