/* Mojud Live — Admin design system (brief §2–4 + enquiry mock chrome) */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
  --burgundy-dark: #6B1F2E;
  --burgundy-light: #9A3A50;
  --amber: #F5A623;
  --brass: #F5A623;
  --brass-deep: #E88714;
  --brass-light: #FBC34A;
  --brass-ink: #5C3A08;
  --ink: #1A1A1E;
  --ink-soft: #3A3A3E;
  --muted: #6B6B70;
  --faint: #9A9A9F;
  --text-muted-warm: #8B7679;
  --header-label: #6B5A5D;
  --border: #E4E3DF;
  --hairline: #F3F1EC;
  --tint-burgundy: #FBEEF1;
  --surface: #FFFFFF;
  --page-bg: #F7F6F3;
  --green-bg: #EEF6EA;
  --green-fg: #2E5A24;
  --amber-bg: #FBF2E1;
  --amber-fg: #A6650F;
  --red-bg: #FDECEC;
  --red-fg: #B23A2A;
  --sidebar-w: 208px;
  --sidebar-w-collapsed: 72px;
  --nav-active: #7A2333;

  /* Sun-faded burgundy fabric wash — sidebar (315°) keeps pink longer so it reads like the enquiry mock */
  --gradient-fabric: linear-gradient(
    315deg,
    #F4E9EB 0%,
    #F7F1F2 28%,
    #FAF6F5 55%,
    #FDFBFA 100%
  );
  /* Header is wide/horizontal — keep pink wash across the full row (not white by ~halfway) */
  --gradient-fabric-header: linear-gradient(
    90deg,
    #F4E9EB 0%,
    #F7F1F2 32%,
    #FAF6F5 64%,
    #FDFBFA 100%
  );

  /* Thin-edge token ONLY (spine / rule / top strip) — never a text fill */
  --gradient-brand-edge: linear-gradient(
    165deg,
    #F5A623 0%,
    #E8662C 32%,
    #B23A50 62%,
    #6B1F2E 100%
  );
  --gradient-brand-edge-x: linear-gradient(
    90deg,
    #F5A623 0%,
    #E8662C 32%,
    #B23A50 62%,
    #6B1F2E 100%
  );

  /* Same accent strip used on top bar, primary buttons, page titles */
  --brand-gradient: linear-gradient(
    90deg,
    var(--burgundy-dark) 0%,
    var(--burgundy-light) 50%,
    var(--burgundy-dark) 100%
  );
  --brass-gradient: linear-gradient(
    90deg,
    var(--brass-deep) 0%,
    var(--brass) 48%,
    var(--brass-light) 100%
  );

  /* Legacy aliases for migrated page-local CSS */
  --navy: var(--burgundy-dark);
  --navy-deep: var(--burgundy-dark);
  --blue: var(--burgundy-light);
  --blue-soft: var(--tint-burgundy);
  --bg: var(--page-bg);
  --card: var(--surface);
  --text: var(--ink);
  --success: var(--green-fg);
  --warning: var(--amber-fg);
  --danger: var(--red-fg);
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Inter', 'Noto Sans Bengali', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background: var(--page-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.bn {
  font-family: 'Noto Sans Bengali', 'Inter', sans-serif;
}

.tabular-nums,
table td,
.mojud-table .field-num {
  font-variant-numeric: tabular-nums;
}

/* ── App shell ─────────────────────────────────────────────── */

.mojud-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.top-accent {
  display: none;
}

.mojud-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.mojud-sidebar {
  position: relative;
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--gradient-fabric);
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  color: var(--ink);
}

.mojud-sidebar::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gradient-brand-edge);
  pointer-events: none;
  z-index: 4;
}

.sidebar-brand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  padding: 14px 12px 14px 16px;
  border-bottom: 1px solid rgba(107, 31, 46, 0.06);
  flex-shrink: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  min-width: 0;
  flex: 1;
  padding: 0;
}

