/* ============================================================
   LERIQA HOLDING — ADMIN PANEL STYLES
   ============================================================ */

:root {
  --navy-950: #061326;
  --navy-900: #0a1f3c;
  --navy-800: #10294b;
  --navy-700: #1a3a63;
  --blue-700: #1157bd;
  --blue-600: #1769e0;
  --blue-500: #2f80ed;
  --blue-100: #e6f0fd;
  --blue-50: #f2f7ff;
  --amber: #f5a623;
  --amber-soft: #fff3dd;
  --green: #1e9e63;
  --green-soft: #e8f7ef;
  --red: #d74b4b;
  --red-soft: #fdecec;
  --ink: #12213a;
  --muted: #5c6b82;
  --muted-2: #7b889c;
  --line: #e2e8f2;
  --line-strong: #cfd9e8;
  --bg: #f4f7fb;
  --white: #fff;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 2px 10px rgba(10, 31, 60, 0.05);
  --shadow: 0 16px 40px rgba(10, 31, 60, 0.1);
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy-900);
}

p {
  margin: 0;
}

a {
  color: var(--blue-600);
  text-decoration: none;
}

a:hover {
  color: var(--blue-700);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.35);
  outline-offset: 2px;
}

code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(23, 105, 224, 0.08);
  color: var(--blue-700);
  font-size: 0.92em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.22);
}

.btn-primary:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--navy-800);
}

.btn-outline:hover {
  border-color: var(--blue-600);
  color: var(--blue-600);
  background: var(--blue-50);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--navy-700);
}

.btn-ghost:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #be3838;
  border-color: #be3838;
  color: #fff;
}

.btn-danger-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--red);
}

.btn-danger-ghost:hover {
  background: var(--red-soft);
  color: #b93434;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 11.5px;
  border-radius: 9px;
}

.btn-xs {
  padding: 6px 10px;
  font-size: 10.5px;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 22px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}

.spinner--dark {
  border-color: rgba(10, 31, 60, 0.18);
  border-top-color: var(--blue-600);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn:hover {
  background: var(--blue-50);
  color: var(--navy-900);
}

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

/* ---------- Login page ---------- */
.login-body {
  background: var(--navy-950);
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 48px 56px;
  background-color: var(--navy-950);
  background-image: radial-gradient(
      circle at 20% 0%,
      rgba(47, 128, 237, 0.3),
      transparent 45%
    ),
    radial-gradient(circle at 90% 90%, rgba(23, 105, 224, 0.22), transparent 50%),
    linear-gradient(160deg, #061326 0%, #0b2547 70%, #0a1f3c 100%);
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -160px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025),
    0 0 0 140px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.login-brand__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 560px;
}

.login-brand__logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.login-brand__logo:hover {
  color: #fff;
}

.login-brand__logo img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.login-brand__logo strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.login-brand__logo span span {
  display: block;
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #79c1ff;
}

.login-brand__content {
  margin: auto 0;
  padding: 60px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8ec8ff;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: #8ec8ff;
}

.login-brand__content h1 {
  color: #fff;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.login-brand__content > p {
  max-width: 460px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.62);
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 34px;
  padding: 0;
  list-style: none;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.login-features span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(121, 193, 255, 0.14);
  color: #8ec8ff;
  font-size: 11px;
  font-weight: 900;
  flex: none;
}

.login-brand__foot {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.login-brand__foot a {
  color: rgba(255, 255, 255, 0.6);
}

.login-brand__foot a:hover {
  color: #fff;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--bg);
}

.login-card {
  width: min(430px, 100%);
}

.login-card__logo {
  display: none;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(10, 31, 60, 0.18);
}

.login-card h2 {
  font-size: 28px;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin-top: 8px;
  margin-bottom: 26px;
  font-size: 13px;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.password-wrap {
  position: relative;
}

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

.password-wrap button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 7px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 800;
}

.password-wrap button:hover {
  background: var(--blue-50);
}

.login-note {
  margin-top: 20px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
}

.login-back {
  display: block;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}

.login-back:hover {
  color: var(--blue-600);
}

.config-warning {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #f3d8a8;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #7d5200;
  font-size: 12px;
  line-height: 1.6;
}

.config-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #6b4500;
}

