:root {
  --bg: #0a1424;
  --panel: #0f1c31;
  --panel-2: #13243d;
  --surface: #f4f7fb;
  --surface-2: #ffffff;
  --line: #d7e1ee;
  --text: #102033;
  --muted: #627287;
  --brand: #0f5bd7;
  --brand-2: #16b3a8;
  --accent: #ebf4ff;
  --success: #13795b;
  --warning: #c98a18;
  --danger: #b42318;
  --shadow: 0 20px 45px rgba(7, 22, 45, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(22, 179, 168, 0.13), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #eef3f9 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.public-page > main {
  flex: 1 0 auto;
  width: 100%;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(21, 42, 74, 0.96), rgba(10, 20, 36, 0.98)),
    var(--bg);
  color: #dfe9f6;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  padding: 10px;
  box-shadow: 0 16px 30px rgba(15, 91, 215, 0.35);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

.brand-kicker,
.eyebrow,
.sidebar-panel-label,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.brand-kicker,
.sidebar-panel-label {
  color: #8ea3bf;
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  font-weight: 600;
  color: #b7c8dc;
  transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-panel {
  margin-top: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-panel-value {
  font-size: 1rem;
  font-weight: 700;
}

.sidebar-panel-meta {
  color: #9fb1c7;
  font-size: 0.85rem;
}

.main-content {
  padding: 34px;
}

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

.eyebrow {
  color: var(--brand);
}

.page-title {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.05;
  margin: 6px 0 0;
  font-weight: 800;
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand), #0c6cde);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 12px 28px rgba(15, 91, 215, 0.25);
}

.btn-outline-brand {
  border: 1px solid rgba(15, 91, 215, 0.2);
  color: var(--brand);
  background: rgba(255, 255, 255, 0.9);
}

.panel,
.kpi-card,
.table-card,
.form-card,
.info-card {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(215, 225, 238, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel,
.form-card,
.info-card,
.table-card {
  padding: 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.kpi-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -30px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 91, 215, 0.14), transparent 68%);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi-value {
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  margin: 10px 0 6px;
}

.kpi-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-title h2,
.card-title h3,
.card-title h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--brand);
}

.table thead th {
  border: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tbody td {
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  background: transparent;
}

.metric-list,
.stack-list {
  display: grid;
  gap: 14px;
}

.metric-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.progress-soft {
  height: 10px;
  border-radius: 999px;
  background: #e6edf6;
  overflow: hidden;
}

.progress-soft > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.form-control,
.form-select,
.btn {
  border-radius: 14px;
}

.form-control,
.form-select {
  border-color: #d5deea;
  padding: 0.8rem 0.95rem;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 91, 215, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(15, 91, 215, 0.12);
}

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

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

.postal-code-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 10px;
}

.subtle {
  color: var(--muted);
}

.badge-soft {
  background: #edf4ff;
  color: var(--brand);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-priority-critical,
.badge-priority-high,
.badge-priority-medium,
.badge-priority-low {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.badge-priority-critical {
  background: #b42318;
  color: #fff;
}

.badge-priority-high {
  background: #fce7e6;
  color: #b42318;
}

.badge-priority-medium {
  background: #fff4db;
  color: #9a6700;
}

.badge-priority-low {
  background: #e7f6ec;
  color: #13795b;
}

.badge-customer-b2c,
.badge-customer-b2b,
.badge-customer-b2g {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.badge-customer-b2c {
  background: #e8f1ff;
  color: #0f5bd7;
}

.badge-customer-b2b {
  background: #fce7e6;
  color: #b42318;
}

.badge-customer-b2g {
  background: #111827;
  color: #ffffff;
}

.badge-status-open,
.badge-status-progress,
.badge-status-closed {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.badge-status-open {
  background: #edf4ff;
  color: #0f5bd7;
}

.badge-status-progress {
  background: #fff4db;
  color: #9a6700;
}

.badge-status-closed {
  background: #e7f6ec;
  color: #13795b;
}

.badge-account-active,
.badge-account-pending,
.badge-account-none,
.badge-account-deleted {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.badge-account-active {
  background: #e7f6ec;
  color: #13795b;
}

.badge-account-pending {
  background: #fff4db;
  color: #9a6700;
}

.badge-account-none,
.badge-account-deleted {
  background: #eef2f6;
  color: #52606d;
}

.list-clean {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-clean li + li {
  margin-top: 10px;
}

.entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
}

.entity-row:last-child {
  border-bottom: 0;
}

.hero-card {
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(15, 91, 215, 0.96), rgba(22, 179, 168, 0.88)),
    var(--brand);
  color: #fff;
  box-shadow: 0 24px 60px rgba(10, 54, 122, 0.28);
}

.hero-card h2 {
  margin: 0 0 10px;
  font-size: 1.9rem;
  font-weight: 800;
}

.hero-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.client-hero-side {
  display: grid;
  gap: 14px;
  justify-items: end;
  min-width: min(100%, 560px);
}

.client-hero-meta,
.client-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.client-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.client-meta-pill strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 991.98px) {
  .client-hero-side {
    justify-items: start;
    min-width: 100%;
  }

  .client-hero-meta,
  .client-hero-actions {
    justify-content: flex-start;
  }
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.form-value-static {
  padding: 0.75rem 0;
  color: #10233f;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

.public-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

.public-hero .hero-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.support-accordion-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.support-accordion-intro {
  padding: 8px 6px 8px 2px;
}

.support-accordion-title {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

.support-accordion-lead {
  margin: 24px 0 0;
  color: var(--text);
  font-size: 1rem;
}

.support-accordion-note {
  margin: 12px 0 0;
  color: #b42318;
  font-size: 0.88rem;
  font-weight: 700;
}

.support-action-btn {
  min-width: 190px;
  min-height: 156px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-right: 8px;
}

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

.support-email-grid-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.support-email-grid .support-action-btn,
.support-email-grid-secondary .support-action-btn {
  min-width: 0;
  width: 100%;
  margin-right: 0;
}

.support-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}

.site-footer {
  margin-top: 32px;
  padding: 24px 0 10px;
  border-top: 1px solid #dbe5f0;
  width: 100%;
  flex-shrink: 0;
}

.site-footer-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
}

.footer-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
}

.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 1080;
  max-width: 960px;
  margin: 0 auto;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(7, 22, 45, 0.22);
}

.legal-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.legal-nav .nav-item {
  color: var(--text);
  background: #f7fbff;
  border: 1px solid #e3ebf5;
}

.legal-nav .nav-item:hover,
.legal-nav .nav-item.is-active {
  background: linear-gradient(135deg, var(--brand), #0c6cde);
  color: #fff;
  border-color: transparent;
}

.danger-zone {
  border: 1px solid rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.04);
}

.timeline-card + .timeline-card {
  margin-top: 16px;
}

.ticket-thread {
  display: grid;
  gap: 12px;
}

.ticket-thread-admin {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.ticket-comment {
  border: 1px solid #dde7f2;
  border-radius: 18px;
  padding: 14px 16px;
  background: #f8fbff;
}

.ticket-comment-client {
  background: #f8fbff;
}

.ticket-comment-admin {
  background: #edf6f1;
  border-color: #d6eadf;
}

.ticket-comment-empty {
  background: #fbfcfe;
}

.ticket-comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ticket-comment-head strong {
  font-size: 0.94rem;
}

.ticket-comment-head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.ticket-comment p {
  margin: 0;
  color: var(--text);
  white-space: normal;
}

@media (max-width: 1200px) {
  .kpi-grid,
  .filter-grid,
  .form-grid,
  .form-grid-3,
  .section-grid,
  .public-card-grid,
  .public-article-grid,
  .legal-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-accordion-grid {
    grid-template-columns: 1fr;
  }

  .support-email-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-email-grid-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

@media (max-width: 768px) {
  .main-content {
    padding: 22px;
  }

  .kpi-grid,
  .filter-grid,
  .form-grid,
  .form-grid-3,
  .section-grid,
  .public-card-grid,
  .public-article-grid {
    grid-template-columns: 1fr;
  }

  .support-action-btn {
    min-width: 100%;
    margin-right: 0;
  }

  .support-email-grid,
  .support-email-grid-secondary {
    grid-template-columns: 1fr;
  }

  .support-mini-btn {
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .site-footer {
    padding-bottom: 18px;
  }

  .site-footer-links {
    gap: 12px;
  }

  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 16px;
  }
}