.brand-wordmark {
  height: 32px;
  width: auto;
  max-width: 168px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand-icon-collapsed {
  width: 32px;
  height: 32px;
  display: none;
  object-fit: contain;
}

html.sidebar-collapsed .brand-wordmark {
  display: none;
}

html.sidebar-collapsed .brand-icon-collapsed {
  display: block;
}

html.sidebar-collapsed .mojud-sidebar {
  width: var(--sidebar-w-collapsed);
}

html.sidebar-collapsed .nav-sec-title {
  display: none;
}

html.sidebar-collapsed .nav-item {
  position: relative;
  justify-content: center;
  padding: 11px 10px;
  border-left-width: 3px;
  border-radius: 10px;
  margin: 2px 8px;
  width: auto;
}

html.sidebar-collapsed .nav-item i {
  font-size: 22px;
  width: 24px;
  color: var(--text-muted-warm);
  opacity: 1;
}

html.sidebar-collapsed .nav-item:hover {
  background: var(--tint-burgundy);
}

html.sidebar-collapsed .nav-item:hover i {
  color: var(--nav-active);
}

html.sidebar-collapsed .nav-item.active {
  background: var(--tint-burgundy);
  border-left-color: var(--nav-active);
}

html.sidebar-collapsed .nav-item.active i {
  color: var(--nav-active);
}

html.sidebar-collapsed .nav-item .nav-label {
  /* label shown via fixed tooltip when collapsed */
  display: none !important;
}

html.sidebar-collapsed .sidebar-brand-head {
  flex-direction: column;
  padding: 12px 8px;
  gap: 8px;
}

html.sidebar-collapsed .brand-row {
  justify-content: center;
  flex: 0;
}

.sidebar-toggle-row {
  display: flex;
  justify-content: flex-end;
  padding: 0;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: var(--tint-burgundy);
  color: var(--burgundy-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-toggle i {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(154, 58, 80, 0.18);
  color: var(--burgundy-dark);
}

.sidebar-toggle:active {
  transform: scale(0.94);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--burgundy-light);
  outline-offset: 2px;
}

html.sidebar-collapsed .sidebar-toggle {
  margin: 0 auto;
  background: var(--tint-burgundy);
  color: var(--burgundy-dark);
}

html.sidebar-collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

#admin-shell-nav {
  padding-top: 10px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.nav-sec-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted-warm);
  padding: 14px 20px 6px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.nav-top {
  flex: 0 0 auto;
  padding-bottom: 4px;
}

.nav-group {
  flex: 0 0 auto;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.nav-group-toggle .nav-sec-title {
  flex: 1;
  text-align: left;
  padding-right: 4px;
}

.nav-group-chevron {
  font-size: 14px;
  color: var(--text-muted-warm);
  margin-right: 16px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.nav-group.is-open .nav-group-chevron {
  transform: rotate(180deg);
}

.nav-group-body {
  flex: 0 0 auto;
}

.nav-group-body[hidden] {
  display: none !important;
}

html.sidebar-collapsed .nav-group-toggle .nav-sec-title,
html.sidebar-collapsed .nav-group-chevron {
  display: none;
}

html.sidebar-collapsed .nav-group:not(.is-open) .nav-group-body {
  display: none !important;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-left: 3px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted-warm);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  border-top: none;
  border-right: none;
  border-bottom: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.nav-item i {
  font-size: 18px;
  color: var(--text-muted-warm);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  stroke-width: 2;
}

.nav-item .nav-label {
  color: inherit;
  font-weight: inherit;
}

.nav-item:hover {
  background: rgba(122, 35, 51, 0.06);
  color: var(--nav-active);
}

.nav-item:hover i {
  color: var(--nav-active);
}

.nav-item.active {
  border-left-color: var(--nav-active);
  background: var(--tint-burgundy);
  color: var(--nav-active);
  font-weight: 700;
}

.nav-item.active i {
  color: var(--nav-active);
}

.sidebar-foot {
  display: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.user-chip-btn {
  position: relative;
  border: none;
  background: transparent;
  padding: 2px 4px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px;
}

.user-chip-btn:hover,
.user-chip-btn:focus-visible {
  background: rgba(122, 35, 51, 0.06);
  outline: none;
}

.topbar-session {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(107, 31, 46, 0.12);
}

.topbar-session .user-name {
  display: none;
}

.user-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid rgba(107, 31, 46, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 26, 30, 0.12);
  z-index: 40;
  text-align: left;
}

.user-pop[hidden] {
  display: none !important;
}

.user-pop-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--burgundy-dark);
  line-height: 1.3;
}

.user-pop-role,
.user-pop-user {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted-warm);
  line-height: 1.35;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tint-burgundy);
  color: var(--nav-active);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.lang-toggle-btn,