/* ---------- Fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--navy-800);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fbfcfe;
  color: var(--navy-900);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.field input.is-invalid {
  border-color: var(--red);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9aa7b8;
  font-weight: 500;
}

.field-hint {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted-2);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.field--full {
  grid-column: 1 / -1;
}

/* ---------- Admin shell ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.admin-ready .admin-shell {
  opacity: 1;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 262px;
  height: 100dvh;
  padding: 22px 16px;
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.66);
  overflow-y: auto;
}

.admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-brand__link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}

.admin-brand__link:hover {
  color: #fff;
}

.admin-brand__link img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex: none;
}

.admin-brand__link strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.admin-brand__link small {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #79c1ff;
}

.admin-sidebar__close {
  display: none;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 18px 0;
  flex: 1;
}

.admin-nav__label {
  margin: 14px 10px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
}

.admin-nav__label:first-child {
  margin-top: 0;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.admin-nav__link svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.8;
}

.admin-nav__link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-nav__link.is-active {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.3);
}

.admin-nav__link.is-active svg {
  opacity: 1;
}

.admin-sidebar__foot {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
  min-width: 0;
}

.admin-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(121, 193, 255, 0.16);
  color: #9cd2ff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

.admin-user__email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.admin-sidebar__foot .btn {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.14);
}

.admin-sidebar__foot .btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.admin-main {
  width: calc(100% - 262px);
  min-height: 100vh;
  margin-left: 262px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 12px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.admin-topbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.admin-topbar__title {
  min-width: 0;
}

.admin-topbar__title span {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.admin-topbar__title h1 {
  margin-top: 2px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-topbar__email {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.admin-topbar__logout {
  border-color: var(--line);
  background: #fff;
}

.admin-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.admin-menu-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy-900);
}

.admin-content {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.admin-sidebar-backdrop {
  display: none;
}

/* ---------- Page heading ---------- */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.page-heading h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.page-heading p {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}

.page-heading .btn {
  flex: none;
}

/* ---------- Cards ---------- */
.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}

.admin-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 0;
}

.admin-card__head h2 {
  font-size: 15.5px;
  letter-spacing: -0.02em;
}

.admin-card__head p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.admin-card__head .btn {
  flex: none;
}

.admin-card__body {
  padding: 20px 22px 22px;
}

.admin-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

/* ---------- Stats ---------- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-600);
  flex: none;
}

.stat-card__icon svg {
  width: 22px;
  height: 22px;
}

.stat-card__icon.is-green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-card__icon.is-amber {
  background: var(--amber-soft);
  color: #b47700;
}

.stat-card__icon.is-navy {
  background: #eef1f6;
  color: var(--navy-800);
}

.stat-card__label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--navy-900);
  line-height: 1.1;
}

/* ---------- Toolbar & search ---------- */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  position: relative;
  width: min(360px, 100%);
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 40px;
  padding: 0 13px 0 37px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafd;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search-field input:focus {
  outline: none;
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.1);
}

.toolbar-hint {
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--navy-800);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fbfcff;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-btn:hover {
  color: var(--blue-600);
}

.sort-btn.is-sorted {
  color: var(--blue-700);
}

.sort-arrow {
  font-size: 10px;
  opacity: 0.7;
}

.table-product {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
}

.table-thumb {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
  object-fit: cover;
  flex: none;
}

.table-product strong,
.table-product__name {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy-900);
}

.table-product__name:hover {
  color: var(--blue-600);
}

.table-product span {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--muted-2);
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-price {
  font-weight: 700;
  white-space: nowrap;
}

.status-pill,
.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill::before,
.availability-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-active {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.is-inactive {
  background: #eef1f6;
  color: var(--muted);
}

.availability-pill.is-in {
  background: var(--green-soft);
  color: var(--green);
}

.availability-pill.is-out {
  background: var(--red-soft);
  color: var(--red);
}

.availability-pill.is-request {
  background: var(--amber-soft);
  color: #a06a00;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 46px 20px;
  text-align: center;
}

.table-empty strong {
  font-size: 14px;
  color: var(--navy-900);
}

.table-empty span {
  max-width: 420px;
  font-size: 11.5px;
  color: var(--muted);
}

.table-empty .btn {
  margin-top: 12px;
}

.table-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px 20px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Switches ---------- */
.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch__track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #d8e0eb;
  transition: background 0.2s var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(10, 31, 60, 0.2);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--blue-600);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:disabled + .switch__track {
  opacity: 0.5;
}

