/* GRT Admin design system — layered over Bootstrap 5.
   Principles: one accent color, generous whitespace, clear hierarchy,
   consistent radii/shadows, readable tables, obvious interactive states. */

:root {
  --grt-bg: #f6f7fb;
  --grt-surface: #ffffff;
  --grt-ink: #1d2433;
  --grt-ink-soft: #6b7280;
  --grt-accent: #4f46e5;
  --grt-accent-soft: #eef2ff;
  --grt-sidebar: #181f2e;
  --grt-sidebar-ink: #aab3c5;
  --grt-radius: 12px;
  --grt-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}

body.grt-admin {
  background: var(--grt-bg);
  color: var(--grt-ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .925rem;
}

/* ---------- layout ---------- */
.grt-shell { display: flex; min-height: 100vh; }

.grt-sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--grt-sidebar);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.grt-brand {
  color: #fff; font-weight: 700; font-size: 1rem;
  padding: 18px 18px 14px; text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.grt-brand .grt-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--grt-accent), #9333ea);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; font-weight: 800;
}
.grt-brand small { display: block; font-weight: 400; color: var(--grt-sidebar-ink); font-size: .7rem; }

.grt-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.grt-nav .grt-nav-label {
  color: #5d6778; font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; padding: 14px 10px 6px;
}
.grt-nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--grt-sidebar-ink); text-decoration: none;
  padding: 9px 12px; border-radius: 8px; font-size: .875rem;
  margin-bottom: 2px; transition: background .15s, color .15s;
}
.grt-nav a i { font-size: 1rem; width: 18px; text-align: center; }
.grt-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.grt-nav a.active { background: var(--grt-accent); color: #fff; }

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

.grt-topbar {
  background: var(--grt-surface); border-bottom: 1px solid #e7e9f0;
  padding: 12px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.grt-topbar .grt-store { font-size: .85rem; color: var(--grt-ink-soft); display: flex; align-items: center; gap: 8px; }
.grt-topbar .grt-store .badge { font-weight: 500; }

.grt-content { padding: 26px 28px 48px; max-width: 1240px; width: 100%; }
.grt-page-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; }
.grt-page-sub { color: var(--grt-ink-soft); font-size: .85rem; margin-bottom: 22px; }

/* ---------- components ---------- */
.grt-admin .card {
  border: 1px solid #e9ebf2; border-radius: var(--grt-radius);
  box-shadow: var(--grt-shadow); background: var(--grt-surface);
}
.grt-admin .card .card-body { padding: 20px 22px; }
.grt-admin .card h6 {
  font-weight: 700; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--grt-ink-soft); margin-bottom: 14px;
}

.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--grt-accent-soft); color: var(--grt-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.stat-card .stat-label { color: var(--grt-ink-soft); font-size: .78rem; }
.stat-card .stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }

.grt-admin .table { font-size: .875rem; margin-bottom: 0; }
.grt-admin .table thead th {
  color: var(--grt-ink-soft); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; border-bottom-width: 1px; padding: 10px 12px;
  white-space: nowrap;
}
.grt-admin .table tbody td { padding: 11px 12px; vertical-align: middle; }
.grt-admin .table-hover tbody tr:hover { background: #f8f9fe; }

.grt-empty {
  text-align: center; color: var(--grt-ink-soft); padding: 42px 20px;
}
.grt-empty i { font-size: 2rem; display: block; margin-bottom: 10px; opacity: .45; }

.grt-admin .btn { border-radius: 8px; font-size: .85rem; }
.grt-admin .btn-primary {
  background: var(--grt-accent); border-color: var(--grt-accent);
}
.grt-admin .btn-primary:hover { background: #4338ca; border-color: #4338ca; }
.grt-admin .form-control, .grt-admin .form-select { border-radius: 8px; font-size: .875rem; }
.grt-admin .form-control:focus, .grt-admin .form-select:focus {
  border-color: var(--grt-accent); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
}
.grt-admin .form-label { font-weight: 600; font-size: .8rem; color: var(--grt-ink); }
.grt-password-group { flex: 1 1 auto; }
.grt-admin .alert { border-radius: 10px; font-size: .875rem; }
.grt-admin code { color: #6d28d9; background: #f5f3ff; padding: 1px 6px; border-radius: 5px; }
.grt-admin .badge { border-radius: 6px; font-weight: 600; }

/* selected-product chips (bundle form) */
.grt-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 38px; }
.grt-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grt-accent-soft); color: var(--grt-accent);
  border: 1px solid #dfe3ff; border-radius: 999px;
  padding: 5px 8px 5px 12px; font-size: .82rem; font-weight: 500;
}
.grt-chip button {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: .95rem; line-height: 1; padding: 2px; border-radius: 50%;
}
.grt-chip button:hover { background: rgba(79, 70, 229, .15); }

.grt-search-results {
  position: absolute; z-index: 30; width: 100%;
  max-height: 280px; overflow-y: auto;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .14);
}
.grt-search-results .list-group-item { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.grt-search-results img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }

/* ---------- login ---------- */
.grt-login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 500px at 20% -10%, #eef2ff 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #f5f3ff 0%, transparent 55%),
              var(--grt-bg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.grt-login-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 16px; box-shadow: 0 10px 40px rgba(16, 24, 40, .1);
  padding: 38px 36px;
}
.grt-login-card .grt-logo {
  width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.05rem;
}
.grt-login-card h5 { text-align: center; font-weight: 700; margin-bottom: 2px; }
.grt-login-card .grt-sub { text-align: center; color: #6b7280; font-size: .83rem; margin-bottom: 24px; }

@media (max-width: 860px) {
  .grt-sidebar { position: fixed; left: -240px; transition: left .2s; z-index: 50; }
  .grt-sidebar.open { left: 0; }
  .grt-content { padding: 18px 16px 40px; }
  .grt-menu-toggle { display: inline-flex !important; }
}
.grt-menu-toggle { display: none; border: none; background: none; font-size: 1.3rem; }