.logout-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted-warm);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.lang-toggle-btn:hover,
.logout-link:hover {
  color: var(--nav-active);
}

/* ── Main column ───────────────────────────────────────────── */

.mojud-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.mojud-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: none;
  background: var(--surface);
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(26, 26, 30, 0.04), 0 6px 16px rgba(26, 26, 30, 0.05);
  position: relative;
  z-index: 2;
}

.mojud-breadcrumb::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--gradient-brand-edge-x);
  pointer-events: none;
}

.crumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.crumb-muted {
  font-size: 12px;
  font-weight: 600;
  color: var(--brass-ink);
}

.crumb-active {
  font-size: 12px;
  color: var(--burgundy-dark);
  font-weight: 700;
}

.mojud-breadcrumb .chev {
  font-size: 12px;
  color: var(--brass-ink);
  opacity: 0.5;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

.mojud-breadcrumb .bell {
  margin-left: 0;
  font-size: 17px;
  color: var(--ink-soft);
  opacity: 1;
  filter: drop-shadow(0 1px 1px rgba(26, 26, 30, 0.12));
}

.mojud-breadcrumb .bell:hover {
  color: var(--burgundy-dark);
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(107, 31, 46, 0.12);
}

.mojud-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: var(--page-bg);
}

.mojud-content-pad {
  padding: 20px 24px 32px;
}

/* ── List chrome (Shopify-style) ───────────────────────────── */

.mojud-panel {
  margin: 0 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.03), 0 8px 24px rgba(20, 20, 24, 0.04);
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 24px 14px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}

.view-tab {
  font-size: 12.5px;
  color: var(--faint);
  padding: 12px 12px;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: 8px 8px 0 0;
}

.view-tab:hover {
  color: var(--ink-soft);
  background: #FAFAF8;
}

.view-tab.active {
  color: var(--ink);
  font-weight: 600;
  position: relative;
}

.view-tab.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand-gradient);
}

.view-tab-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 8px 0 8px 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--burgundy-dark);
  padding: 0;
  background: var(--tint-burgundy);
  border: 1px solid rgba(154, 58, 80, 0.22);
  cursor: pointer;
  border-radius: 8px;
}

.view-tab-add:hover {
  color: #fff;
  background: var(--burgundy-light);
  border-color: var(--burgundy-light);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #FBFBF9;
}

.filter-chips {
  display: contents;
}

.search-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #D5D4CF;
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
  border-color: var(--burgundy-light);
  box-shadow: 0 0 0 3px rgba(107, 31, 46, 0.1), 0 1px 2px rgba(20, 20, 24, 0.04);
}

.search-box i {
  font-size: 16px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-field-select,
.filter-chip .filter-field {
  flex-shrink: 0;
  border: none;
  outline: none;
  background: #EFEDE8;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 7px;
  padding: 6px 9px;
  max-width: 140px;
  cursor: pointer;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-bg);
  color: var(--amber-fg);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(166, 101, 15, 0.18);
}

.filter-chip.filter-chip-edit {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: 0 1px 1px rgba(20, 20, 24, 0.03);
}

.filter-chip-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--burgundy-dark);
  padding-left: 4px;
  white-space: nowrap;
}

.filter-chip .filter-value {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  min-width: 88px;
  max-width: 160px;
  padding: 4px 2px;
}

.filter-chip .filter-value::placeholder {
  color: #A5A5A9;
}

.filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.filter-chip-remove:hover {
  background: var(--tint-burgundy);
  color: var(--burgundy-dark);
}

.filter-chip-remove i {
  font-size: 14px;
}