.switch input:focus-visible + .switch__track {
  outline: 3px solid rgba(47, 128, 237, 0.3);
  outline-offset: 2px;
}

/* ---------- Product form ---------- */
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.form-main,
.form-side {
  min-width: 0;
}

.form-side {
  position: sticky;
  top: 96px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 0;
}

.form-actions .btn {
  justify-content: center;
}

.field-inline {
  display: flex;
  gap: 8px;
}

.field-inline select {
  flex: 1;
}

.field-inline .btn {
  flex: none;
  white-space: nowrap;
}

.new-category-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--blue-50);
  margin-bottom: 2px;
}

.new-category-row .field {
  flex: 1;
}

.new-category-row .btn {
  flex: none;
}

.spec-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) 34px;
  gap: 8px;
  align-items: center;
}

.spec-row input {
  width: 100%;
  height: 39px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfe;
  font-size: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.spec-row input:focus {
  outline: none;
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.1);
}

.spec-row .icon-btn {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.switch-row:first-child {
  padding-top: 0;
}

.switch-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.switch-row__text strong {
  display: block;
  font-size: 12px;
  color: var(--navy-900);
}

.switch-row__text span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}

/* ---------- Image manager ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 34px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: #fafcff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.dropzone svg {
  width: 34px;
  height: 34px;
  margin-bottom: 7px;
  color: var(--blue-600);
}

.dropzone strong {
  font-size: 12.5px;
  color: var(--navy-900);
}

.dropzone span {
  font-size: 11px;
  color: var(--muted);
}

.dropzone__hint {
  margin-top: 6px;
  font-size: 10px !important;
  color: var(--muted-2) !important;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.image-grid:empty {
  display: none;
}

.image-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.image-card.is-main {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 2px rgba(23, 105, 224, 0.1);
}

.image-card__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #eef2f7;
  overflow: hidden;
}

.image-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card__badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(6, 19, 38, 0.8);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.image-card.is-main .image-card__badge {
  background: var(--blue-600);
}

.image-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  flex-wrap: wrap;
}

.image-card__actions .btn {
  flex: 1;
}

.image-card__actions .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

/* ---------- Categories ---------- */
.category-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 620px;
}

.category-form .field {
  flex: 1;
}

.category-form .btn {
  flex: none;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-row__main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.category-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-600);
  flex: none;
}

.category-row__icon svg {
  width: 19px;
  height: 19px;
}

.category-row__main strong {
  display: block;
  font-size: 12.5px;
  color: var(--navy-900);
}

.category-row__main span {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5fa;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 22px;
  align-items: start;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.account-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.account-card strong {
  color: var(--navy-900);
  word-break: break-all;
}

.account-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--blue-50);
  font-size: 11px;
  line-height: 1.6;
  color: var(--blue-700);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 19, 38, 0.55);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.18s var(--ease);
}

.modal__panel {
  width: min(460px, 100%);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(6, 19, 38, 0.3);
  overflow: hidden;
  animation: modalIn 0.2s var(--ease);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}

.modal__head h2 {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.modal__body {
  padding: 14px 22px 20px;
}

.modal__body p {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  white-space: pre-line;
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Toasts ---------- */
.toast-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--navy-900);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 16px 40px rgba(6, 19, 38, 0.28);
  animation: toastIn 0.25s var(--ease);
  pointer-events: auto;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  flex: none;
  margin-top: 1px;
}

.toast--error .toast__icon {
  background: var(--red);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Fatal setup screen ---------- */
.admin-fatal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 680px;
  margin: 8vh auto;
  padding: 40px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-fatal__logo {
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(10, 31, 60, 0.18);
}

.admin-fatal h1 {
  font-size: 26px;
  margin-bottom: 10px;
}

.admin-fatal p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.admin-fatal__steps {
  margin: 20px 0;
  padding-left: 20px;
  list-style: decimal;
  font-size: 12.5px;
  line-height: 2;
  color: var(--navy-800);
}

.admin-fatal__hint {
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--blue-50);
  font-size: 11.5px !important;
}

