:root {
  --shopee: #ee4d2d;
  --shopee-dark: #d73f20;
  --shopee-light: #fff5f2;
  --sidebar-bg: #111827;
  --sidebar-hover: #1f2937;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --success: #0d8a47;
  --success-bg: #e6f9ee;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================================================
   HALAMAN LOGIN
   ========================================================================== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #ff7337 0%, #ee4d2d 42%, #111827 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ee4d2d, #ff7337);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-brand h1 {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}

.login-brand p {
  font-size: 12px;
  color: var(--muted);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 40px;
}

.pass-eye-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.security-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.sec-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.sec-pills span {
  font-size: 11px;
  background: #f3f4f6;
  color: #374151;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.init-hint {
  font-size: 11px;
  color: var(--muted);
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 8px;
  border-radius: 8px;
}

/* ==========================================================================
   LAYOUT PORTAL (SIDEBAR + MAIN CONTENT)
   ========================================================================== */
.portal-body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 255px;
  background: var(--sidebar-bg);
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ee4d2d, #ff7337);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 11px;
  color: #9ca3af;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: none;
  color: #d1d5db;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--shopee);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.35);
}

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.nav-pill {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-pill.on {
  background: #10b981;
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.user-role {
  font-size: 11px;
  color: #9ca3af;
}

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-left h1 {
  font-size: 20px;
  font-weight: 800;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-content {
  padding: 24px 28px 48px;
  max-width: 1400px;
  width: 100%;
}

@media (max-width: 960px) {
  .portal-body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .nav-item {
    white-space: nowrap;
    width: auto;
  }
}

/* ==========================================================================
   KARTU KPI, ACTION STRIP & GRAFIK BAR
   ========================================================================== */
.action-strip {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.action-strip-left,
.action-strip-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

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

@media (max-width: 600px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.highlight-kpi {
  border-top: 3px solid var(--shopee);
  background: linear-gradient(180deg, #fff9f7 0%, #ffffff 100%);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-icon {
  font-size: 18px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.kpi-timer {
  font-family: "Courier New", Courier, monospace;
  color: var(--shopee);
}

.kpi-foot {
  font-size: 12px;
  color: var(--muted);
}

.kpi-foot a {
  color: var(--shopee);
  text-decoration: none;
  font-weight: 600;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.ads-metrics-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--muted);
}

.mini-stat strong {
  font-size: 15px;
  color: var(--text);
  margin-top: 2px;
}

.bar-chart-container {
  height: 210px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 20px 6px 6px;
  border-bottom: 1px solid var(--border);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 24px;
}

.bar-fill {
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, #ff7337 0%, #ee4d2d 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
  position: relative;
  min-height: 4px;
}

.bar-fill.ads-bar {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
}

.bar-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
}

.bar-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   TABEL PENJUALAN & KOMPONEN UMUM
   ========================================================================== */
.sales-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  background: #f9fafb;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.data-table tr:hover td {
  background: #fafafa;
}

.pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-sandbox {
  background: #fef3c7;
  color: #92400e;
}

.pill-live {
  background: #dcfce7;
  color: #166534;
}

.pill-ok {
  background: #dcfce7;
  color: #166534;
}

.pill-warn {
  background: #fee2e2;
  color: #991b1b;
}

.pill-off {
  background: #e5e7eb;
  color: #374151;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.col-main,
.col-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.highlight-card {
  border-top: 4px solid var(--shopee);
}

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

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.countdown-box {
  background: var(--shopee-light);
  border: 1px solid #ffcabd;
  border-radius: 10px;
  padding: 8px 14px;
  text-align: right;
  min-width: 170px;
}

.countdown-label {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.countdown-timer {
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--shopee);
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.meta-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--shopee);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--shopee-dark);
}

.btn-secondary {
  background: var(--shopee-light);
  color: var(--shopee);
  border: 1px solid #ffcabd;
}

.btn-secondary:hover:not(:disabled) {
  background: #ffe4dc;
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid #d1d5db;
}

.btn-outline:hover:not(:disabled) {
  background: #f9fafb;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-link {
  background: none;
  border: none;
  color: var(--shopee);
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.badge-counter {
  background: var(--shopee-light);
  color: var(--shopee);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
}

.manual-add-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

input[type="text"],
input[type="password"],
input[type="url"],
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--shopee);
  box-shadow: 0 0 0 2px rgba(238, 77, 45, 0.15);
}

.fixed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fixed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
}

.fixed-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.prod-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--shopee);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.prod-details {
  overflow: hidden;
  flex: 1;
}

.prod-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.fixed-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
}

.status-boosted {
  background: var(--success-bg);
  color: var(--success);
}

.status-cooldown {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pending {
  background: #e5e7eb;
  color: #4b5563;
}

.shop-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-prod-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
}

.shop-prod-top {
  display: flex;
  gap: 10px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.form-check input {
  margin-top: 3px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

.accordion summary {
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  padding: 4px 0;
}

.mt-8 {
  margin-top: 10px;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row > * {
  flex: 1;
}

.small-text {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 16px;
  background: #fafafa;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.log-item {
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid #9ca3af;
  background: #f9fafb;
  font-size: 12px;
}

.log-item.success {
  border-left-color: var(--success);
  background: #f0fdf4;
}

.log-item.error {
  border-left-color: var(--danger);
  background: #fef2f2;
}

.log-item.warning {
  border-left-color: var(--warn);
  background: #fffbeb;
}

.log-time {
  font-size: 11px;
  color: var(--muted);
}

.log-summary {
  font-weight: 600;
  margin-top: 2px;
}

.log-details {
  color: #4b5563;
  margin-top: 2px;
  word-break: break-word;
}

.log-raw {
  margin-top: 6px;
  background: #111827;
  color: #e5e7eb;
  padding: 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #fde68a;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MENU TEST ORDER & CEK STATUS PESANAN (STEPPER & TIMELINE)
   ========================================================================== */
.order-detail-box {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}

.order-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.order-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 18px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-node {
  flex: 1;
  min-width: 105px;
  text-align: center;
  position: relative;
  padding: 8px 6px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.step-node.done {
  border-color: #a7f3d0;
  background: #f0fdf4;
  color: #065f46;
}

.step-node.current {
  border-color: var(--shopee);
  background: var(--shopee-light);
  color: var(--shopee);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(238, 77, 45, 0.15);
}

.step-node.cancelled {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
  font-weight: 700;
}

.step-icon {
  font-size: 16px;
  display: block;
  margin-bottom: 3px;
}

.order-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 680px) {
  .order-info-grid {
    grid-template-columns: 1fr;
  }
}

.info-block {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
}

.info-block h4 {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.status-simulator-box {
  margin-top: 12px;
  background: #fff9f7;
  border: 1px solid #ffcabd;
  border-radius: 10px;
  padding: 12px 14px;
}

.status-simulator-box h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--shopee-dark);
}

.tracking-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding-left: 8px;
  border-left: 2px solid #e5e7eb;
}

.tl-item {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
}

.tl-item:first-child::before {
  background: var(--shopee);
  box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.2);
}

.tl-time {
  font-size: 11px;
  color: var(--muted);
}

.tl-desc {
  font-weight: 500;
  color: var(--text);
}