.add-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(154, 58, 80, 0.28);
  color: var(--burgundy-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--tint-burgundy);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 1px rgba(107, 31, 46, 0.05);
}

.add-filter i {
  font-size: 14px;
  font-weight: 700;
}

.add-filter:hover:not(:disabled) {
  border-color: var(--burgundy-light);
  color: #fff;
  background: var(--burgundy-light);
}

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

.sort-ctrl {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.sort-ctrl select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
}

/* ── Tables ────────────────────────────────────────────────── */

.mojud-table-wrap {
  overflow-x: auto;
  background: var(--surface);
}

.mojud-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.mojud-table thead th,
.mojud-table th {
  font-size: 12.5px;
  color: var(--header-label);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 16px;
  border-bottom: none;
  /* Shared row-sized gradients; --thead-w / --th-x set by AdminShell.syncTheadGradients */
  background-color: #FDFBFA;
  background-image:
    var(--gradient-brand-edge-x),
    var(--gradient-fabric-header);
  background-size:
    var(--thead-w, 100%) 3px,
    var(--thead-w, 100%) 100%;
  background-position:
    calc(-1 * var(--th-x, 0px)) bottom,
    calc(-1 * var(--th-x, 0px)) top;
  background-repeat: no-repeat;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  text-shadow: none;
}

.mojud-table th.th-sortable {
  cursor: pointer;
  user-select: none;
}

.mojud-table th.th-sortable:hover {
  color: var(--nav-active);
}

.th-label {
  vertical-align: middle;
  color: inherit;
}

.th-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted-warm);
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.12s ease, background 0.12s ease;
}

.th-sort-btn i {
  font-size: 14px;
  line-height: 1;
}

.th-sortable:hover .th-sort-btn,
.th-sort-btn:hover {
  color: var(--nav-active);
  background: rgba(122, 35, 51, 0.08);
}

.th-sortable.is-sorted {
  color: var(--nav-active);
}

.th-sortable.is-sorted .th-sort-btn {
  color: var(--nav-active);
  background: rgba(122, 35, 51, 0.1);
}

.table-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--header-label);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: none;
}

.table-pager-inline .btn-sm {
  min-width: 30px;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  border-color: var(--border);
  color: var(--header-label);
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.04);
}

.table-pager-inline .btn-sm:hover:not(:disabled) {
  background: var(--tint-burgundy);
  color: var(--nav-active);
  border-color: rgba(122, 35, 51, 0.2);
}

.table-pager-inline .btn-sm:disabled {
  opacity: 0.5;
}

.mojud-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--muted);
  vertical-align: middle;
  background: var(--surface);
  transition: background 0.12s ease;
}

.mojud-table tbody tr:nth-child(even) td {
  background: #F8F6F3;
}

.mojud-table tbody tr:last-child td {
  border-bottom: none;
}

.mojud-table tbody tr:hover td {
  background: #FCF8F9;
}

.mojud-table td.name,
.mojud-table .name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}

.mojud-table .code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}

.mojud-table a.code-link {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--burgundy-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(154, 58, 80, 0.35);
}

.mojud-table a.code-link:hover {
  color: var(--burgundy-light);
  border-bottom-color: var(--burgundy-light);
}

.mojud-table td .btn-sm {
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.06), 0 2px 8px rgba(20, 20, 24, 0.04);
  font-weight: 600;
}

.mojud-table td .btn-sm.btn-primary,
.mojud-table td .btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  -webkit-text-fill-color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(107, 31, 46, 0.2), 0 4px 12px rgba(107, 31, 46, 0.12);
}

.mojud-table td .btn-sm.btn-primary:hover,
.mojud-table td .btn-primary:hover {
  background: var(--brand-gradient);
  color: #fff;
  -webkit-text-fill-color: #fff;
  filter: brightness(1.06);
}

.mojud-table td .btn-sm:hover {
  background: var(--tint-burgundy);
  border-color: rgba(154, 58, 80, 0.3);
  color: var(--burgundy-dark);
  box-shadow: 0 2px 4px rgba(107, 31, 46, 0.1), 0 4px 12px rgba(107, 31, 46, 0.08);
}

