:root {
  --brand-green: #69c76e;
  --brand-green-dark: #2f8f4a;
  --brand-ink: #1d2a2f;
  --brand-slate: #4f6173;
  --brand-mist: #f3f7f5;
  --brand-glow: rgba(105, 199, 110, 0.25);
  --brand-shadow: 0 24px 50px rgba(20, 30, 35, 0.12);
}

* {
  box-sizing: border-box;
}

.app-body {
  font-family: "Source Sans 3", sans-serif;
  color: var(--brand-ink);
  background: #f2f6f4;
  min-height: 100vh;
}

.app-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(105, 199, 110, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(68, 118, 255, 0.18), transparent 55%),
    linear-gradient(135deg, #f7faf8 0%, #eef4f2 100%);
  z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Sora", sans-serif;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 0;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(31, 42, 46, 0.08);
}

.app-nav-inner {
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

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

.brand-title {
  font-weight: 600;
  color: var(--brand-ink);
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--brand-slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 46, 0.08);
  background: rgba(31, 42, 46, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
}

.app-nav .nav-link {
  color: var(--brand-ink);
  font-weight: 600;
  text-decoration: none;
}

.main-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--brand-slate);
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.main-nav-link:hover {
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(20, 30, 35, 0.08);
}

.main-nav-link.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
  box-shadow: 0 8px 18px var(--brand-glow);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.user-pill {
  background: rgba(105, 199, 110, 0.15);
  color: var(--brand-ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.nav-auth-link {
  color: var(--brand-slate);
}

.nav-auth-link:hover {
  color: var(--brand-green-dark);
}

.app-content {
  padding: 28px 0 64px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header p {
  margin-bottom: 0;
}

.app-card {
  background: white;
  border-radius: 18px;
  border: 1px solid rgba(31, 42, 46, 0.08);
  box-shadow: var(--brand-shadow);
  overflow: hidden;
}

.app-card .card-body {
  padding: 24px;
}

.app-alert {
  border-radius: 12px;
  border: 1px solid rgba(31, 42, 46, 0.08);
  box-shadow: 0 10px 20px rgba(20, 30, 35, 0.08);
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
  border: none;
  color: white;
  font-weight: 600;
  box-shadow: 0 10px 20px var(--brand-glow);
}

.btn-brand:hover {
  color: white;
  opacity: 0.92;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.status-RECEIVED { background-color: rgba(13, 110, 253, 0.15); color: #0d6efd; }
.status-PENDING_CONFIRMATION { background-color: rgba(255, 193, 7, 0.2); color: #8a6d1f; }
.status-PROCESSING { background-color: rgba(13, 202, 240, 0.2); color: #087990; }
.status-DONE { background-color: rgba(25, 135, 84, 0.2); color: #198754; }
.status-ERROR { background-color: rgba(220, 53, 69, 0.2); color: #dc3545; }

.status-internal-TO_BE_PROCESSED { background-color: rgba(108, 117, 125, 0.18); color: #495057; }
.status-internal-UNDER_PREPARATION { background-color: rgba(255, 193, 7, 0.25); color: #997404; }
.status-internal-SEND { background-color: rgba(13, 202, 240, 0.2); color: #087990; }
.status-internal-CANCELED { background-color: rgba(220, 53, 69, 0.2); color: #dc3545; }

.user-status-active { background-color: rgba(25, 135, 84, 0.2); color: #198754; }
.user-status-inactive { background-color: rgba(220, 53, 69, 0.2); color: #dc3545; }

.app-tabs {
  gap: 8px;
  margin-bottom: 16px;
}

.app-tabs .nav-link {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(31, 42, 46, 0.08);
  border-radius: 999px;
  color: var(--brand-ink);
}

.app-tabs .nav-link.active {
  background: var(--brand-ink);
  color: white;
}

.app-tab-content {
  display: grid;
  gap: 16px;
}

.code-block {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 18px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.auth-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  padding: 32px 0;
}

.auth-hero {
  padding: 32px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  border: 1px solid rgba(31, 42, 46, 0.08);
}

.auth-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.auth-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--brand-slate);
  font-size: 0.9rem;
}

.auth-badge {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(105, 199, 110, 0.18);
  color: var(--brand-green-dark);
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 12px;
}

.auth-card {
  background: white;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--brand-shadow);
}

.auth-card-header p {
  color: var(--brand-slate);
}

.table thead {
  background: #f5f8f6;
  color: var(--brand-slate);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr.clickable-row {
  cursor: pointer;
}

.table tbody tr.clickable-row:focus {
  outline: 2px solid rgba(13, 110, 253, 0.45);
  outline-offset: -2px;
}

.table td, .table th {
  padding: 14px 16px;
}

.orders-table .internal-status-cell {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .app-nav-inner {
    justify-content: center !important;
  }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .nav-user {
    width: 100%;
    justify-content: space-between;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