/* ---------- Empty state (admin) ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  text-align: center;
}

.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue-600);
  font-family: var(--font-display);
  font-size: 20px;
}

.empty-state h2,
.empty-state h3 {
  font-size: 17px;
  margin-bottom: 5px;
}

.empty-state p {
  max-width: 380px;
  margin-bottom: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

.empty-state--compact {
  padding: 26px 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .form-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .login-brand {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    background-image: radial-gradient(
        circle at 10% 0%,
        rgba(47, 128, 237, 0.1),
        transparent 40%
      );
  }

  .login-card__logo {
    display: block;
  }

  .admin-sidebar {
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
    box-shadow: 20px 0 60px rgba(6, 19, 38, 0.28);
  }

  .admin-sidebar.is-open {
    transform: none;
  }

  .admin-sidebar__close {
    display: inline-flex;
  }

  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: rgba(6, 19, 38, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s;
  }

  .admin-sidebar-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  .admin-main {
    width: 100%;
    margin-left: 0;
  }

  .admin-menu-toggle {
    display: inline-flex;
  }

  .admin-topbar {
    padding: 10px 20px;
  }

  .admin-topbar__email {
    display: none;
  }

  .admin-content {
    padding: 22px 20px 34px;
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .form-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .admin-topbar {
    min-height: 68px;
  }

  .admin-topbar__title h1 {
    font-size: 16px;
  }

  .admin-topbar__logout {
    padding: 8px 12px;
    font-size: 11px;
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .page-heading .btn {
    width: 100%;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    gap: 11px;
  }

  .stat-card__icon {
    width: 38px;
    height: 38px;
  }

  .stat-card__icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-card strong {
    font-size: 20px;
  }

  .admin-card__head,
  .admin-card__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px 16px;
  }

  .search-field {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  .admin-table,
  .admin-table thead,
  .admin-table tbody,
  .admin-table tr,
  .admin-table th,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  .admin-table tbody tr:last-child {
    border-bottom: 0;
  }

  .admin-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    border: 0;
    text-align: right;
  }

  .admin-table td::before {
    content: attr(data-label);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted-2);
    text-align: left;
    flex: none;
  }

  .admin-table td:first-child {
    display: block;
    padding-bottom: 10px;
    text-align: left;
  }

  .admin-table td:first-child::before {
    display: none;
  }

  .table-product {
    min-width: 0;
  }

  .table-product strong,
  .table-product__name,
  .table-product span {
    max-width: none;
  }

  .table-actions {
    justify-content: flex-end;
  }

  .category-form {
    flex-direction: column;
    align-items: stretch;
  }

  .category-form .btn {
    width: 100%;
  }

  .category-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .category-row__main {
    flex-basis: 100%;
  }

  .count-badge {
    margin-right: auto;
  }

  .new-category-row {
    flex-direction: column;
    align-items: stretch;
  }

  .spec-row {
    grid-template-columns: 1fr 34px;
  }

  .spec-row .spec-key {
    grid-column: 1 / 2;
  }

  .spec-row .spec-value {
    grid-column: 1 / 2;
  }

  .spec-row .icon-btn {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .toast-host {
    right: 16px;
    left: 16px;
    bottom: 16px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .admin-fatal {
    margin: 24px;
    padding: 28px;
  }
}

@media (max-width: 480px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field--full {
    grid-column: auto;
  }

  .image-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-panel {
    padding: 32px 20px;
  }

  .admin-content {
    padding: 18px 14px 30px;
  }

  .admin-topbar {
    padding: 9px 14px;
    gap: 10px;
  }

  .admin-topbar__title span {
    display: none;
  }

  .modal {
    padding: 12px;
  }

  .modal__foot {
    flex-direction: column-reverse;
  }

  .modal__foot .btn {
    width: 100%;
  }
}

/* Admin topbar subtitle */
.admin-topbar__title p {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