.mojud-table td .btn-sm.btn-primary:hover {
  background: var(--brand-gradient);
  color: #fff;
  -webkit-text-fill-color: #fff;
  border-color: transparent;
}

.mojud-table td .btn-edit {
  color: var(--burgundy-dark);
  border-color: rgba(154, 58, 80, 0.22);
  background: #fff;
}

.mojud-table td .btn-toggle {
  color: var(--ink-soft);
  background: #fff;
}

.mojud-table td.action-cell {
  text-align: left;
  vertical-align: middle;
}

.mojud-table td .action-btns {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

.mojud-table td .prod-advance-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 5.75rem;
  padding: 5px 10px;
  border-radius: 7px;
  border-width: 1.5px;
  border-style: solid;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  box-shadow:
    0 1px 2px rgba(20, 20, 24, 0.08),
    0 3px 8px rgba(20, 20, 24, 0.08);
}

.mojud-table td .prod-advance-btn i {
  font-size: 13px;
  line-height: 1;
}

.mojud-table td .prod-advance-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(20, 20, 24, 0.1),
    0 8px 18px rgba(20, 20, 24, 0.12);
}

.mojud-table td .prod-advance-btn:active:not(:disabled) {
  transform: translateY(0);
}

.mojud-table td .prod-advance-btn.is-done {
  background: #2F8F55;
  color: #fff;
  border-color: #1F6B3A;
  opacity: 0.9;
  cursor: default;
  box-shadow: none;
}

.mojud-table td .prod-advance-btn.is-blocked {
  background: #EFEDEA;
  color: #8B7679;
  border-color: #D0CFCA;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.95;
}

.mojud-table button.code-link {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(154, 58, 80, 0.35);
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.mojud-table .pr-detail-cell {
  padding: 0 12px 14px !important;
  background: #FAF8F5;
}

.mojud-table .pr-detail-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.mojud-table .pr-detail-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}

.mojud-table .pr-lines-table {
  margin: 0;
}

.mojud-table .pr-lines-table th,
.mojud-table .pr-lines-table td {
  font-size: 12px;
}

.badge.prod-badge {
  font-weight: 600;
}

.th-actions {
  text-align: left;
  min-width: 200px;
}

.th-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.th-actions-head .th-label {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table-pager-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.table-pager-inline .pager-btns {
  display: inline-flex;
  gap: 4px;
}

.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  letter-spacing: 0.01em;
}

.badge.ok,
.badge-ok {
  background: var(--green-bg);
  color: var(--green-fg);
}

.badge.mid,
.badge-mid {
  background: var(--amber-bg);
  color: var(--amber-fg);
}

.badge.low,
.badge-low,
.badge.danger {
  background: var(--red-bg);
  color: var(--red-fg);
}

.badge.neutral,
.badge-neutral {
  background: var(--hairline);
  color: var(--muted);
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.page-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--burgundy-dark);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
  max-width: 100%;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .page-title {
    color: var(--burgundy-dark);
    background: none;
    -webkit-text-fill-color: unset;
  }
}

.page-title::after {
  content: '';
  display: block;
  height: 3px;
  width: 100%;
  max-width: 72px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--brand-gradient);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--burgundy-dark);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
  max-width: 100%;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .modal-title {
    color: var(--burgundy-dark);
    background: none;
    -webkit-text-fill-color: unset;
  }
}

.page-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #D0CFCA;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--burgundy-dark);
  font-family: inherit;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.06), 0 3px 8px rgba(20, 20, 24, 0.04);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  background: #FAFAF8;
  border-color: #C4C3BD;
  box-shadow: 0 2px 4px rgba(20, 20, 24, 0.08), 0 4px 12px rgba(20, 20, 24, 0.06);
}

.btn i {
  color: inherit;
  opacity: 1;
}

.btn-primary,
button.btn-primary,
.btn.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 1px 2px rgba(107, 31, 46, 0.2), 0 4px 12px rgba(107, 31, 46, 0.12);
}

