﻿:root {
      --bg: #f4f7fb;
      --card: #ffffff;
      --text: #1d2735;
      --muted: #5f6b7a;
      --brand: #0c6b58;
      --brand-2: #0a5849;
      --line: #d8e0ea;
      --danger: #b92c2c;
      --ok: #1f6d3a;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
      background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
      color: var(--text);
      padding-top: 68px;
      overflow: hidden;
    }
    .topbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      width: 100%;
      z-index: 1200;
      background: #ffffff;
      border-bottom: 1px solid var(--line);
    }
    .topbar-inner {
      max-width: none;
      margin: 0 auto;
      padding: 12px clamp(12px, 2vw, 28px);
      display: flex;
      gap: 14px;
      align-items: center;
      flex-wrap: wrap;
    }
    .brand {
      font-weight: 700;
      color: var(--brand);
      margin-right: 10px;
    }
    .nav {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .nav a {
      text-decoration: none;
      color: var(--text);
      border: 1px solid var(--line);
      padding: 6px 10px;
      border-radius: 8px;
      background: #fff;
      font-size: 14px;
    }
    .nav a:hover { border-color: var(--brand); }
    .nav a[aria-current="page"] {
      background: var(--brand);
      color: #fff;
      border-color: var(--brand);
      pointer-events: none;
      cursor: default;
    }
    main {
      max-width: none;
      margin: 24px auto;
      padding: 20px clamp(12px, 2vw, 28px) 28px;
    }
    .panel {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 18px;
      margin-bottom: 16px;
    }
    .panel-sticky {
      position: fixed;
      top: 68px;
      left: 0;
      width: 100%;
      z-index: 1100;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px 12px 0 0;
      margin: 0;
      padding: 18px 18px 12px;
    }
    h1 { margin: 0 0 10px; }
    p { color: var(--muted); margin: 0 0 14px; }
    .actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 8px;
    }
    .btn {
      text-decoration: none;
      background: var(--brand);
      color: #fff;
      border: 0;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 14px;
      display: inline-block;
      cursor: pointer;
    }
    .btn:hover { background: var(--brand-2); }
    .btn-danger {
      background: var(--danger);
    }
    .btn-danger:hover {
      background: #982424;
    }
    .status {
      margin-top: 10px;
      font-size: 14px;
      font-weight: 600;
    }
    .status.ok { color: var(--ok); }
    .status.error { color: var(--danger); }
    .table-scroll-top {
      margin-top: 0;
      position: fixed;
      top: 250px;
      left: 0;
      width: 100%;
      z-index: 1050;
      overflow-x: auto;
      overflow-y: hidden;
      height: 14px;
      border: 1px solid var(--line);
      border-radius: 0 0 12px 12px;
      background: #fff;
      display: none;
    }
    .table-scroll-top > div {
      height: 1px;
    }
    .table-wrap {
      margin-top: 0;
      position: fixed;
      top: 280px;
      left: 0;
      width: 100%;
      bottom: 12px;
      overflow: auto;
      z-index: 100;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #fff;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 2600px;
    }
    th, td {
      text-align: left;
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      font-size: 14px;
      white-space: nowrap;
      vertical-align: middle;
    }
    thead th {
      background: #f6faf9;
      color: #1f3a33;
      font-weight: 600;
      position: sticky;
      top: 0;
      z-index: 5;
      box-shadow: 0 1px 0 #d8e0ea;
    }
    tbody td {
      position: relative;
      z-index: 1;
    }
    .product-image {
      width: 56px;
      height: 56px;
      border-radius: 8px;
      object-fit: cover;
      border: 1px solid var(--line);
      display: block;
      background: #f0f4f8;
    }
    .row-actions {
      display: flex;
      gap: 6px;
    }
    .btn-sm {
      border: 0;
      border-radius: 6px;
      padding: 5px 8px;
      font-size: 12px;
      cursor: pointer;
      color: #fff;
      background: var(--brand);
      text-decoration: none;
      display: inline-block;
    }
    .btn-sm:hover {
      background: var(--brand-2);
    }
    .btn-sm.delete {
      background: var(--danger);
    }
    .btn-sm.delete:hover {
      background: #982424;
    }


/* Stable fixed navigation across pages */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
}
.topbar-inner {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.brand {
  flex-shrink: 0;
}
.nav {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav a {
  flex-shrink: 0;
}

/* Navigation hard lock (prevent any bleed behind nav) */
.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 2147483000 !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--line) !important;
  isolation: isolate;
}
.topbar-inner {
  position: relative;
  z-index: 1;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.brand { flex-shrink: 0; }
.nav { flex-wrap: nowrap !important; white-space: nowrap; }
.nav a { flex-shrink: 0; }
body { padding-top: 74px !important; }
