:root {
  --color-primary: #C1121F;
  --color-primary-dark: #9B0E18;
  --color-bg: #F5F7FB;
  --color-surface: #FFFFFF;
  --color-text: #1F2937;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-dark: #111827;

  --color-success: #16A34A;
  --color-warning: #D97706;
  --color-danger: #DC2626;

  --tier-silver: #9CA3AF;
  --tier-gold: #D4AF37;
  --tier-platinum: #94A3B8;
  --tier-diamond: #38BDF8;
  --tier-corporate: #334155;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --shadow-soft: 0 10px 30px rgba(0,0,0,0.06);
  --shadow-card: 0 12px 24px rgba(17,24,39,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

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

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.brand-logo-jetour {
  height: 40px;
}

.brand-logo-sapy {
  height: 44px;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--color-border);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow-card);
}

.brand-text h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.nav a:hover,
.nav a.active {
  background: rgba(193, 18, 31, 0.08);
  color: var(--color-primary);
}

.page {
  padding: 28px 0 36px;
}

.page-title {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
}

.page-subtitle {
  margin: 0 0 24px;
  color: var(--color-text-muted);
  font-size: 15px;
}

.hero {
  background: linear-gradient(135deg, #111827 0%, #1F2937 50%, #2B3444 100%);
  color: white;
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.05;
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: rgba(255,255,255,0.82);
  font-size: 16px;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.card-ui {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  border: 1px solid rgba(229,231,235,0.7);
}

.card-ui + .card-ui {
  margin-top: 20px;
}

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

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

.kpi {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(229,231,235,0.7);
}

.kpi-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
}

.label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.value {
  font-size: 16px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: #EEF2F7;
  color: var(--color-text);
}

.btn-secondary:hover {
  background: #E5EAF1;
}

.input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font: inherit;
  background: white;
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(193, 18, 31, 0.55);
  box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.08);
}

.form-row + .form-row {
  margin-top: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.badge-active { background: rgba(22,163,74,0.12); color: var(--color-success); }
.badge-suspended { background: rgba(217,119,6,0.12); color: var(--color-warning); }
.badge-expired { background: rgba(220,38,38,0.12); color: var(--color-danger); }

.badge-tier-silver { background: rgba(156,163,175,0.15); color: #6B7280; }
.badge-tier-gold { background: rgba(212,175,55,0.16); color: #9A6C00; }
.badge-tier-platinum { background: rgba(148,163,184,0.18); color: #475569; }
.badge-tier-diamond { background: rgba(56,189,248,0.16); color: #0369A1; }
.badge-tier-corporate { background: rgba(51,65,85,0.14); color: #334155; }

.table-wrap {
  overflow-x: auto;
}

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

.table-ui th,
.table-ui td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.table-ui th {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 700;
}

.app-footer {
  padding: 24px 0 40px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .brand-divider {
    display: none;
  }

  .brand-logo-jetour {
    height: 32px;
  }

  .brand-logo-sapy {
    height: 34px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0;
  }

  .page-title {
    font-size: 26px;
  }

  .hero h1 {
    font-size: 30px;
  }

 .toolbar-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-search-inline {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-search-inline .input {
    min-width: 100%;
  }

  .toolbar-actions-inline {
    width: 100%;
    justify-content: stretch;
  }

  .toolbar-actions-inline .btn {
    width: 100%;
  }
}



.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

.footer-logo {
  width: auto;
  object-fit: contain;
  opacity: 0.95;
}

.footer-logo-jetour {
  height: 28px;
}

.footer-logo-sapy {
  height: 32px;
}

.toolbar-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar-search-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.toolbar-search-inline .input {
  flex: 1;
  min-width: 260px;
}

.toolbar-actions-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.toolbar-actions-inline .btn {
  white-space: nowrap;
}

.table-wrap {
  margin-top: 8px;
}

.table-ui td .btn {
  padding: 8px 12px;
  border-radius: 10px;
}