.btn-primary:hover,
button.btn-primary:hover,
.btn.btn-primary:hover {
  filter: brightness(1.06);
  background: var(--brand-gradient);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
}

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

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 8px;
  box-shadow: none;
}

/* ── Cards / panels (legacy page content compatibility) ────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.03), 0 8px 24px rgba(20, 20, 24, 0.04);
}

.card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #FCFCFB;
}

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

.hidden {
  display: none !important;
}

/* ── Login screen ──────────────────────────────────────────── */

.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--page-bg);
}

.admin-login-screen[hidden] {
  display: none !important;
}

.admin-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 32px;
  box-shadow: 0 1px 2px rgba(20, 20, 24, 0.04), 0 8px 24px rgba(20, 20, 24, 0.05);
  position: relative;
}

.admin-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--brand-gradient);
}

.admin-login-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.admin-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.admin-login-brand .login-wordmark {
  height: 48px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.admin-login-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
  text-align: center;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.admin-login-hint {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

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

.admin-login-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 8px;
}

.admin-login-form input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
}

.admin-login-form input:focus {
  outline: none;
  border-color: var(--burgundy-light);
  box-shadow: 0 0 0 3px rgba(107, 31, 46, 0.12);
}

.admin-login-submit {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  background: var(--brand-gradient);
}

.admin-login-submit:hover {
  filter: brightness(1.06);
}

.admin-login-error {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--red-fg);
  background: var(--red-bg);
  padding: 8px 10px;
  border-radius: 6px;
}

.admin-app[hidden] {
  display: none !important;
}

/* ── Toast ─────────────────────────────────────────────────── */

.mojud-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(20, 20, 24, 0.12);
  max-width: 360px;
}

.mojud-toast.ok {
  background: var(--green-bg);
  color: var(--green-fg);
}

.mojud-toast.err {
  background: var(--red-bg);
  color: var(--red-fg);
}

/* ── Modal (shared) ────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107, 31, 46, 0.22), transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(154, 58, 80, 0.16), transparent 40%),
    rgba(26, 26, 30, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

/* Logout confirm — compact squared SaaS card */
.logout-confirm-backdrop {
  z-index: 3200;
}

.logout-confirm-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid rgba(154, 58, 80, 0.14);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 16px 40px rgba(107, 31, 46, 0.16),
    0 4px 12px rgba(20, 20, 24, 0.08);
  overflow: hidden;
  text-align: center;
}

.logout-confirm-profile {
  padding: 28px 24px 18px;
  background:
    linear-gradient(180deg, rgba(122, 35, 51, 0.06) 0%, transparent 70%);
}

.logout-confirm-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--tint-burgundy);
  color: var(--nav-active);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(122, 35, 51, 0.12);
  box-shadow: 0 2px 8px rgba(122, 35, 51, 0.12);
}

.logout-confirm-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--burgundy-dark);
  line-height: 1.3;
}

.logout-confirm-role {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted-warm);
  line-height: 1.35;
}

.logout-confirm-body {
  padding: 0 24px 8px;
}

.logout-confirm-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--burgundy-dark);
}

.logout-confirm-msg {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted-warm);
  line-height: 1.45;
}

.logout-confirm-actions {
  display: flex;
  justify-content: stretch;
  gap: 10px;
  padding: 18px 20px 20px;
  border-top: 1px solid rgba(107, 31, 46, 0.08);
  margin-top: 12px;
}

.logout-confirm-actions .btn {
  flex: 1;
  justify-content: center;
}

.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(154, 58, 80, 0.14);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 12px 40px rgba(107, 31, 46, 0.14),
    0 4px 12px rgba(20, 20, 24, 0.08);
  max-width: 520px;
  width: 100%;
  padding: 0;
  max-height: none;
  overflow: hidden;
}

.modal-panel::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--brand-gradient);
}

.modal-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0;
}

.modal-wordmark {
  height: 28px;
  width: auto;
  display: block;
}

.modal-brand-mark {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--burgundy-light);
  background: var(--tint-burgundy);
  border: 1px solid rgba(154, 58, 80, 0.18);
  border-radius: 999px;
  padding: 4px 9px;
}

.modal-panel-body {
  padding: 10px 20px 18px;
}

.modal-panel .modal-title {
  margin: 4px 0 10px;
  font-size: 16px;
}

.modal-panel.modal-panel-wide {
  max-width: 560px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: start;
}

.modal-form-grid .modal-span-2 {
  grid-column: 1 / -1;
}

.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
  margin-top: 0;
}

.modal-form-grid .modal-label {
  margin-top: 0;
  margin-bottom: 5px;
}

.modal-input,
.modal-panel select.modal-input {
  width: 100%;
  padding: 8px 11px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-input:focus,
.modal-panel select.modal-input:focus {
  outline: none;
  border-color: var(--burgundy-light);
  box-shadow: 0 0 0 3px rgba(107, 31, 46, 0.08);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.form-lines {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  background: #FBFBF9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-line-row {
  display: grid;
  grid-template-columns: 1fr minmax(88px, 110px) auto;
  gap: 8px;
  align-items: end;
}

.form-line-row .modal-label {
  margin-bottom: 4px;
}

.form-line-add {
  align-self: flex-start;
  margin-top: 2px;
}

@media (max-width: 560px) {
  .modal-form-grid {
    grid-template-columns: 1fr;
  }

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

/* Pagination footer */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--muted);
  background: #FBFBF9;
}

.pager-btns {
  display: flex;
  gap: 6px;
}

.pager-btns .btn-sm {
  min-width: 34px;
  justify-content: center;
  border-radius: 999px;
}

.admin-nav-tip {
  position: fixed;
  z-index: 4000;
  transform: translateY(-50%);
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(20, 20, 24, 0.22);
}

.admin-nav-tip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--ink);
}

.admin-nav-tip[hidden] {
  display: none !important;
}

/* ── SO upload reveal (Phase 4) ─────────────────────────────── */

.so-upload-reveal {
  margin: 0 0 14px;
  padding: 14px 16px 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(245, 166, 35, 0.35);
  background: var(--amber-bg);
  position: relative;
}

.so-upload-reveal[hidden] {
  display: none !important;
}

.so-reveal-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--amber-fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.so-reveal-dismiss:hover {
  background: rgba(166, 101, 15, 0.12);
}

.so-reveal-steps {
  list-style: none;
  margin: 0;
  padding: 0 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.so-reveal-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted, #6b6b70);
  min-height: 22px;
}

.so-reveal-step.is-active {
  color: var(--amber-fg);
  font-weight: 600;
}

.so-reveal-step.is-done {
  color: var(--ink);
}

.so-reveal-step.is-final {
  color: var(--ink);
  font-weight: 600;
}

.so-reveal-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(245, 166, 35, 0.35);
  border-top-color: var(--amber);
  animation: so-reveal-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.so-reveal-step:not(.is-active) .so-reveal-spinner {
  display: none;
}

.so-reveal-check {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
  display: none;
}

.so-reveal-step.is-done .so-reveal-check,
.so-reveal-step.is-final .so-reveal-check {
  display: inline-block;
}

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

.so-reveal-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.so-reveal-actions[hidden] {
  display: none !important;
}

.so-reveal-shortfall-list {
  margin: 4px 0 0;
  padding-left: 22px;
  font-size: 12px;
  font-weight: 500;
  color: var(--amber-fg);
}

/* ── PR supplier assignment (Phase 4) ───────────────────────── */

.pr-assign-panel {
  margin-top: 0;
}

.pr-assign-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 14px;
  font-size: 13px;
}

.pr-assign-meta .label {
  color: var(--muted, #6b6b70);
  margin-right: 6px;
}

.pr-assign-table select.pr-supplier-select {
  min-width: 220px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
}

.pr-assign-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pr-assign-success {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(46, 125, 50, 0.25);
  background: #eef7ee;
  font-size: 13px;
}

.pr-assign-success[hidden] {
  display: none !important;
}

.pr-assign-success a {
  color: var(--burgundy-light, #9a3a50);
  font-weight: 600;
  text-decoration: none;
}

.pr-assign-success a:hover {
  text-decoration: underline;
}
