/* Momento Portal — modern UI shell */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --sidebar: #0c1222;
  --sidebar-hover: #151d32;
  --sidebar-active: #1e293b;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: rgba(234, 88, 12, 0.12);
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --sidebar-width: 280px;
  --topbar-height: 68px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.portal-app {
  display: flex;
  min-height: 100vh;
}

.portal-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0c1222 0%, #111827 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.portal-sidebar__brand {
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-sidebar__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #fb923c);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.35);
}

.portal-sidebar__title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 1rem;
  line-height: 1.2;
}

.portal-sidebar__subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
}

.portal-sidebar__menu-search {
  padding: 0 0.75rem 0.65rem;
  flex-shrink: 0;
}

.portal-sidebar__menu-search-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.portal-sidebar__menu-search-field:focus-within {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(251, 146, 60, 0.45);
}

.portal-sidebar__menu-search-icon {
  width: 15px;
  height: 15px;
  color: #64748b;
  flex-shrink: 0;
}

.portal-sidebar__menu-search-icon svg {
  width: 15px;
  height: 15px;
}

.portal-sidebar__menu-search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

.portal-sidebar__menu-search-field input::placeholder {
  color: #64748b;
}

.portal-sidebar__menu-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.portal-sidebar__menu-search-empty {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}

.portal-sidebar__nav--filtered .portal-nav-section--tree.is-collapsed > .portal-nav-section__items,
.portal-sidebar__nav--filtered .portal-nav-subsection.is-collapsed > .portal-nav-subsection__items {
  visibility: visible;
  height: auto;
  opacity: 1;
  overflow: visible;
  margin: 0;
  padding: inherit;
}

.portal-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1.5rem;
}

.portal-nav-section {
  margin-bottom: 0.35rem;
}

.portal-nav-section__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0.5rem 0.75rem 0.35rem;
}

.portal-nav-section--tree {
  border-radius: 10px;
}

.portal-nav-section__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.portal-nav-section__toggle:hover {
  background: var(--sidebar-hover);
  color: #cbd5e1;
}

.portal-nav-section__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  flex-shrink: 0;
  color: #64748b;
}

.portal-nav-section__chevron svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.portal-nav-section--tree.is-collapsed .portal-nav-section__chevron svg {
  transform: rotate(-90deg);
}

.portal-nav-section__icon svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.75;
}

.portal-nav-section__title {
  flex: 1;
  min-width: 0;
}

.portal-nav-section__items {
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  padding: 0.2rem 0 0.35rem 0.4rem;
  margin-left: 0.65rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.03);
}

.portal-nav-section--tree.is-collapsed .portal-nav-section__items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.portal-nav-link--child {
  padding-left: 0.85rem;
}

.portal-nav-subsection {
  margin-bottom: 0.35rem;
}

.portal-nav-subsection__toggle {
  width: 100%;
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
}

.portal-nav-subsection__items {
  margin-left: 0.45rem;
  padding-left: 0.55rem;
  border-left-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
}

.portal-nav-subsection .portal-nav-link--child {
  font-size: 0.84rem;
  padding-left: 0.7rem;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.portal-nav-section__items .portal-nav-link {
  color: #cbd5e1;
}

.portal-nav-section__items .portal-nav-link svg {
  opacity: 0.92;
}

.portal-nav-link:hover,
.portal-nav-section__items .portal-nav-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.portal-nav-link.is-active {
  background: var(--primary-soft);
  color: #fdba74;
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.25);
}

.portal-nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.portal-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-topbar {
  height: var(--topbar-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.portal-topbar__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  min-width: 280px;
  color: var(--text-muted);
  font-size: 0.875rem;
  position: relative;
}

.portal-topbar__search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
}

.portal-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.portal-icon-btn:hover {
  border-color: #cbd5e1;
  color: var(--text);
}

.portal-user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
}

.portal-user-chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.portal-content {
  padding: 1.75rem;
  flex: 1;
}

/* Cards */
.portal-page-header {
  margin-bottom: 1.75rem;
}

.portal-page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.portal-page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.portal-grid {
  display: grid;
  gap: 1.25rem;
}

.portal-grid--4 { grid-template-columns: repeat(4, 1fr); }
.portal-grid--3 { grid-template-columns: repeat(3, 1fr); }
.portal-grid--2 { grid-template-columns: repeat(2, 1fr); }

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

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

.portal-topbar__menu-btn {
  display: none;
}

@media (max-width: 768px) {
  .portal-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
  }

  .portal-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .portal-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .portal-topbar__menu-btn {
    display: grid;
    flex-shrink: 0;
  }

  .portal-topbar {
    gap: 0.65rem;
    padding: 0 1rem;
  }

  .portal-topbar__search {
    min-width: 0;
    flex: 1;
  }

  .portal-main { margin-left: 0; }
  .portal-grid--4, .portal-grid--3, .portal-grid--2 { grid-template-columns: 1fr; }
}

body.portal-sidebar-open {
  overflow: hidden;
}

.portal-stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.portal-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #fb923c);
  opacity: 0;
  transition: opacity 0.2s;
}

.portal-stat-card:hover::before { opacity: 1; }

.portal-stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.portal-stat-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.portal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Data tables — zebra rows, column guides, colored headers */
.portal-table-wrap {
  padding: 0;
  overflow: hidden;
}

.portal-table-wrap--scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-pm-page--full .portal-table-wrap--scroll {
  overflow-x: visible;
}

.portal-table-wrap--scroll.portal-table-wrap--firm-ledger,
.portal-table-wrap--scroll.portal-table-wrap--bank-ledger {
  overflow-x: auto;
}

.portal-table--firm-ledger {
  width: 100%;
  min-width: 1180px;
}

.portal-financial-statement-page {
  max-width: none;
  width: 100%;
}

.portal-pm-page-sheet--financial-statement {
  padding: 1rem 1rem 1.35rem;
}

.portal-table--bank-ledger {
  width: 100%;
  min-width: 1280px;
  table-layout: auto;
}

.portal-table--bank-ledger th,
.portal-table--bank-ledger td {
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.portal-table--bank-ledger .portal-bank-ledger__receipt {
  min-width: 7.5rem;
  white-space: nowrap;
}

.portal-table--bank-ledger .portal-bank-ledger__date {
  min-width: 5.5rem;
  white-space: nowrap;
}

.portal-table--bank-ledger .portal-bank-ledger__party {
  min-width: 12rem;
  max-width: 18rem;
}

.portal-table--bank-ledger .portal-bank-ledger__desc {
  min-width: 22rem;
  max-width: none;
}

.portal-table--bank-ledger .portal-bank-ledger__money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 8.5rem;
}

.portal-table--firm-ledger th:nth-child(3),
.portal-table--firm-ledger td:nth-child(3) {
  min-width: 220px;
}

.portal-table--accounting {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.portal-table--accounting thead th,
.portal-table--accounting tbody td {
  vertical-align: middle;
  white-space: nowrap;
}

.portal-table--accounting thead th:nth-child(1),
.portal-table--accounting tbody td:nth-child(1) {
  width: 52px;
}

.portal-table--accounting .portal-table__name {
  white-space: normal;
  min-width: 9rem;
}

.portal-table--accounting .portal-table__party {
  min-width: 12rem;
  max-width: 22rem;
  white-space: normal;
}

.portal-table--accounting .portal-table__party .portal-link-btn {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

.portal-table--accounting thead th:nth-last-child(3),
.portal-table--accounting tbody td:nth-last-child(3) {
  width: 7.5rem;
}

.portal-table--accounting thead th:nth-last-child(2),
.portal-table--accounting tbody td:nth-last-child(2) {
  width: 7rem;
}

.portal-table--accounting thead th:last-child,
.portal-table--accounting tbody td:last-child {
  width: 7rem;
}

.portal-account-statement-row {
  cursor: pointer;
}

.portal-account-statement-row:hover,
.portal-account-statement-row:focus-visible {
  background: color-mix(in srgb, var(--accent, #2563eb) 6%, transparent);
  outline: none;
}

.portal-table-wrap .portal-table {
  margin: 0;
}

.portal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.portal-table thead {
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
}

.portal-table thead th {
  padding: 0.85rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3730a3;
  border-bottom: 2px solid #c7d2fe;
  border-right: 1px solid #c7d2fe;
  white-space: nowrap;
}

.portal-table thead th:last-child {
  border-right: none;
}

.portal-table tbody tr {
  transition: background 0.12s ease;
}

.portal-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.portal-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.portal-table tbody tr:hover {
  background: #fff7ed;
}

.portal-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  vertical-align: middle;
}

.portal-table tbody td:last-child {
  border-right: none;
}

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

.portal-table--colorful thead {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
}

.portal-table--colorful thead th {
  color: #92400e;
  border-bottom-color: #fcd34d;
  border-right-color: #fde68a;
}

.portal-table--colorful tbody tr:nth-child(even) {
  background: #fffbeb;
}

.portal-table--colorful tbody tr:hover {
  background: #ffedd5;
}

.portal-table--compact thead th,
.portal-table--compact tbody td {
  padding: 0.55rem 0.65rem;
  font-size: 0.85rem;
}

/* Apply readable tables across module pages */
.portal-card > table:not(.portal-table--plain),
.portal-card table[data-searchable-table]:not(.portal-table--plain) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.portal-card > table:not(.portal-table--plain) thead,
.portal-card table[data-searchable-table]:not(.portal-table--plain) thead {
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
}

.portal-card > table:not(.portal-table--plain) thead th,
.portal-card table[data-searchable-table]:not(.portal-table--plain) thead th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #3730a3;
  border-bottom: 2px solid #c7d2fe;
  border-right: 1px solid #c7d2fe;
}

.portal-card > table:not(.portal-table--plain) tbody tr:nth-child(even),
.portal-card table[data-searchable-table]:not(.portal-table--plain) tbody tr:nth-child(even) {
  background: #f8fafc;
}

.portal-card > table:not(.portal-table--plain) tbody tr:hover,
.portal-card table[data-searchable-table]:not(.portal-table--plain) tbody tr:hover {
  background: #fff7ed;
}

.portal-card > table:not(.portal-table--plain) tbody td,
.portal-card table[data-searchable-table]:not(.portal-table--plain) tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  vertical-align: middle;
}

.portal-table__id {
  font-weight: 700;
  color: #6366f1;
  font-variant-numeric: tabular-nums;
}

.portal-table__stock {
  font-weight: 700;
  text-align: center;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
}

.portal-table__name strong {
  color: #0f172a;
}

.portal-table__model {
  font-size: 0.78rem;
  color: #0369a1;
  font-weight: 600;
  margin-top: 0.15rem;
}

.portal-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.portal-warehouse-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.portal-warehouse-pill span:last-child {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
}

.portal-badge--muted {
  background: #f1f5f9;
  color: var(--text-muted);
}

/* Login */
.portal-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.portal-login__hero {
  background: linear-gradient(145deg, #0c1222 0%, #1e293b 50%, #0f172a 100%);
  color: #f8fafc;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.portal-login__hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234,88,12,0.25), transparent 70%);
  top: -100px;
  right: -100px;
}

.portal-login__hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
  position: relative;
}

.portal-login__hero p {
  color: #94a3b8;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 420px;
  position: relative;
}

.portal-login__features {
  display: grid;
  gap: 1rem;
  position: relative;
}

.portal-login__feature {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.portal-login__feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(234, 88, 12, 0.15);
  color: #fb923c;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.portal-login__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.portal-login__form-wrap {
  width: 100%;
  max-width: 400px;
}

.portal-login__form-wrap h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.portal-login__form-wrap > p {
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.portal-field {
  margin-bottom: 1.15rem;
}

.portal-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.portal-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 12px;
  border: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.portal-btn--primary {
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
}

.portal-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.35);
}

a.portal-btn {
  text-decoration: none;
}

.portal-btn--secondary {
  background: #fff;
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.portal-btn--secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.portal-btn--ghost {
  background: transparent;
  color: var(--text-muted, #64748b);
  border: 1px solid transparent;
  font-weight: 600;
}

.portal-btn--ghost:hover {
  background: #f8fafc;
  color: var(--text, #0f172a);
}

.portal-page-header .portal-btn--primary {
  width: auto;
}

.portal-login__form-wrap .portal-btn--primary {
  width: 100%;
}

.portal-alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.portal-alert--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.portal-alert--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.portal-alert--warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.portal-lang-switch {
  display: flex;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.portal-lang-switch a {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.portal-lang-switch a.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
  font-weight: 600;
}

/* Placeholder module */
.portal-coming-soon {
  text-align: center;
  padding: 4rem 2rem;
}

.portal-coming-soon__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.portal-coming-soon h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.portal-coming-soon p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

.portal-search-toolbar {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
}

.portal-search-toolbar--accounts {
  flex-direction: column;
  align-items: stretch;
}

.portal-search-toolbar--licenses .portal-search-toolbar__filter {
  min-width: 10rem;
  max-width: 14rem;
}

.portal-account-filters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.15rem;
}

.portal-account-filters__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.portal-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.portal-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.portal-filter-chip:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
}

.portal-filter-chip.is-active {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  border-color: #1e40af;
  color: #fff;
}

.portal-filter-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
}

.portal-filter-chip.is-active .portal-filter-chip__count {
  background: rgba(255, 255, 255, 0.22);
}

.portal-stock-cat-filters {
  margin-bottom: 0.85rem;
  padding: 0.85rem 0.9rem 0.75rem;
}
.portal-stock-cat-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.portal-stock-cat-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  min-width: 4.6rem;
  max-width: 6.4rem;
  padding: 0.55rem 0.4rem 0.45rem;
  border: 1px solid #d7deea;
  border-radius: 12px;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  text-align: center;
}
.portal-stock-cat-icon:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.portal-stock-cat-icon.is-active {
  border-color: #1d4ed8;
  background: linear-gradient(180deg, #1e3a8a, #2563eb);
  color: #fff;
}
.portal-stock-cat-icon__glyph {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
}
.portal-stock-cat-icon.is-active .portal-stock-cat-icon__glyph {
  background: rgba(255, 255, 255, 0.18);
}
.portal-stock-cat-icon__glyph svg {
  width: 18px;
  height: 18px;
}
.portal-stock-cat-icon__name {
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.portal-stock-cat-icon__count {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
}
.portal-stock-cat-icon.is-active .portal-stock-cat-icon__count {
  color: #dbeafe;
}
.portal-stock-cat-filters__subs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e5eaf2;
}
.portal-stock-cat-icon--me {
  border-color: #93c5fd;
  background: #eff6ff;
}
.portal-stock-cat-icon--me .portal-stock-cat-icon__name {
  color: #1d4ed8;
}
.portal-stock-cat-icon--me.is-active .portal-stock-cat-icon__name {
  color: #fff;
}
.portal-stock-cat-filters__me-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e5eaf2;
  font-size: 0.85rem;
  color: #475569;
}

.portal-search-field__wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.portal-search-field__icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.portal-search-field__wrap input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font: inherit;
  color: var(--text);
  min-width: 0;
}

.portal-search-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-search-field__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: portal-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.portal-search-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow: auto;
  z-index: 50;
  padding: 0.35rem;
}

.portal-search-panel__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  font-size: 0.875rem;
}

.portal-search-panel__item:hover {
  background: var(--bg);
}

.portal-search-panel__type {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  font-weight: 700;
}

.portal-search-panel__label {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-search-panel__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.portal-search-panel__empty {
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

[data-searchable-table] tr[hidden],
[data-searchable-table] li[hidden],
.portal-search-item[hidden] {
  display: none;
}

.portal-role-switcher--topbar {
  margin-right: 0.35rem;
  gap: 0.35rem;
}

.portal-role-switcher--topbar .portal-role-switcher__btn {
  width: auto;
  min-height: 2.25rem;
  padding: 0.35rem 0.55rem;
  gap: 0.35rem;
}

.portal-role-switcher__label {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.portal-role-switcher__btn.is-static {
  cursor: default;
  pointer-events: none;
}

.portal-dashboard-role-switcher--top .portal-role-switcher__btn.is-static {
  opacity: 1;
}

.portal-role-switcher {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.portal-role-switcher__btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.portal-role-switcher__btn.is-active,
.portal-role-switcher__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.portal-stat-card--link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.portal-stat-card--link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.portal-thumb-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 8px;
}

.portal-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.portal-thumb--empty {
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text-muted);
}

.portal-modal[hidden] { display: none; }

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.portal-modal:has(.portal-modal__panel--proforma) {
  padding: 0.35rem;
}

.portal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.portal-modal__panel {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.portal-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.portal-modal__gallery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.portal-modal__img {
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.portal-modal__title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.portal-modal__panel--stock-card {
  max-width: 920px;
}

.portal-modal__panel--stock-card #portal-detail-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.portal-stock-card-modal--quick-add {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.portal-stock-card-modal--quick-add .portal-stock-card-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.portal-stock-card-form__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 1.25rem 1rem;
}

.portal-stock-card-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated, #fff);
  flex-shrink: 0;
}

.portal-proforma-line__cell--stock .portal-entity-picker-row__add--compact {
  min-width: 2.1rem;
  padding: 0 0.4rem;
}

.portal-stock-card-modal__strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.portal-stock-card-modal__strip-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  pointer-events: none;
}

.portal-image-zoom-btn {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  cursor: zoom-in;
  display: block;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
}

.portal-image-zoom-btn:hover .portal-stock-card-modal__strip-img,
.portal-image-zoom-btn:hover .portal-stock-card-images__preview {
  opacity: 0.92;
}

.portal-stock-card-images__preview-wrap .portal-image-zoom-btn {
  width: 100%;
  height: 100%;
}

.portal-stock-card-images__preview-wrap .portal-stock-card-images__preview {
  width: 100%;
  height: 72px;
  pointer-events: none;
}

.portal-image-lightbox[hidden] {
  display: none;
}

.portal-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.portal-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  cursor: zoom-out;
}

.portal-image-lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1280px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0 3.5rem;
}

.portal-image-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0.15rem;
  transition: background 0.15s;
}

.portal-image-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.portal-image-lightbox__nav--prev {
  left: 0;
}

.portal-image-lightbox__nav--next {
  right: 0;
}

.portal-image-lightbox__nav[hidden] {
  display: none;
}

.portal-image-lightbox__counter {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 600;
}

.portal-image-lightbox__img {
  max-width: 100%;
  max-height: calc(92vh - 2.5rem);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  background: #111;
}

.portal-image-lightbox__caption {
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.portal-image-lightbox__thumbs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(92vw, 920px);
}
.portal-image-lightbox__thumb {
  width: 3.2rem;
  height: 3.2rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  background: #111;
  overflow: hidden;
  cursor: pointer;
}
.portal-image-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portal-image-lightbox__thumb.is-on { border-color: #fff; }
.portal-image-lightbox__vitrin { margin-top: 0.15rem; }

.portal-image-lightbox__close {
  position: absolute;
  top: -2.25rem;
  right: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.portal-image-lightbox__close:hover {
  opacity: 1;
}

.portal-stock-card-modal__header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.portal-stock-card-modal__hero {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 55%, #fff 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.portal-stock-card-modal__hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  flex-shrink: 0;
}

.portal-stock-card-modal__hero-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.portal-stock-card-modal__hero-copy {
  flex: 1;
  min-width: 0;
}

.portal-stock-card-modal__title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.portal-stock-card-modal__subtitle {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.portal-stock-card-modal__hero-close {
  flex-shrink: 0;
  margin-left: auto;
}

.portal-stock-card-form__sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-stock-card-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.portal-stock-card-section--compact {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.portal-stock-card-section__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.portal-stock-card-section__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  background: var(--bg);
  color: #0f766e;
  flex-shrink: 0;
}

.portal-stock-card-section__icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.portal-stock-card-section__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-stock-card-option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-stock-card-option-card:hover {
  border-color: #99f6e4;
}

.portal-stock-card-option-card:has(input:checked) {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  background: #f0fdfa;
}

.portal-stock-card-option-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.portal-stock-card-option-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.portal-stock-card-option-card__hint {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.portal-stock-card-advanced {
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}

.portal-stock-card-advanced__summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.portal-stock-card-advanced__summary::-webkit-details-marker {
  display: none;
}

.portal-stock-card-advanced__icon {
  display: inline-flex;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.portal-stock-card-advanced[open] .portal-stock-card-advanced__icon {
  transform: rotate(180deg);
}

.portal-stock-card-advanced__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}

.portal-stock-card-file-field__wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.portal-stock-card-file-field__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
}

.portal-stock-card-file-field__wrap input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  max-width: 220px;
}

.portal-stock-card-modal--embedded {
  display: block;
}

.portal-stock-card-modal--embedded .portal-stock-card-modal__hero {
  margin: -1rem -1rem 0;
  border-radius: 12px 12px 0 0;
}

.portal-stock-card-modal--embedded .portal-stock-card-form__scroll {
  padding: 1rem 0 0;
}

.portal-stock-card-modal--embedded .portal-stock-card-modal__footer {
  padding: 0.85rem 0 0;
  margin-top: 0.85rem;
  border-top: 1px solid var(--border);
  background: transparent;
}

.portal-stock-card-create-panel {
  margin-bottom: 1rem;
  overflow: hidden;
}

.portal-stock-cards-toolbar {
  margin: 0;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.portal-stock-cards-toolbar__badge {
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
}

.portal-stock-cards-stats {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-stock-cards-stats .portal-stat-card {
  flex: 1;
  min-width: 120px;
  margin: 0;
}

.portal-warehouse-value__title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}
.portal-warehouse-value__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1rem;
  align-items: start;
}
.portal-warehouse-value .portal-stat-card__value small {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-muted);
}
.portal-warehouse-value .portal-stat-card__value--date {
  font-size: 1.15rem;
}
@media (max-width: 960px) {
  .portal-warehouse-value__grid { grid-template-columns: 1fr; }
}

.portal-stat-card--highlight {
  outline: 2px solid #f59e0b;
}

.portal-stat-card__value--warn {
  color: #b45309;
}

.portal-stock-cards-search {
  margin-bottom: 1rem;
}

.portal-search-field--grow {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.portal-stock-cards-pagination {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.portal-stock-cards-pagination__meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.portal-stock-card-modal--quick-add .portal-stock-card-section .portal-package-picker {
  width: 100%;
}

.portal-stock-card-modal--quick-add .portal-package-picker__combo {
  flex: 1;
  min-width: 0;
}

.portal-stock-card-modal__meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-stock-card-modal__count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-stock-card-modal__datasheet {
  margin: 0 0 0.65rem;
}

.portal-stock-card-form--modal {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-form-grid {
  display: grid;
  gap: 0.75rem;
}

.portal-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.portal-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
}

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

.portal-form-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.portal-input,
.portal-form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.portal-entity-picker__query),
.portal-form-field select,
.portal-form-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-input:focus,
.portal-form-field input:focus,
.portal-form-field select:focus,
.portal-form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.portal-input:disabled,
.portal-form-field input:disabled,
.portal-form-field select:disabled {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.portal-form-field textarea,
textarea.portal-input {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.5;
}

.portal-stock-card-form--modal input[type="text"],
.portal-stock-card-form--modal select,
.portal-stock-card-form--modal textarea,
.portal-stock-card-form--modal input[type="file"]:not(.portal-stock-card-images__input) {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  box-sizing: border-box;
}

.portal-stock-card-form--modal textarea {
  resize: vertical;
  min-height: 5rem;
}

.portal-form-section {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-form-section__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-stock-card-form__submit {
  width: 100%;
  margin-top: 0.25rem;
}

.portal-stock-card-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .portal-stock-card-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-stock-card-images__slot {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.portal-stock-card-images__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-stock-card-images__preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--surface);
  overflow: hidden;
}

.portal-stock-card-images__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-stock-card-images__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.45;
}

.portal-stock-card-images__empty svg {
  width: 1.25rem;
  height: 1.25rem;
}

.portal-stock-card-images__input {
  width: 100%;
  max-width: 100%;
  font-size: 0.72rem;
  box-sizing: border-box;
}

.portal-modal__gallery--labeled {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
}

.portal-modal__fig {
  margin: 0;
  text-align: center;
}

.portal-modal__fig figcaption {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.portal-modal__fig--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.portal-modal__subtitle {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.portal-role-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.35rem;
}

.portal-role-check {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.warehouse-row-saving {
  opacity: 0.55;
  pointer-events: none;
}

/* Warehouse map — scrollable table, compact assign column */
.portal-warehouse-map {
  width: 100%;
  max-width: 100%;
}

.portal-warehouse-stats__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}

.portal-warehouse-stats__grid .portal-stat-card {
  flex: 0 1 auto;
  min-width: 96px;
  max-width: 150px;
}

.portal-stat-card--active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.portal-stat-card--warn {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
}

.portal-search-toolbar--warehouse {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
}

.portal-search-toolbar--warehouse .portal-search-field {
  grid-column: 1 / -1;
  margin: 0;
}

.portal-search-toolbar--warehouse .portal-field {
  margin: 0;
  min-width: 0;
}

.portal-warehouse-bulk-bar {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
}

.portal-warehouse-bulk-bar__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin: 0;
}

.portal-warehouse-bulk-bar__form .portal-field {
  margin: 0;
  min-width: 120px;
}

.portal-warehouse-bulk-bar__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  align-self: center;
}

.portal-table-wrap--warehouse-map {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.portal-table--warehouse-map {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
  font-size: 0.82rem;
}

.portal-table--warehouse-map thead th,
.portal-table--warehouse-map tbody td {
  padding: 0.45rem 0.35rem;
  vertical-align: top;
  overflow: hidden;
}

.portal-table--warehouse-map .warehouse-map-col-check { width: 34px; }
.portal-table--warehouse-map .warehouse-map-col-web { width: 46px; text-align: center; }
.portal-table--warehouse-map .warehouse-map-col-id { width: 52px; }
.portal-table--warehouse-map .warehouse-map-col-code { width: 88px; }
.portal-table--warehouse-map .warehouse-map-col-name { width: 120px; }
.portal-table--warehouse-map .warehouse-map-col-warranty { width: 132px; }
.portal-table--warehouse-map .warehouse-map-col-category { width: 118px; }
.portal-table--warehouse-map .warehouse-map-col-state { width: 118px; }
.portal-table--warehouse-map .warehouse-map-col-assign { width: 188px; }
.portal-table--warehouse-map .warehouse-map-col-current { width: 108px; }

.warehouse-map-row--unassigned {
  background: #fffbeb;
}

.warehouse-map-name-btn {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  word-break: break-word;
}

.warehouse-map-col-code code {
  font-size: 0.78rem;
  word-break: break-all;
}

.portal-table--warehouse-map .inventory-warranty-form,
.portal-table--warehouse-map .stock-category-form,
.portal-table--warehouse-map .inventory-state-form {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.portal-table--warehouse-map .inventory-warranty-form input,
.portal-table--warehouse-map .inventory-warranty-form select,
.portal-table--warehouse-map .stock-category-form select,
.portal-table--warehouse-map .inventory-state-form select {
  width: 100%;
  max-width: 100%;
  font-size: 0.76rem;
}

.warehouse-assign-form {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.warehouse-assign-form select,
.warehouse-assign-form input[type="text"],
.warehouse-assign-form input[type="number"] {
  width: 100%;
  max-width: 100%;
  font-size: 0.78rem;
  box-sizing: border-box;
}

.warehouse-assign-form__shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
}

.warehouse-assign-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.warehouse-assign-save-btn {
  flex: 0 0 auto;
  min-width: 4.5rem;
}

.warehouse-save-hint {
  display: none;
  font-size: 0.72rem;
  color: #16a34a;
  font-weight: 600;
}

.warehouse-save-hint.is-visible {
  display: inline;
}

.warehouse-current-name {
  display: block;
  font-size: 0.8rem;
  line-height: 1.3;
  word-break: break-word;
}

.warehouse-current-name--missing {
  color: #b45309;
  font-weight: 600;
}

.warehouse-current-meta {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}

.portal-table--warehouse-map .portal-search-empty td {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .portal-warehouse-bulk-bar__form {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-warehouse-bulk-bar__form .portal-btn {
    width: 100%;
  }
}

.portal-cat-popover[hidden] {
  display: none;
}

.portal-cat-popover {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.portal-cat-popover:not([hidden]) {
  pointer-events: auto;
}

.portal-cat-popover__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: default;
}

.portal-cat-popover__panel {
  position: fixed;
  z-index: 1201;
  width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.portal-cat-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.portal-cat-popover__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.portal-cat-popover__close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
}

.portal-cat-popover__body form {
  display: grid;
  gap: 0.45rem;
}

.portal-cat-popover__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-cat-popover__body .portal-input {
  width: 100%;
  font-size: 0.82rem;
  box-sizing: border-box;
}

.portal-cat-popover__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.portal-cat-popover__msg {
  font-size: 0.75rem;
}

.portal-cat-popover__msg.is-success {
  color: #16a34a;
}

.portal-cat-popover__msg.is-error {
  color: #dc2626;
}

.portal-cat-popover__foot {
  margin: 0.55rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.stock-category-form {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.stock-category-form__field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem;
  align-items: center;
}

.stock-cat-quick-trigger {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.stock-cat-quick-trigger:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.stock-category-save-hint {
  display: none;
  font-size: 0.72rem;
  color: #16a34a;
  font-weight: 600;
}

.stock-category-save-hint.is-visible {
  display: inline;
}

@media (max-width: 900px) {
  .portal-login { grid-template-columns: 1fr; }
  .portal-login__hero { display: none; }
}

.portal-btn--active {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
}

.portal-dup-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-dup-group {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.portal-dup-group__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.portal-dup-group__actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.portal-dup-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.portal-dup-badge--count {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* Inventory status */
.inventory-status-select,
.inventory-availability-select {
  width: 100%;
  min-width: 120px;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background-color: #f8fafc;
  color: #334155;
}

.portal-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-status--unset,
.inventory-status-select.portal-status--unset {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.portal-status--brand-new,
.inventory-status-select.portal-status--brand-new {
  background: #ecfdf5;
  border-color: #34d399;
  color: #047857;
}

.portal-status--new,
.inventory-status-select.portal-status--new {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.portal-status--on-rent,
.inventory-status-select.portal-status--on-rent {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

.portal-status--on-demo,
.inventory-status-select.portal-status--on-demo {
  background: #f3e8ff;
  border-color: #c084fc;
  color: #7e22ce;
}

.portal-status--on-repair,
.inventory-status-select.portal-status--on-repair {
  background: #ffedd5;
  border-color: #fb923c;
  color: #c2410c;
}

.portal-status--on-rd,
.inventory-status-select.portal-status--on-rd {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #3730a3;
}

.portal-inventory-use__results,
.portal-inventory-use__unit-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
  margin: 0.35rem 0 0.75rem;
}

.portal-inventory-use__hit,
.portal-inventory-use__unit {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.portal-inventory-use__hit span,
.portal-inventory-use__unit span {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  font-weight: 400;
}

.portal-choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 0.65rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  background: #fff;
}

.portal-choice-chip input {
  margin: 0;
}

.portal-serial-history__item--usage {
  border-left: 3px solid #6366f1;
}

.portal-status--repaired,
.inventory-status-select.portal-status--repaired {
  background: #ccfbf1;
  border-color: #2dd4bf;
  color: #0f766e;
}

.portal-status--refurbished,
.inventory-status-select.portal-status--refurbished {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #6d28d9;
}

.portal-status--sold,
.inventory-status-select.portal-status--sold {
  background: #fce7f3;
  border-color: #f472b6;
  color: #9d174d;
}

.portal-status--sold-out,
.inventory-status-select.portal-status--sold-out {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #475569;
}

.portal-status--on-sale,
.inventory-status-select.portal-status--on-sale {
  background: #dcfce7;
  border-color: #4ade80;
  color: #15803d;
}

.portal-status--defected,
.inventory-status-select.portal-status--defected {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-footer__version {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
}

.portal-version-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  box-shadow: var(--shadow);
}

.portal-version-badge__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-version-badge__value {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.portal-login__version {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Inventory condition (Kondisyon) */
.inventory-condition-select,
.inventory-availability-select {
  width: 100%;
  min-width: 118px;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.portal-condition--unset,
.inventory-condition-select.portal-condition--unset {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.portal-condition--brand-new,
.inventory-condition-select.portal-condition--brand-new {
  background: #ecfdf5;
  border-color: #34d399;
  color: #047857;
}

.portal-condition--refurbished,
.inventory-condition-select.portal-condition--refurbished {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #6d28d9;
}

.portal-condition--repaired,
.inventory-condition-select.portal-condition--repaired {
  background: #ccfbf1;
  border-color: #2dd4bf;
  color: #0f766e;
}

.portal-condition--defected,
.inventory-condition-select.portal-condition--defected {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

.portal-condition--abandoned,
.inventory-condition-select.portal-condition--abandoned {
  background: #f5f5f4;
  border-color: #a8a29e;
  color: #57534e;
}

.portal-state-summary {
  font-weight: 600;
  color: var(--text);
}

.inventory-warranty-select,
.inventory-serial-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
}

.inventory-warranty-form {
  display: grid;
  gap: 0.35rem;
  min-width: 130px;
}

.inventory-warranty-form__dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.inventory-warranty-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.inventory-warranty-save-hint,
.inventory-state-save-hint {
  display: none;
  font-size: 0.75rem;
  color: #16a34a;
}

.inventory-warranty-save-hint.is-visible,
.inventory-state-save-hint.is-visible {
  display: inline;
}

.inventory-state-form {
  display: grid;
  gap: 0.35rem;
  min-width: 110px;
}

.inventory-warranty-select {
  font-weight: 700;
  border-width: 2px;
  border-radius: 999px;
}

.portal-warranty--unset,
.inventory-warranty-select.portal-warranty--unset {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.portal-warranty--original,
.inventory-warranty-select.portal-warranty--original {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.portal-warranty--momento,
.inventory-warranty-select.portal-warranty--momento {
  background: #ffedd5;
  border-color: #fb923c;
  color: #c2410c;
}

.portal-warranty--expired,
.inventory-warranty-select.portal-warranty--expired {
  background: #f5f5f4;
  border-color: #a8a29e;
  color: #57534e;
}

.portal-inventory-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.25rem;
}

.portal-inventory-modal__actions .portal-btn--primary {
  margin-left: auto;
}

.portal-inventory-modal__warranty-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-serial-history {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 720px;
}

.portal-serial-history__item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.portal-serial-history__item--rma {
  border-left: 4px solid #6366f1;
}

.portal-serial-history__item--inventory {
  border-left: 4px solid #16a34a;
}

.portal-serial-history__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-serial-history__type {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.portal-serial-history__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.portal-serial-history__title a {
  color: inherit;
  text-decoration: none;
}

.portal-serial-history__title a:hover {
  text-decoration: underline;
}

.portal-serial-history__subtitle,
.portal-serial-history__status,
.portal-serial-history__zone {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .portal-serial-history__item {
    grid-template-columns: 1fr;
  }
}

.portal-barcode-profile {
  margin-top: 1rem;
}

.portal-barcode-profile__head {
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.portal-barcode-profile__match {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-barcode-profile__title {
  margin: 0;
  font-size: 1.25rem;
}

.portal-barcode-profile__subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.portal-barcode-profile__qr {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #fff;
}

.portal-barcode-profile__photos {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.portal-barcode-profile__photo {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.portal-barcode-profile__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-barcode-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.portal-barcode-detail-grid__full {
  grid-column: 1 / -1;
}

.portal-barcode-detail-grid span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.portal-barcode-detail-grid strong {
  font-size: 0.92rem;
}

.portal-barcode-profile__notes {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.portal-barcode-profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.portal-barcode-units__title {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
}

.portal-goods-history__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.portal-goods-history__header .portal-card__title {
  margin: 0;
  flex: 1;
}

.portal-goods-history__serial {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.portal-goods-history__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-goods-history__note {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .portal-barcode-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Customers */
.portal-table--customers .portal-table__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.portal-thumb--firm {
  object-fit: cover;
  background: linear-gradient(135deg, #e0e7ff, #f8fafc);
}

.portal-thumb--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4338ca;
  letter-spacing: 0.02em;
}

.customer-row--suspended {
  opacity: 0.72;
}

.portal-row-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.portal-btn--has-doc {
  color: #047857;
  background: #ecfdf5;
}

.portal-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-doc-list__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fafafa;
}

.portal-doc-list__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.portal-doc-list__meta {
  grid-column: 1;
  font-size: 0.85rem;
  color: #6b7280;
}

.portal-doc-list__delete {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}

.portal-icon-btn--danger {
  color: #b91c1c;
}

.portal-icon-btn--commission { color: #b45309; }
.portal-icon-btn--reward { color: #15803d; }
.portal-icon-btn--penalty { color: #b91c1c; }

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.portal-tabs__link {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}
.portal-tabs__link--active {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.portal-modal__panel--narrow { max-width: 28rem; }

.portal-badge--soft {
  background: #eef2ff;
  color: #4338ca;
}

.portal-modal__panel--firm,
.portal-modal__panel--user {
  max-width: 880px;
  max-height: 90vh;
  height: min(90vh, 920px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #fcd34d;
  box-shadow: 0 24px 60px rgba(234, 88, 12, 0.15), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.portal-modal__panel--firm #portal-detail-modal-body,
.portal-modal__panel--user #portal-detail-modal-body,
.portal-modal__panel--account #portal-detail-modal-body,
.portal-modal__panel--proforma #portal-detail-modal-body,
.portal-modal__panel--company #portal-detail-modal-body,
.portal-modal__panel--service-catalog #portal-detail-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.portal-modal__panel--user {
  border-color: #a5b4fc;
  box-shadow: 0 24px 60px rgba(99, 102, 241, 0.18), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.portal-firm-modal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.portal-firm-modal__hero {
  position: relative;
  padding: 1.35rem 1.5rem 1.15rem;
  overflow: hidden;
  flex-shrink: 0;
}

.portal-firm-modal__hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, #ea580c 0%, #f97316 38%, #6366f1 100%);
  opacity: 1;
}

.portal-firm-modal__hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(0, 0, 0, 0.12) 0%, transparent 40%);
}

.portal-firm-modal__hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.portal-firm-modal__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.portal-firm-modal__logo {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.25);
  background: #fff;
}

.portal-firm-modal__logo.portal-thumb--initials,
.portal-firm-modal__logo.portal-thumb--firm {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  font-size: 1.55rem;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(145deg, #fff 0%, #fef3c7 100%);
  color: #c2410c;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.25);
}

.portal-firm-modal__logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.portal-firm-modal__logo-btn:hover {
  background: #fff;
}

.portal-firm-modal__headline {
  flex: 1;
  min-width: 0;
  color: #fff;
  padding-top: 0.15rem;
}

.portal-firm-modal__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.portal-firm-modal__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.portal-firm-modal__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
}

.portal-firm-modal__subtitle--muted {
  opacity: 0.85;
  font-size: 0.82rem;
}

.portal-firm-modal__hero .portal-badge--success {
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.portal-firm-modal__hero .portal-badge--muted {
  background: rgba(15, 23, 42, 0.45);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.portal-firm-modal__stats {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, #fffbeb 0%, #fff7ed 100%);
  border-bottom: 1px solid #fed7aa;
}

.portal-firm-stat {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
  min-width: 0;
}

.portal-firm-stat__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.portal-firm-stat__icon svg {
  width: 1rem;
  height: 1rem;
}

.portal-firm-stat__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.1rem;
}

.portal-firm-stat__value {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.portal-firm-stat--sales {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.portal-firm-stat--sales .portal-firm-stat__icon {
  background: #6366f1;
  color: #fff;
}

.portal-firm-stat--support {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.portal-firm-stat--support .portal-firm-stat__icon {
  background: #06b6d4;
  color: #fff;
}

.portal-firm-stat--contracts {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.portal-firm-stat--contracts .portal-firm-stat__icon {
  background: #10b981;
  color: #fff;
}

.portal-firm-stat--tickets {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.portal-firm-stat--tickets .portal-firm-stat__icon {
  background: #f97316;
  color: #fff;
}

.portal-firm-stat--debit {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.portal-firm-stat--debit .portal-firm-stat__icon {
  background: #ef4444;
  color: #fff;
}

.portal-firm-stat--credit {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.portal-firm-stat--credit .portal-firm-stat__icon {
  background: #10b981;
  color: #fff;
}

.portal-firm-modal-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0;
  padding: 0;
  background: #f8fafc;
}

.portal-firm-modal-form__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-firm-modal__card {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 1rem 1rem 0.85rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.portal-firm-modal__card--company {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
}

.portal-firm-modal__card--owner {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

.portal-firm-modal__card--assign {
  border-color: #fde68a;
  background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}

.portal-firm-modal__card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-firm-modal__card-title svg {
  width: 1rem;
  height: 1rem;
}

.portal-firm-modal__card--company .portal-firm-modal__card-title { color: #4338ca; }
.portal-firm-modal__card--owner .portal-firm-modal__card-title { color: #0369a1; }
.portal-firm-modal__card--assign .portal-firm-modal__card-title { color: #b45309; }

.portal-firm-modal-form input[type="text"],
.portal-firm-modal-form input[type="email"],
.portal-firm-modal-form input[type="url"],
.portal-firm-modal-form input[type="number"],
.portal-firm-modal-form input[type="password"],
.portal-firm-modal-form select,
.portal-firm-modal-form textarea {
  width: 100%;
  padding: 0.62rem 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-firm-modal-form input:focus,
.portal-firm-modal-form select:focus,
.portal-firm-modal-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.portal-firm-modal-form input:disabled,
.portal-firm-modal-form select:disabled,
.portal-firm-modal-form textarea:disabled {
  background: #f1f5f9;
  color: var(--text-muted);
}

.portal-firm-modal-form textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.portal-firm-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.85rem 1.25rem;
  margin: 0;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-top: 2px solid #fdba74;
}

.portal-firm-modal__footer .portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-firm-modal__footer .portal-btn svg {
  width: 1rem;
  height: 1rem;
}

.portal-btn--warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.portal-btn--warning:hover {
  background: #fde68a;
}

@media (max-width: 768px) {
  .portal-firm-modal__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-firm-modal__hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .portal-firm-modal__title-row {
    justify-content: center;
  }
}

/* Users module — mirrors customer table + modal styling */
.portal-table--users .portal-table__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.portal-user-modal .portal-firm-modal__logo.portal-thumb--user {
  width: 72px;
  height: 72px;
}

.portal-user-modal__avatar-btn {
  border-radius: 12px;
}

.portal-user-modal__avatar-btn .portal-thumb--user {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  cursor: zoom-in;
}

.portal-table--users .portal-thumb--user.portal-thumb--initials {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}


.user-row--inactive {
  opacity: 0.72;
}

.portal-table--users .portal-ticket-row-main td {
  padding-bottom: 0.35rem;
  border-bottom: none;
}

.portal-table--users .portal-ticket-row-main:hover td {
  background: #f8fafc;
}

.portal-table--users .portal-ticket-row-toolbar td {
  padding-top: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #fafbfc;
}

.portal-table--users .portal-ticket-row-main:hover + .portal-user-row-toolbar td,
.portal-table--users .portal-user-row-toolbar:hover td {
  background: #f1f5f9;
}

.portal-user-row-toolbar .portal-ticket-row-toolbar__inner {
  padding-left: 3.25rem;
}

.portal-user-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 45%, #8b5cf6 100%);
}

.portal-user-modal .portal-firm-modal__hero-bg::after {
  background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.22) 0%, transparent 55%);
}

.portal-user-modal .portal-firm-modal__footer {
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  border-top-color: #a5b4fc;
  margin: 0;
}

.portal-user-modal .portal-firm-modal__card--company .portal-firm-modal__card-title { color: #4338ca; }
.portal-user-modal .portal-firm-modal__card--owner .portal-firm-modal__card-title { color: #0369a1; }
.portal-user-modal .portal-firm-modal__card--assign .portal-firm-modal__card-title { color: #7c3aed; }

.portal-user-modal .portal-role-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.45rem 0.75rem;
}

.portal-user-modal-form input[type="password"] {
  width: 100%;
  padding: 0.62rem 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}

.portal-user-modal-form input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Proforma / quotes module */
.portal-page-header--proforma {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-btn--inline {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-modal__panel--proforma {
  max-width: min(98vw, 1720px);
  max-height: 96vh;
  height: min(96vh, 1120px);
  width: min(98vw, 1720px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-color: #93c5fd;
}

.portal-proforma-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #1e3a5f 0%, #2563eb 50%, #0ea5e9 100%);
}

.portal-proforma-modal .portal-firm-modal__footer {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-top-color: #93c5fd;
}

.portal-accounting-gib-submit-status,
.portal-accounting-save-status {
  font-size: 0.82rem;
  margin-left: 0.35rem;
  color: #1e40af;
  flex: 1 1 100%;
  min-width: 0;
}

.portal-accounting-gib-submit-status.is-error,
.portal-accounting-save-status.is-error {
  color: #b91c1c;
}

.portal-accounting-gib-submit-status.is-ok,
.portal-accounting-save-status.is-ok {
  color: #15803d;
}

.portal-thumb--proforma {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

.portal-thumb--invoice {
  background: linear-gradient(135deg, #9a3412, #ea580c);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

.portal-thumb--irsaliye {
  background: linear-gradient(135deg, #14532d, #16a34a);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

.portal-row-actions__form {
  display: inline-flex;
  margin: 0;
}

.portal-table--accounting tbody tr.accounting-row--cancelled {
  opacity: 0.72;
}

.portal-proforma-progress {
  position: relative;
  height: 22px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.portal-proforma-progress--hero {
  margin: 0 1.25rem 0.5rem;
  flex-shrink: 0;
}

.portal-proforma-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.portal-proforma-progress__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f172a;
}

.portal-proforma-totals {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #cbd5e1;
  display: grid;
  gap: 0.25rem;
  max-width: 280px;
  margin-left: auto;
  font-size: 0.85rem;
}

.portal-proforma-totals div {
  display: flex;
  justify-content: space-between;
}

.portal-proforma-totals__grand {
  font-weight: 800;
  color: #1e40af;
  font-size: 0.95rem;
  border-top: 2px solid #1e40af;
  padding-top: 0.35rem;
  margin-top: 0.25rem;
}

.portal-proforma-line {
  padding: 0.65rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.portal-proforma-lines-table--irsaliye .portal-proforma-lines-table__head,
.portal-proforma-lines-table--irsaliye .portal-proforma-line--compact {
  grid-template-columns: 28px minmax(88px, 1.1fr) minmax(120px, 2fr) minmax(140px, 1.3fr) 52px minmax(76px, 0.65fr) 34px;
  min-width: 680px;
}

.portal-accounting-modal--irsaliye.portal-accounting-modal--edit .portal-proforma-modal__split {
  flex-direction: column;
}

.portal-accounting-modal--irsaliye.portal-accounting-modal--edit .portal-proforma-preview-pane {
  display: none;
}

.portal-accounting-modal--irsaliye.portal-accounting-modal--edit .portal-proforma-modal__edit {
  flex: 1 1 100%;
  min-width: 0;
}

.portal-accounting-modal--irsaliye .portal-demo-photos--compact {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit {
  min-width: 0;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit--collapsible {
  border: 1px solid var(--border, #dbeafe);
  border-radius: 10px;
  background: var(--surface-muted, #f8fbff);
  overflow: hidden;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit-summary::-webkit-details-marker {
  display: none;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit-body,
.portal-accounting-modal--irsaliye .portal-demo-photos__unit:not(.portal-demo-photos__unit--collapsible) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
  padding: 0 0.75rem 0.75rem;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit:not(.portal-demo-photos__unit--collapsible) {
  padding-top: 0;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__unit-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.portal-accounting-modal--irsaliye .portal-stock-card-images__slot {
  padding: 0.45rem;
  min-width: 0;
}

.portal-accounting-modal--irsaliye .portal-stock-card-images__preview-wrap {
  height: 52px;
}

.portal-accounting-modal--irsaliye .portal-stock-card-images__label {
  font-size: 0.64rem;
  line-height: 1.15;
}

.portal-accounting-modal--irsaliye .portal-demo-photo-upload {
  width: 100%;
  justify-content: center;
  font-size: 0.66rem;
  padding: 0.18rem 0.3rem;
}

.portal-accounting-modal--irsaliye .portal-demo-photos__hint {
  margin: 0 0 0.35rem;
}

.portal-accounting-modal--irsaliye .portal-proforma-preview-pane {
  flex: 0 0 min(34vh, 340px);
}

@media (max-width: 960px) {
  .portal-accounting-modal--irsaliye .portal-proforma-modal__split {
    flex-direction: column;
  }

  .portal-accounting-modal--irsaliye .portal-proforma-preview-pane {
    flex: 0 0 min(32vh, 320px);
    min-width: 0;
    border-left: 0;
    border-top: 1px solid #93c5fd;
  }
}

.portal-mobile-accounting-embed {
  max-width: 100%;
  margin: 0 auto;
}

.portal-mobile-accounting-embed__body {
  min-height: calc(100vh - 4.5rem);
}

body.portal-mobile-embed .portal-mobile-accounting-embed .portal-accounting-modal,
body.portal-mobile-embed .portal-mobile-accounting-embed .portal-proforma-modal {
  min-height: calc(100vh - 4.5rem);
}

body.portal-mobile-embed .portal-mobile-accounting-embed .portal-proforma-modal__split {
  flex-direction: column;
}

body.portal-mobile-embed .portal-mobile-accounting-embed .portal-proforma-modal__preview {
  display: none;
}

.portal-proforma-lines-table {
  overflow-x: auto;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #fff;
}

.portal-proforma-lines-table__head,
.portal-proforma-line--compact {
  display: grid;
  grid-template-columns: 28px minmax(88px, 1.1fr) minmax(120px, 2fr) minmax(140px, 1.3fr) 52px minmax(76px, 0.65fr) 88px 52px 52px 80px 34px;
  gap: 0.35rem;
  align-items: center;
  min-width: 1040px;
}

.portal-proforma-lines-table__head {
  padding: 0.45rem 0.55rem;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-bottom: 1px solid #bfdbfe;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e40af;
}

.portal-proforma-line--compact {
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.portal-proforma-line--compact:last-child {
  border-bottom: none;
}

.portal-proforma-line--compact:nth-child(even) {
  background: #f8fbff;
}

.portal-inventory-unit-fields__slots {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-inventory-unit-fields__slot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem;
  align-items: center;
}

.portal-inventory-unit-fields__slot-label {
  font-size: 0.62rem;
  color: #64748b;
  white-space: nowrap;
}

.portal-inventory-unit-fields__purpose {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  padding: 0.2rem 0.35rem;
}

.portal-rental-unit-assignments__line {
  padding: 0.65rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.portal-rental-unit-assignments__line:last-child {
  border-bottom: none;
}

.portal-rental-unit-assignments__line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.portal-proforma-line__num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

.portal-proforma-line__cell {
  margin: 0;
  min-width: 0;
}

.portal-proforma-line__cell input,
.portal-proforma-line__cell select,
.portal-proforma-line__cell .portal-entity-picker__query {
  width: 100%;
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  background: #fff;
}

.portal-proforma-line__cell select.portal-proforma-line__unit {
  padding-right: 1.4rem;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
  color: #0f172a;
}

.portal-proforma-line__cell--stock {
  position: relative;
  z-index: 1;
}

.portal-proforma-line__cell--stock:has(.portal-entity-picker__panel:not([hidden])) {
  z-index: 40;
}

.portal-proforma-lines-table .portal-entity-picker__panel {
  z-index: 1200;
}

.portal-proforma-line__cell input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.portal-proforma-line__cell input[type='number']::-webkit-outer-spin-button,
.portal-proforma-line__cell input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.portal-proforma-line__cell--stock .portal-entity-picker__query {
  font-size: 0.72rem;
}

.portal-proforma-line__cell--total {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #1e3a8a;
  padding-right: 0.15rem;
}

.portal-proforma-line__remove--icon {
  width: 34px !important;
  height: 34px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  border-radius: 8px;
  background: #fff !important;
}

.portal-proforma-line__remove--icon:hover {
  background: #fef2f2 !important;
}

.portal-proforma-lines-card .portal-proforma-totals {
  margin-top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-proforma-line__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.portal-proforma-line__index {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-proforma-line__remove {
  width: auto !important;
  font-size: 0.75rem !important;
  padding: 0.2rem 0.55rem !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

.portal-proforma-line__remove:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.portal-proforma-line:last-child {
  border-bottom: none;
}

.portal-proforma-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.85rem;
  border-left: 2px solid #93c5fd;
}

.portal-proforma-timeline li {
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}

.portal-proforma-timeline__time {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.portal-proforma-followup {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-proforma-followup input {
  flex: 1;
  min-width: 180px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

.portal-proforma-date-input,
.portal-date-input.portal-proforma-date-input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  color: #0f172a;
  background: var(--surface, #fff);
}

.portal-proforma-date-input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.portal-proforma-term-select,
.portal-proforma-term-custom {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: var(--surface, #fff);
}

.portal-proforma-term-custom {
  margin-top: 0.45rem;
}

.portal-proforma-terms-layout {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.portal-proforma-delivery-row {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.45rem;
  align-items: end;
}

.portal-proforma-delivery-row input {
  width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
}

.portal-proforma-term-select--incoterm {
  width: 100%;
  min-width: 4.25rem;
  max-width: 5.25rem;
  min-height: 2rem;
  padding: 0.3rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.portal-proforma-term-custom--incoterm {
  margin-top: 0.35rem;
  max-width: 11rem;
}

.portal-proforma-terms-accounts .portal-proforma-credit-cards-panel {
  border-color: #ddd6fe;
  background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}

.portal-proforma-terms-accounts .portal-proforma-credit-cards-panel.is-open {
  background: #fff;
}

@media (max-width: 720px) {
  .portal-proforma-delivery-row {
    grid-template-columns: 1fr 1fr;
  }

  .portal-proforma-delivery-row__incoterm {
    grid-column: 1 / -1;
    max-width: 6rem;
  }
}

.portal-proforma-vat-toggle__row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.portal-proforma-vat-toggle__row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.portal-proforma-banks--always-visible {
  max-height: min(36vh, 320px);
  overflow: auto;
  margin-top: 0.35rem;
}

.portal-proforma-bank-item__company {
  font-size: 0.72rem;
  color: #6366f1;
  font-weight: 600;
}

.portal-proforma-banks {
  display: grid;
  gap: 0.55rem;
}

.portal-proforma-modal .portal-firm-modal-form__scroll {
  padding-bottom: 1.5rem;
}

.portal-proforma-modal__split {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.portal-proforma-modal__edit {
  flex: 1 1 58%;
  min-width: 380px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.portal-proforma-preview-pane {
  flex: 0 0 min(40%, 520px);
  min-width: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.portal-proforma-preview-pane__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #bfdbfe;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a8a;
}

.portal-proforma-preview-pane__head span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-proforma-preview-pane__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.portal-proforma-design-bar {
  flex-shrink: 0;
  padding: 0.65rem 0.75rem 0.55rem;
  border-bottom: 1px solid #bfdbfe;
  background: rgba(255, 255, 255, 0.72);
}

.portal-proforma-design-bar__hint {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #475569;
}

.portal-proforma-design-bar__row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.portal-proforma-design-bar__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dbeafe;
  flex-shrink: 0;
}

.portal-proforma-design-bar__logo--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.portal-proforma-design-bar__logo-hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
}

.portal-proforma-design-bar__select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-proforma-template-picker {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-proforma-template-picker__btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #fff;
  color: #1e40af;
  font: 600 0.68rem/1.2 system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.portal-proforma-template-picker__btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #3b82f6;
}

.portal-proforma-template-picker__btn.is-active {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5e9 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.portal-proforma-template-picker__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.portal-proforma-currency-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-proforma-currency-picker__btn {
  flex: 1 1 calc(33.333% - 0.35rem);
  min-width: 4.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3rem;
  padding: 0.35rem 0.4rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.portal-proforma-currency-picker__btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #f8fafc;
}

.portal-proforma-currency-picker__btn.is-active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.portal-proforma-currency-picker__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.portal-proforma-currency-picker__icon {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 2;
}

.portal-proforma-currency-picker__label {
  font: 700 0.68rem/1.1 system-ui, sans-serif;
  letter-spacing: 0.03em;
}

.portal-proforma-currency-picker__select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-proforma-currency-picker--compact .portal-proforma-currency-picker__btn {
  min-height: 2.35rem;
  flex-direction: row;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
}

.portal-proforma-currency-picker--compact .portal-proforma-currency-picker__icon {
  width: 1rem;
  height: 1rem;
}

.portal-proforma-design-bar__currency {
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed #bfdbfe;
}

.portal-proforma-design-bar__currency-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e40af;
}

.portal-proforma-kind-picker {
  display: flex;
  gap: 0.45rem;
}

.portal-proforma-kind-picker__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3.25rem;
  padding: 0.4rem 0.35rem;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.portal-proforma-kind-picker__btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #f8fafc;
}

.portal-proforma-kind-picker__btn.is-active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.portal-proforma-kind-picker__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.portal-proforma-kind-picker__icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

.portal-proforma-kind-picker__label {
  font: 600 0.68rem/1.2 system-ui, sans-serif;
  text-align: center;
}

.portal-proforma-kind-picker__select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-proforma-preview-pane__frame-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #e5e7eb;
}

.portal-proforma-preview-pane iframe {
  display: block;
  width: 100%;
  min-height: 100%;
  height: 520px;
  border: 0;
  background: #fff;
}

.portal-proforma-design-footer {
  flex-shrink: 0;
  border-top: 1px solid #bfdbfe;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.65rem 0.75rem 0.75rem;
}

.portal-proforma-notes-block {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #cbd5e1;
}

.portal-proforma-notes-block__fx {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-proforma-notes-block textarea {
  width: 100%;
  min-height: 4rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  resize: vertical;
}

.portal-proforma-tcmb-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.35rem;
}

.portal-proforma-tcmb-row input[data-proforma-exchange-rate] {
  width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
}

.portal-proforma-tcmb-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-proforma-tcmb-picker__btn {
  flex: 1 1 calc(20% - 0.35rem);
  min-width: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3rem;
  padding: 0.35rem 0.25rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.portal-proforma-tcmb-picker__btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #f8fafc;
}

.portal-proforma-tcmb-picker__btn.is-active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.portal-proforma-tcmb-picker__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.portal-proforma-tcmb-picker__icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
}

.portal-proforma-tcmb-picker__label {
  font: 600 0.62rem/1.15 system-ui, sans-serif;
  text-align: center;
}

.portal-proforma-tcmb-picker__select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-proforma-tcmb-row__refresh {
  width: auto !important;
  min-width: 2.2rem;
  padding: 0.35rem 0.45rem !important;
}

.portal-proforma-design-footer__fx {
  margin-bottom: 0.45rem;
}

.portal-proforma-fx-preview {
  margin: 0 0 0.35rem;
  padding: 0.45rem 0.55rem;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font: 600 0.72rem/1.35 system-ui, sans-serif;
  white-space: normal;
}

.portal-proforma-fx-preview--inline {
  margin-bottom: 0.4rem;
}

.portal-proforma-status-select {
  width: 100%;
  max-width: 9.5rem;
  min-height: 1.85rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.75rem;
}

.portal-proforma-terms-accounts {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
}

.portal-proforma-terms-accounts .portal-proforma-banks-panel {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.portal-proforma-terms-accounts .portal-proforma-banks-panel.is-open {
  background: #fff;
}

.portal-proforma-banks--terms {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.portal-proforma-design-footer__notes textarea {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  resize: vertical;
}

.portal-proforma-design-footer__block {
  margin-top: 0.65rem;
}

.portal-proforma-design-footer__title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.portal-proforma-banks--design {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: none;
  overflow: visible;
}

.portal-proforma-bank-item--compact {
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
}

.portal-proforma-bank-item--compact .portal-proforma-bank-item__body strong {
  font-size: 0.74rem;
}

.portal-proforma-bank-item--compact .portal-proforma-bank-item__iban {
  font-size: 0.68rem;
}

@media (max-width: 980px) {
  .portal-modal__panel--proforma {
    max-width: 96vw;
    height: min(92vh, 900px);
  }

  .portal-proforma-modal__split {
    flex-direction: column;
  }

  .portal-proforma-preview-pane {
    flex: 0 0 min(42vh, 420px);
    min-width: 0;
    border-left: 0;
    border-top: 1px solid #93c5fd;
  }

  .portal-proforma-preview-pane iframe {
    height: 680px;
  }
}

.portal-proforma-banks-panel:not(.is-open) {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}

.portal-proforma-banks-panel__collapsed-hint {
  margin: 0;
  padding: 0 1rem 0.75rem;
  font-size: 0.78rem;
}

.portal-proforma-banks-panel:not(.is-open) .portal-proforma-banks-panel__toggle {
  background: transparent;
}

.portal-proforma-banks-panel {
  padding: 0;
  overflow: hidden;
}

.portal-proforma-banks-panel__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.portal-proforma-banks-panel__toggle:hover {
  background: rgba(37, 99, 235, 0.04);
}

.portal-proforma-banks-panel__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.portal-proforma-banks-panel__title i,
.portal-proforma-banks-panel__title svg {
  width: 1rem;
  height: 1rem;
  color: #2563eb;
}

.portal-proforma-banks-panel__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.portal-proforma-banks-panel__summary {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-proforma-banks-panel__chevron {
  width: 1rem;
  height: 1rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.portal-proforma-banks-panel.is-open .portal-proforma-banks-panel__chevron {
  transform: rotate(180deg);
}

.portal-proforma-banks-panel__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.portal-proforma-banks-panel__body[hidden] {
  display: none;
}

.portal-proforma-banks-panel .portal-proforma-banks {
  max-height: min(42vh, 280px);
  overflow: auto;
  padding-right: 0.15rem;
}

.portal-proforma-bank-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
}

.portal-proforma-bank-item input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.portal-proforma-bank-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  font-size: 0.86rem;
}

.portal-proforma-bank-item__body strong {
  color: #0f172a;
}

.portal-proforma-bank-item__iban {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #475569;
  word-break: break-all;
}

.portal-form-hint--warn {
  color: #b45309;
}

.portal-entity-picker {
  position: relative;
}

.portal-entity-picker-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.portal-entity-picker-row .portal-entity-picker {
  flex: 1;
  min-width: 0;
}

.portal-entity-picker-row__add {
  flex-shrink: 0;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0 0.65rem;
}

.portal-firm-quick-add {
  position: fixed;
  z-index: 1400;
  width: min(320px, calc(100vw - 24px));
  padding: 0.85rem 0.95rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.portal-firm-quick-add__title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

.portal-firm-quick-add__form .portal-form-field {
  margin-bottom: 0.55rem;
}

.portal-firm-quick-add__error {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #b91c1c;
}

.portal-firm-quick-add__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.portal-entity-picker__wrap {
  position: relative;
}

.portal-entity-picker__query {
  width: 100%;
  padding: 0.62rem 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  box-sizing: border-box;
}

.portal-entity-picker__panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
}

.portal-entity-picker__item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.portal-entity-picker__item:hover {
  background: #eff6ff;
}

.portal-entity-picker__meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.portal-entity-picker__empty {
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.portal-bank-stmt-account-cell .portal-entity-picker-row {
  min-width: 0;
}

.portal-bank-stmt-account-cell {
  min-width: 16rem;
  vertical-align: top;
}

.portal-bank-stmt-account-field[data-bank-stmt-field="expense"] {
  min-width: 14rem;
}

.portal-expense-category-strip--compact {
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.portal-expense-category-strip--compact .portal-expense-category-pill {
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  border-width: 1px;
}

.portal-expense-category-strip--compact .portal-expense-category-pill i {
  width: 0.85rem;
  height: 0.85rem;
}

.portal-bank-stmt-account-field__hint {
  display: block;
  margin-bottom: 0.25rem;
}

.portal-bank-stmt-account-fields {
  display: grid;
  gap: 0.35rem;
}

.portal-bank-stmt-firm-cell .portal-entity-picker-row {
  min-width: 12rem;
}

.portal-bank-stmt-firm-cell .portal-entity-picker__query {
  min-width: 10rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem 0.35rem 1.75rem;
}

.portal-bank-stmt-firm-cell .portal-entity-picker__search-icon {
  width: 0.9rem;
  height: 0.9rem;
  left: 0.45rem;
}

.portal-table-wrap--bank-stmt {
  overflow: visible;
}

.portal-form-grid--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.portal-form-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-modal__panel--company {
  max-width: 820px;
  max-height: 90vh;
  height: min(90vh, 900px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-color: #a5b4fc;
}

.portal-company-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #312e81 0%, #6366f1 45%, #818cf8 100%);
}

.portal-company-modal__footer {
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  border-top-color: #a5b4fc;
}

@media (max-width: 768px) {
  .portal-form-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Financial accounts (bank + cashier) */
.portal-page-header--accounts {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-modal__panel--account {
  max-width: 720px;
  max-height: 90vh;
  height: min(90vh, 820px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-color: #86efac;
}

.portal-account-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #065f46 0%, #059669 45%, #10b981 100%);
}

.portal-account-modal .portal-firm-modal__footer,
.portal-account-modal__footer {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-top-color: #6ee7b7;
}

.portal-thumb--account {
  background: linear-gradient(135deg, #047857, #10b981);
  color: #fff;
  font-weight: 800;
  font-size: 0.62rem;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
}

.portal-modal__panel--service-catalog {
  max-width: 720px;
  max-height: 90vh;
  height: min(90vh, 760px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-color: #c4b5fd;
}

.portal-service-catalog-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #5b21b6 0%, #7c3aed 45%, #a78bfa 100%);
}

.portal-service-catalog-modal .portal-firm-modal__footer,
.portal-service-catalog-modal__footer {
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
  border-top-color: #c4b5fd;
}

.portal-thumb--service-catalog {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  color: #fff;
  display: grid;
  place-items: center;
}

.portal-thumb--service-catalog svg {
  width: 1.35rem;
  height: 1.35rem;
}

.service-catalog-row--editable {
  cursor: pointer;
}

.service-catalog-row--editable:hover td {
  background: rgba(124, 58, 237, 0.04);
}

.portal-license-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #0f766e 0%, #0d9488 45%, #2dd4bf 100%);
}

.portal-license-modal .portal-firm-modal__footer,
.portal-license-modal__footer {
  background: linear-gradient(180deg, #f0fdfa 0%, #ccfbf1 100%);
  border-top-color: #5eead4;
}

.portal-license-modal__footer .portal-license-modal__delete {
  margin-left: auto;
}

.portal-license-file-download {
  max-width: 100%;
  justify-content: flex-start;
}

.portal-license-file-download__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-license-file-download svg,
.portal-license-modal__footer .portal-btn svg {
  flex-shrink: 0;
}

.portal-thumb--license {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  display: grid;
  place-items: center;
}

.portal-thumb--license svg {
  width: 1.35rem;
  height: 1.35rem;
}

.portal-license-features__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-license-features {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.portal-license-feature-row {
  display: grid;
  grid-template-columns: minmax(8.5rem, 34%) 1fr auto;
  align-items: baseline;
  column-gap: 0.5rem;
  padding: 0.1rem 0;
  min-height: 1.55rem;
}

.portal-license-feature-row.portal-license-template-feature {
  grid-template-columns: minmax(8.5rem, 30%) 1fr auto auto;
}

.portal-license-feature-group {
  font-family: var(--font, inherit);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--portal-muted, #64748b);
  margin-top: 0.65rem;
  padding-top: 0.35rem;
}

.portal-license-feature-row__name {
  grid-column: 1;
  font-weight: 500;
  color: #0f172a;
  min-width: 0;
}

.portal-license-feature-row__sep {
  grid-column: 2;
  align-self: end;
  min-width: 1rem;
  border-bottom: 1px dotted #cbd5e1;
  margin-bottom: 0.15em;
}

.portal-license-feature-row__value {
  grid-column: 3;
  justify-self: start;
  color: #334155;
  white-space: nowrap;
  font-style: normal;
}

.portal-license-feature-row__input {
  grid-column: 3;
  width: 100%;
  max-width: 14rem;
  justify-self: start;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}

.portal-license-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  vertical-align: middle;
}

.portal-license-status-badge svg {
  width: 0.85rem;
  height: 0.85rem;
}

.portal-license-highlights {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--portal-muted, #64748b);
  line-height: 1.35;
}

.portal-license-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
  margin-top: 0.25rem;
  line-height: 1.25;
}

.portal-license-capability {
  font-size: 0.7rem;
  font-weight: 600;
  color: #15803d;
  letter-spacing: 0.01em;
}

.portal-license-capability--off {
  color: #b45309;
}

.portal-license-row--expired {
  background: rgba(254, 226, 226, 0.35);
}

.portal-license-row--expiring {
  background: rgba(254, 243, 199, 0.45);
}

.portal-license-template-feature .portal-icon-btn {
  grid-column: 4;
  justify-self: end;
}

.portal-license-firm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.portal-license-firm-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #99f6e4;
  font-size: 0.85rem;
}

.portal-license-firm-tag__name {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-license-assigned-firms {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-license-assigned-firm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.portal-license-series {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.portal-license-series svg {
  width: 0.75rem;
  height: 0.75rem;
}

.portal-license-series--c {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.portal-license-series--o {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.portal-license-template-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #4338ca 0%, #6366f1 45%, #a5b4fc 100%);
}

.portal-thumb--license-template {
  background: linear-gradient(135deg, #4338ca, #6366f1);
  color: #fff;
  display: grid;
  place-items: center;
}

.portal-thumb--license-template svg {
  width: 1.35rem;
  height: 1.35rem;
}

.portal-license-firm-tag__remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: #0f766e;
}

.portal-license-template-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.portal-license-template-feature .portal-icon-btn {
  flex: 0 0 auto;
}

.portal-license-new-system {
  margin-top: 1rem;
}

.portal-table__truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-table__actions-col {
  width: 3rem;
}

.portal-table__actions {
  text-align: right;
  white-space: nowrap;
}

.portal-table__actions .portal-icon-btn {
  opacity: 0.72;
}

.service-catalog-row--editable:hover .portal-table__actions .portal-icon-btn {
  opacity: 1;
}

.portal-table--accounts .portal-table__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.account-row--inactive {
  opacity: 0.7;
}

.portal-proforma-transaction-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.portal-proforma-doc-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: start;
}

@media (max-width: 640px) {
  .portal-proforma-doc-mode-row {
    grid-template-columns: 1fr;
  }
}

.portal-proforma-doc-mode-row__group {
  min-width: 0;
}

.portal-proforma-transaction-picker--header {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 0.45rem;
}

.portal-proforma-transaction-picker--header .portal-proforma-transaction-picker__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3.25rem;
  padding: 0.4rem 0.35rem;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: inherit;
}

.portal-proforma-transaction-picker--header .portal-proforma-transaction-picker__btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #f8fafc;
}

.portal-proforma-transaction-picker--header .portal-proforma-transaction-picker__btn.is-active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.portal-proforma-transaction-picker__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.portal-proforma-transaction-picker__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.portal-proforma-transaction-picker__btn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.portal-rental-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.portal-rental-tabs--top {
  padding: 0 1.25rem;
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.portal-rental-tabs--top .portal-rental-tabs__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
}

.portal-rental-tabs--top .portal-rental-tabs__btn svg {
  width: 1rem;
  height: 1rem;
}

.portal-rental-tabs__btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.portal-rental-tabs__btn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.portal-rental-signature canvas {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 120px;
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.portal-rental-signature__hint {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

.portal-rental-signature__img {
  display: block;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #fff;
}

.portal-rental-signature__signed-by {
  margin: 0.5rem 0 0;
}

.portal-rental-signature__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  max-width: 420px;
  font-size: 0.9rem;
}

.portal-rental-signature__line-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.portal-rental-signature__line-value {
  font-weight: 600;
}

.portal-rental-signature--saved .portal-rental-signature__img {
  margin-top: 0.35rem;
}

.portal-rental-signature__hint--warn {
  color: #92400e;
}

.portal-rental-signature__locked {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.portal-rental-company-signature {
  margin: 0.75rem 0;
}

.portal-rental-company-signature__preview {
  margin-top: 0.35rem;
}

.portal-rental-company-signature__hint {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

.portal-rental-modal__body {
  padding: 1rem 1.25rem 0;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.portal-rental-modal .portal-firm-modal__hero-bg {
  background: linear-gradient(125deg, #14532d 0%, #16a34a 50%, #0d9488 100%);
}

.portal-rental-modal .portal-firm-modal__footer {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-top-color: #6ee7b7;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.portal-rental-modal .portal-firm-modal__footer .portal-btn {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  gap: 0.35rem;
  border-radius: 10px;
}

.portal-rental-modal .portal-firm-modal__footer .portal-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.portal-rental-photos__hint {
  margin: 0 0 0.5rem;
  grid-column: 1 / -1;
}

.portal-rental-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
}

.portal-rental-photos__unit {
  display: contents;
}

.portal-rental-photos__unit-title {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--portal-text-muted, #64748b);
}

.portal-rental-photos__unit:first-child .portal-rental-photos__unit-title {
  margin-top: 0;
}

.portal-choice-dialog {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.portal-choice-dialog__panel {
  width: min(420px, 100%);
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.portal-choice-dialog__message {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text, #0f172a);
}

.portal-choice-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.portal-rental-return-check {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
}

.portal-db-backup-status {
  margin-top: 1rem;
}

.portal-db-backup-status__text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.portal-db-backup-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.portal-db-backup-progress__bar {
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  background-size: 200% 100%;
  animation: portal-db-backup-progress 1.2s ease-in-out infinite;
}

@keyframes portal-db-backup-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.portal-db-backup-cli__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.portal-db-backup-cli__code {
  display: inline-block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--surface-elevated, rgba(0, 0, 0, 0.04));
  font-size: 0.82rem;
  word-break: break-all;
}

.portal-db-backup-cli__code--wrap {
  flex: 1 1 16rem;
  max-width: 100%;
}

.portal-db-backup-cli__code--block {
  display: block;
  white-space: pre-wrap;
  margin: 0;
}

.portal-db-backup-meta {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.portal-db-backup-meta li + li {
  margin-top: 0.35rem;
}

.portal-db-backup-restore-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.portal-db-backup-restore-steps li + li {
  margin-top: 0.5rem;
}

.portal-rental-return-check__overall {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.portal-rental-return-check__list {
  margin-top: 0.35rem;
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem;
}

.portal-rental-return-check__head,
.portal-rental-return-check__row {
  display: grid;
  grid-template-columns: 1.5rem 1fr 5rem 5.5rem 1fr;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
}

.portal-rental-return-check__head {
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.portal-rental-return-check__row + .portal-rental-return-check__row {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #d1fae5;
}

.portal-rental-return-check__problem {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
}

.portal-rental-return-check__problem:read-only {
  background: #f8fafc;
  color: #94a3b8;
}

.portal-rental-return-check__damage {
  margin-top: 0.65rem;
}

.portal-rental-return-check--saved .portal-rental-return-check__row {
  grid-template-columns: 1.5rem 1fr 5rem 4rem 1fr;
}

.portal-thumb--rental {
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
}

.portal-rental-edit-form {
  margin: 0;
}

.portal-rental-accessories {
  margin-top: 0.75rem;
}

.portal-rental-phase-datetime {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.portal-rental-phase-datetime .portal-rental-phase-date,
.portal-rental-phase-datetime .portal-rental-phase-time {
  margin: 0;
  flex: 1 1 10rem;
  min-width: 8rem;
}

.portal-rental-proforma-lines {
  margin: 0.65rem 0 0;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  overflow: hidden;
}

.portal-rental-proforma-lines__head,
.portal-rental-proforma-lines__row {
  display: grid;
  grid-template-columns: 28px 1.1fr 1.2fr 0.55fr 0.55fr 0.75fr 0.95fr;
  gap: 0.35rem;
  align-items: start;
  padding: 0.45rem 0.55rem;
}

.portal-rental-proforma-lines__head {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #dbeafe;
}

.portal-rental-proforma-lines__row {
  font-size: 0.8rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.portal-rental-proforma-lines__row:last-of-type {
  border-bottom: none;
}

.portal-rental-proforma-lines__no {
  color: #64748b;
  font-weight: 600;
}

.portal-rental-proforma-lines__num {
  text-align: right;
  white-space: nowrap;
}

.portal-rental-proforma-lines__total {
  font-weight: 600;
  color: #1e3a8a;
}

.portal-rental-proforma-lines__stock,
.portal-rental-proforma-lines__desc {
  min-width: 0;
  word-break: break-word;
}

.portal-rental-proforma-lines__totals {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border-top: 1px solid #bfdbfe;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
}

.portal-rental-proforma-lines__totals > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.portal-rental-proforma-lines__totals-grand {
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #cbd5e1;
  font-weight: 700;
}

@media (max-width: 900px) {
  .portal-rental-proforma-lines__head { display: none; }
  .portal-rental-proforma-lines__row {
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.5rem;
    padding: 0.55rem 0.65rem;
  }
  .portal-rental-proforma-lines__no { grid-column: 1 / -1; }
  .portal-rental-proforma-lines__total { grid-column: 1 / -1; text-align: left; }
}

.portal-rental-accessories__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.portal-rental-accessories__table-head,
.portal-rental-accessory-line {
  display: grid;
  grid-template-columns: 1.6fr 0.55fr 0.55fr 0.75fr 0.45fr 32px;
  gap: 0.35rem;
  align-items: center;
}

.portal-rental-accessories__table-head {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.portal-rental-accessory-line input {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .portal-rental-accessories__table-head { display: none; }
  .portal-rental-accessory-line {
    grid-template-columns: 1fr 1fr;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.35rem;
  }
}

/* Tickets */
.portal-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-ticket-header__subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.portal-ticket-header__new {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-ticket-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-list-filter-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.portal-list-filter-bar__divider {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  min-height: 3rem;
  margin: 0 0.15rem;
  background: var(--border);
}

.portal-list-filter-pill {
  flex: 1 1 0;
  min-width: 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.65rem 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.portal-list-filter-pill:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.portal-list-filter-pill--active {
  border-color: var(--primary);
  background: var(--primary-soft, rgba(37, 99, 235, 0.08));
  box-shadow: 0 0 0 1px var(--primary);
}

.portal-list-filter-pill--warn .portal-list-filter-pill__value {
  color: var(--primary, #2563eb);
}

.portal-list-filter-pill__value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.portal-list-filter-pill__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.portal-list-filter-pill__label svg {
  width: 13px;
  height: 13px;
}

.portal-list-filter-pill--channel.portal-mail-channel--support.portal-list-filter-pill--active {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.1);
}

.portal-list-filter-pill--channel.portal-mail-channel--sales.portal-list-filter-pill--active {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.portal-list-filter-pill--channel.portal-mail-channel--general.portal-list-filter-pill--active {
  border-color: #64748b;
  background: rgba(100, 116, 139, 0.1);
}

.portal-ticket-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-ticket-stat:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.portal-ticket-stat--active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.portal-ticket-stat__value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.portal-ticket-stat__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.portal-ticket-create {
  margin-bottom: 1rem;
}

.portal-firm-modal--embedded {
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border);
  background: #fff;
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}

.portal-firm-modal--embedded .portal-firm-modal-form {
  overflow: visible;
}

.portal-firm-modal--embedded .portal-firm-modal-form__scroll {
  overflow: visible;
  flex: none;
  max-height: none;
}

.portal-pm-form-page--customers {
  padding-bottom: 2rem;
}

.portal-customer-create {
  margin-bottom: 1rem;
}

.portal-customer-create__actions,
.portal-ticket-create__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.portal-ticket-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.portal-ticket-filters__search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 220px;
  min-width: 180px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.portal-ticket-filters__search input {
  border: 0;
  outline: 0;
  width: 100%;
  font: inherit;
  background: transparent;
}

.portal-ticket-filters select {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  background: #fff;
}

.portal-ticket-table-wrap {
  overflow-x: auto;
}

.portal-ticket-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-ticket-table thead th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.portal-ticket-row {
  border-bottom: none;
}

.portal-ticket-row td {
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
}

.portal-ticket-no {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.85rem;
}

.portal-ticket-row__meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-ticket-assignee {
  font-size: 0.88rem;
  font-weight: 600;
}

.portal-ticket-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.portal-ticket-assignee-chip,
.portal-ticket-assignees .portal-ticket-assignee {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-muted, #f1f5f9);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.portal-ticket-assignee-chip--removable {
  gap: 0.2rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  cursor: pointer;
  color: inherit;
}

.portal-ticket-assignee-chip--removable:hover {
  background: #fee2e2;
  border-color: #fecaca;
}

.portal-ticket-assignee-chip--removable svg {
  width: 12px;
  height: 12px;
  opacity: 0.75;
}

.portal-ticket-assign-inline__current {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 220px;
}

.portal-ticket-assignee--empty {
  color: var(--text-muted);
  font-weight: 500;
}

.portal-ticket-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.portal-ticket-empty,
.portal-ticket-empty-inline {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.portal-ticket-pagination {
  margin-top: 1rem;
}

.portal-ticket-row-main td {
  padding-bottom: 0.35rem;
  border-bottom: none;
}

.portal-ticket-row-main:hover td {
  background: #f8fafc;
}

.portal-ticket-row-toolbar td {
  padding-top: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.portal-ticket-row-main:hover + .portal-ticket-row-toolbar td,
.portal-ticket-row-toolbar:hover td {
  background: #f1f5f9;
}

.portal-ticket-row-toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.15rem 0.1rem;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.portal-ticket-row__select {
  width: 2.25rem;
  text-align: center;
}

.portal-ticket-merge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.65rem;
  background: #f8fafc;
}

.portal-ticket-merge-bar__count {
  font-weight: 700;
  color: var(--primary, #2563eb);
}

.portal-ticket-merge-bar__target {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-ticket-assign-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.portal-ticket-assign-select {
  min-width: 9rem;
  max-width: 12rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.35rem;
}

.portal-ticket-device-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.portal-ticket-device-field select {
  flex: 1 1 16rem;
}

.portal-ticket-device-warranty {
  white-space: nowrap;
}

.portal-ticket-detail-header__actions {
  margin-top: 0.35rem;
}

.portal-ticket-table .portal-icon-btn svg {
  width: 15px;
  height: 15px;
}

.portal-ticket-status--open {
  background: #dbeafe;
  color: #1d4ed8;
}

.portal-ticket-status--progress {
  background: #fef3c7;
  color: #b45309;
}

.portal-ticket-status--waiting {
  background: #e2e8f0;
  color: #475569;
}

.portal-ticket-status--resolved {
  background: #dcfce7;
  color: #15803d;
}

.portal-ticket-status--closed {
  background: #f1f5f9;
  color: #64748b;
}

.portal-rma-status--open {
  background: #dbeafe;
  color: #1d4ed8;
}

.portal-rma-status--progress {
  background: #fef3c7;
  color: #b45309;
}

.portal-rma-status--done {
  background: #dcfce7;
  color: #15803d;
}

.portal-rma-barcode {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

.portal-rma-create {
  margin-bottom: 0;
}

.portal-rma-list {
  margin-top: 0;
}

.portal-rma-list-warranty {
  min-width: 7rem;
}

.portal-rma-list-warranty .portal-badge {
  display: inline-block;
  max-width: 100%;
}

.portal-rma-list-warranty .portal-ticket-row__meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.portal-rma-toolbar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

.portal-rma-toolbar-status svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.portal-rma-detail-page .portal-pm-page-sheet--rma {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-rma-detail-page .portal-pm-hero-colored__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
}

.portal-rma-stepper {
  width: 100%;
}

.portal-rma-stepper__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.portal-rma-stepper__item {
  flex: 1 1 140px;
  min-width: 0;
}

.portal-rma-stepper__link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted, #64748b);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.portal-rma-stepper__link:hover {
  background: var(--surface-muted, #f8fafc);
}

.portal-rma-stepper__item.is-active .portal-rma-stepper__link,
.portal-rma-stepper__link.is-active {
  color: var(--text, #0f172a);
  background: #eff6ff;
  border-color: #bfdbfe;
}

.portal-rma-stepper__item.is-completed .portal-rma-stepper__link {
  color: #15803d;
}

.portal-rma-stepper__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-muted, #f1f5f9);
  flex-shrink: 0;
}

.portal-rma-stepper__item.is-active .portal-rma-stepper__marker {
  background: #dbeafe;
  color: #1d4ed8;
}

.portal-rma-stepper__item.is-completed .portal-rma-stepper__marker {
  background: #dcfce7;
  color: #15803d;
}

.portal-rma-stepper__marker svg {
  width: 14px;
  height: 14px;
}

.portal-rma-stepper__label {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}

.portal-rma-detail-tabs {
  width: 100%;
}

.portal-rma-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 1rem;
  align-items: start;
}

.portal-rma-detail-main {
  min-width: 0;
}

@media (max-width: 960px) {
  .portal-rma-detail-body {
    grid-template-columns: 1fr;
  }

  .portal-rma-stepper__item {
    flex: 1 1 100%;
  }
}

.portal-rma-detail-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 961px) {
  .portal-rma-detail-aside {
    position: sticky;
    top: 1rem;
  }
}

.portal-rma-tab-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.portal-rma-tab-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.portal-rma-tab-panel__title h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.portal-rma-tab-panel__title svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}

.portal-rma-autosave-indicator {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.portal-rma-autosave-indicator.is-ok {
  color: #15803d;
}

.portal-rma-autosave-indicator.is-error {
  color: #b91c1c;
}

.portal-rma-section-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
}

.portal-rma-section-card__title svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.portal-rma-tab-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-rma-tab-form .portal-rma-section-card {
  padding: 1rem 1.1rem;
  margin: 0;
}

.portal-rma-tab-form .portal-rma-section-card > .portal-form-grid {
  margin: 0;
}

.portal-rma-tab-form .portal-form-field input:not([type="checkbox"]):not([type="file"]),
.portal-rma-tab-form .portal-form-field select,
.portal-rma-tab-form .portal-form-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.portal-rma-tab-form .portal-rma-check-grid {
  margin: 0.75rem 0;
}

.portal-rma-tab-form .portal-rma-check-grid + .portal-form-grid {
  margin-top: 0.25rem;
}

.portal-rma-tab-form .portal-rma-cost-summary {
  margin: 0;
}

.portal-rma-tab-form .portal-rma-parts-total {
  margin: 0.75rem 0 0;
}

.portal-rma-tab-form .portal-rma-delivery-outcome {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-rma-tab-panel--intake {
  --rma-tab-accent: #2563eb;
  --rma-tab-bg: #eff6ff;
  --rma-tab-border: #bfdbfe;
  --rma-tab-marker: #dbeafe;
}

.portal-rma-tab-panel--repair {
  --rma-tab-accent: #d97706;
  --rma-tab-bg: #fffbeb;
  --rma-tab-border: #fde68a;
  --rma-tab-marker: #fef3c7;
}

.portal-rma-tab-panel--delivery {
  --rma-tab-accent: #16a34a;
  --rma-tab-bg: #f0fdf4;
  --rma-tab-border: #bbf7d0;
  --rma-tab-marker: #dcfce7;
}

.portal-rma-tab-panel[class*="portal-rma-tab-panel--"] .portal-rma-tab-panel__head {
  border-bottom-color: var(--rma-tab-border);
  background: var(--rma-tab-bg);
  margin: -1rem -1rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px 10px 0 0;
  border-bottom-width: 2px;
}

.portal-rma-tab-panel[class*="portal-rma-tab-panel--"] .portal-rma-tab-panel__title {
  color: var(--rma-tab-accent);
}

.portal-rma-tab-panel[class*="portal-rma-tab-panel--"] .portal-rma-tab-panel__title svg {
  color: var(--rma-tab-accent);
  opacity: 1;
}

.portal-rma-tab-panel[class*="portal-rma-tab-panel--"] .portal-rma-section-card {
  border-left: 3px solid var(--rma-tab-border);
}

.portal-rma-tab-panel[class*="portal-rma-tab-panel--"] .portal-rma-media-card {
  border-left: 3px solid var(--rma-tab-border);
}

.portal-rma-tab-panel[class*="portal-rma-tab-panel--"] .portal-rma-tab-form__actions .portal-btn--primary {
  background: var(--rma-tab-accent);
  border-color: var(--rma-tab-accent);
}

.portal-rma-stepper__item--intake.is-active .portal-rma-stepper__link {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.portal-rma-stepper__item--intake.is-active .portal-rma-stepper__marker {
  background: #dbeafe;
  color: #2563eb;
}

.portal-rma-stepper__item--repair.is-active .portal-rma-stepper__link {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.portal-rma-stepper__item--repair.is-active .portal-rma-stepper__marker {
  background: #fef3c7;
  color: #d97706;
}

.portal-rma-stepper__item--delivery.is-active .portal-rma-stepper__link {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.portal-rma-stepper__item--delivery.is-active .portal-rma-stepper__marker {
  background: #dcfce7;
  color: #16a34a;
}

.portal-rma-detail-tabs .portal-rma-tabnav__link--intake.is-active {
  color: #1d4ed8;
  border-bottom-color: #2563eb;
  background: #eff6ff;
}

.portal-rma-detail-tabs .portal-rma-tabnav__link--repair.is-active {
  color: #b45309;
  border-bottom-color: #d97706;
  background: #fffbeb;
}

.portal-rma-detail-tabs .portal-rma-tabnav__link--delivery.is-active {
  color: #15803d;
  border-bottom-color: #16a34a;
  background: #f0fdf4;
}

.portal-rma-serial-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.portal-rma-serial-row__input {
  flex: 1;
  min-width: 0;
}

.portal-rma-serial-row__lookup {
  flex-shrink: 0;
  align-self: stretch;
}

.portal-rma-serial-row__lookup.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.portal-rma-serial-row__spinner,
.portal-rma-warranty-card__spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: portal-rma-spin 0.7s linear infinite;
  vertical-align: -2px;
}

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

.portal-rma-warranty-card {
  margin-top: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
}

.portal-rma-warranty-card--inline {
  margin-top: 0.5rem;
}

.portal-rma-warranty-card--sidebar {
  padding: 0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.portal-rma-warranty-card--sidebar.portal-rma-warranty-card--portal-warranty--original {
  border-color: #86efac;
  box-shadow: inset 3px 0 0 #22c55e;
}

.portal-rma-warranty-card--sidebar.portal-rma-warranty-card--portal-warranty--momento {
  border-color: #93c5fd;
  box-shadow: inset 3px 0 0 #3b82f6;
}

.portal-rma-warranty-card--sidebar.portal-rma-warranty-card--portal-warranty--expired {
  border-color: #fca5a5;
  box-shadow: inset 3px 0 0 #ef4444;
}

.portal-rma-warranty-card--sidebar.portal-rma-warranty-card--portal-warranty--unset {
  border-color: var(--border, #e2e8f0);
  box-shadow: inset 3px 0 0 #94a3b8;
}

.portal-rma-warranty-card__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem 0.35rem;
}

.portal-rma-warranty-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
}

.portal-rma-warranty-card__icon svg {
  width: 16px;
  height: 16px;
}

.portal-rma-warranty-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.portal-rma-warranty-card__body {
  padding: 0 1rem 0.85rem;
}

.portal-rma-warranty-card--inline .portal-rma-warranty-card__body {
  padding: 0;
}

.portal-rma-warranty-card__message {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}

.portal-rma-warranty-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.portal-rma-warranty-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.portal-rma-warranty-card__meta svg {
  width: 13px;
  height: 13px;
  opacity: 0.85;
}

.portal-rma-warranty-card__hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.portal-rma-detail-aside-card__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.portal-rma-detail-aside-card__head svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.portal-rma-detail-aside-card__head .portal-card__title {
  margin: 0;
}

.portal-rma-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 320px;
  overflow-y: auto;
}

.portal-rma-warranty-preview {
  margin-top: 0.35rem;
}

.portal-rma-warranty-preview__message,
.portal-rma-warranty-banner__message {
  margin: 0.35rem 0 0;
  flex: 1 1 100%;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}

.portal-rma-warranty-banner .portal-badge {
  margin-bottom: 0.25rem;
}

.portal-rma-warranty-banner__meta {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.portal-rma-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.35rem 1rem;
  margin: 0.75rem 0;
}

.portal-stock-card-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.portal-rma-photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
}

.portal-rma-photo-grid .portal-stock-card-images__preview-wrap {
  height: auto;
  aspect-ratio: 4 / 3;
  min-height: 108px;
  background: var(--surface-muted, #f1f5f9);
}

.portal-rma-photo-grid .portal-rma-photo-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 108px;
  border: none;
  padding: 0.35rem;
  background: transparent;
  cursor: zoom-in;
  box-sizing: border-box;
}

.portal-rma-photo-grid .portal-rma-photo-trigger img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.portal-rma-part-line {
  position: relative;
  padding: 0.85rem 2.5rem 0.85rem 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
}

.portal-rma-part-line__grid {
  margin: 0;
}

.portal-rma-part-line .portal-entity-picker {
  width: 100%;
}

.portal-rma-part-line .portal-rma-part__desc,
.portal-rma-part-line .portal-rma-part__qty,
.portal-rma-part-line .portal-rma-part__cost {
  width: 100%;
  box-sizing: border-box;
}

.portal-rma-part-line .portal-rma-part__remove {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
}

.portal-rma-parts-footer {
  margin-top: 0.25rem;
}

.portal-rma-parts-footer .portal-rma-parts-total {
  margin: 0;
  font-size: 1rem;
}

.portal-rma-cost-summary__actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border, #e2e8f0);
}

@media (max-width: 720px) {
  .portal-rma-part-line {
    padding-right: 0.85rem;
    padding-top: 2.25rem;
  }

  .portal-rma-part-line .portal-rma-part__remove {
    top: 0.5rem;
    right: 0.5rem;
  }
}

.portal-rma-cost-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--surface-muted, #f8fafc);
  border-radius: 12px;
}

.portal-rma-tab-form__actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-rma-video-preview {
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.portal-rma-signature canvas {
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  touch-action: none;
}

.portal-rma-signature__img {
  max-width: 100%;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
}

/* Test sheets */
.portal-test-section-card {
  margin-bottom: 1rem;
}

.portal-test-section-card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 1rem;
}

.portal-test-passfail-grid {
  display: grid;
  gap: 1rem;
}

.portal-test-passfail {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.portal-test-passfail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.portal-test-passfail__toggles {
  display: flex;
  gap: 0.5rem;
}

.portal-test-passfail__toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-test-passfail__toggle input:checked + .portal-badge,
.portal-test-passfail__toggle.is-selected .portal-badge {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

.portal-test-passfail__toggle.is-selected .portal-badge--success {
  background: rgba(22, 163, 74, 0.18);
}

.portal-test-passfail__toggle.is-selected .portal-badge--danger {
  background: rgba(220, 38, 38, 0.16);
}

.portal-test-custom-input {
  margin-top: 0.35rem;
}

.portal-test-fail-photos__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.portal-test-fail-photos__thumb {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
}

.portal-test-fail-photos__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-test-procedure-row {
  position: relative;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-test-procedure-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.portal-test-signature canvas {
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  touch-action: none;
}

.portal-test-signature__img {
  max-width: 100%;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
}

.portal-test-form__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.portal-test-save-status--ok {
  color: #15803d;
  font-size: 0.9rem;
}

.portal-test-save-status--error {
  color: #b91c1c;
  font-size: 0.9rem;
}

.portal-test-autosave-indicator {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.portal-test-autosave-indicator.is-ok {
  color: #15803d;
}

.portal-test-autosave-indicator.is-error {
  color: #b91c1c;
}

.portal-test-autosave-hint {
  margin: 0;
  flex: 1;
}

.portal-test-coming-soon {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.portal-test-owner-rma {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.portal-test-rma-link-fields .portal-entity-picker {
  width: 100%;
}

.portal-test-owner-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.portal-test-owner-checkboxes__item.is-selected {
  color: var(--primary, #ea580c);
}

.portal-test-stock-source {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed rgba(234, 88, 12, 0.35);
  border-radius: 10px;
  background: rgba(234, 88, 12, 0.04);
}

.portal-test-stock-source__tech {
  margin: 0.35rem 0 0;
  color: #475569;
  white-space: pre-wrap;
  font-size: 0.88rem;
}

.portal-test-prefill-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.portal-test-owner-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.portal-test-owner-choice__item {
  display: block;
  cursor: pointer;
}

.portal-test-owner-choice__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-test-owner-choice__box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.portal-test-owner-choice__box svg {
  width: 18px;
  height: 18px;
  color: var(--primary, #ea580c);
}

.portal-test-owner-choice__box strong {
  font-size: 0.95rem;
}

.portal-test-owner-choice__box small {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.portal-test-owner-choice__item.is-selected .portal-test-owner-choice__box,
.portal-test-owner-choice__item input:checked + .portal-test-owner-choice__box {
  border-color: rgba(234, 88, 12, 0.45);
  background: rgba(234, 88, 12, 0.06);
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.18);
}

.portal-test-stock-details__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
}

.portal-test-stock-details__grid strong {
  display: block;
  margin-top: 0.15rem;
}

.portal-test-stock-details__tech {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .portal-test-owner-choice {
    grid-template-columns: 1fr;
  }
  .portal-test-stock-details__grid {
    grid-template-columns: 1fr;
  }
}

.portal-test-coming-soon__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted, #64748b);
}

.portal-test-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-test-status--draft { background: #f1f5f9; color: #475569; }
.portal-test-status--progress { background: #dbeafe; color: #1d4ed8; }
.portal-test-status--pending { background: #fef3c7; color: #b45309; }
.portal-test-status--approved { background: #dcfce7; color: #15803d; }
.portal-test-status--rejected { background: #fee2e2; color: #b91c1c; }

.portal-test-progress-card {
  margin-bottom: 1rem;
}

.portal-proforma-progress--compact {
  height: 18px;
  margin-bottom: 0.25rem;
}

.portal-test-readonly-value {
  margin: 0;
  font-weight: 500;
}

.portal-test-customer-result {
  margin-top: 1rem;
}

.portal-test-customer-report {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  white-space: pre-wrap;
}

.portal-test-report {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.portal-test-report--print .portal-test-report__actions {
  display: none;
}

.portal-test-report__header {
  margin-bottom: 1.5rem;
}

.portal-test-report__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.portal-test-report__block {
  margin-bottom: 1.5rem;
}

.portal-test-report__table {
  width: 100%;
  border-collapse: collapse;
}

.portal-test-report__table th,
.portal-test-report__table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.portal-test-report__signature {
  max-width: 280px;
  height: auto;
}

@media print {
  .portal-test-report--print {
    padding: 0;
  }
}

.portal-rma-history-item {
  border-left: 3px solid var(--border, #e2e8f0);
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-rma-history-item__meta {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.portal-rma-detail-qr__code {
  font-family: ui-monospace, monospace;
  font-size: 1rem;
}

.portal-rma-detail-qr__img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
}

.portal-ticket-priority--urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.portal-ticket-priority--high {
  background: #ffedd5;
  color: #c2410c;
}

.portal-ticket-priority--low {
  background: #f1f5f9;
  color: #64748b;
}

.portal-ticket-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.portal-ticket-detail-page .portal-pm-hero-colored__main {
  flex: 1 1 20rem;
  min-width: 0;
}

.portal-ticket-detail-page .portal-pm-hero-colored__main h1 {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.portal-ticket-detail-page .portal-pm-hero-colored__sub {
  max-width: none;
  line-height: 1.45;
}

.portal-ticket-detail-page .portal-pm-hero-colored__aside {
  flex: 0 1 auto;
  max-width: 100%;
}

.portal-ticket-detail-page .portal-pm-hero-colored__row {
  align-items: flex-start;
}

.portal-ticket-detail-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.portal-ticket-detail-hero__chip svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  flex-shrink: 0;
}

.portal-ticket-detail-page .portal-pm-hero-colored__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
}

.portal-ticket-detail-hero__delete {
  margin-left: 0.25rem;
}

.portal-ticket-detail-page .portal-ticket-reply-form,
.portal-ticket-detail-page .portal-ticket-reply-form textarea {
  min-width: 0;
}

.portal-ticket-detail-sheet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-ticket-detail-qa {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.portal-ticket-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1rem;
  align-items: start;
}

.portal-ticket-detail-main,
.portal-ticket-detail-sidebar {
  min-width: 0;
}

.portal-ticket-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-ticket-detail-main .portal-card,
.portal-ticket-detail-sidebar .portal-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-ticket-conversation__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-ticket-conversation__head .portal-card__title {
  margin: 0;
}

.portal-ticket-conversation__count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg, #f1f5f9);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.portal-ticket-chat {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-ticket-chat__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
}

.portal-ticket-chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e11d48, #fb7185);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-ticket-chat__item--internal .portal-ticket-chat__avatar {
  background: linear-gradient(135deg, #d97706, #fbbf24);
}

.portal-ticket-chat__bubble {
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.portal-ticket-chat__item--internal .portal-ticket-chat__bubble {
  background: #fffbeb;
  border-color: #fde68a;
  border-left: 3px solid #f59e0b;
}

.portal-ticket-chat__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.portal-ticket-chat__meta strong {
  color: var(--text);
  font-size: 0.85rem;
}

.portal-ticket-chat__body {
  line-height: 1.55;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.portal-ticket-reply-card .portal-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-ticket-reply-card .portal-card__title svg {
  width: 18px;
  height: 18px;
}

.portal-ticket-manage-panel {
  margin: 0.75rem 0 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
  overflow: hidden;
}

.portal-ticket-manage-panel__summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  list-style: none;
  user-select: none;
}

.portal-ticket-manage-panel__summary::-webkit-details-marker {
  display: none;
}

.portal-ticket-manage-panel__summary svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.portal-ticket-manage-panel__grid {
  padding: 0 0.85rem 0.85rem;
}

.portal-ticket-detail-page .portal-ticket-manage-panel__grid.portal-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .portal-ticket-detail-page .portal-ticket-manage-panel__grid.portal-form-grid--2 {
    grid-template-columns: 1fr;
  }
}

.portal-ticket-detail-page .portal-ticket-device-field {
  flex-direction: column;
  align-items: stretch;
}

.portal-ticket-detail-page .portal-ticket-device-field select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.portal-ticket-detail-page .portal-ticket-device-warranty {
  white-space: normal;
  align-self: flex-start;
}

.portal-ticket-reply-form__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.portal-ticket-summary__stats {
  display: grid;
  gap: 0.75rem;
}

.portal-ticket-summary__stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-ticket-summary__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-ticket-info .portal-card__title,
.portal-ticket-qr-card .portal-card__title,
.portal-ticket-timeline--main .portal-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-ticket-info .portal-card__title svg,
.portal-ticket-qr-card .portal-card__title svg,
.portal-ticket-timeline--main .portal-card__title svg {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
}

.portal-ticket-info-device {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-ticket-info-device__serial {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg, #f1f5f9);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  width: fit-content;
}

.portal-ticket-qr-card .portal-ticket-qr {
  border: none;
  padding: 0;
  background: transparent;
}

.portal-ticket-timeline--main {
  margin-top: 0;
}

.portal-ticket-event__dot--merged {
  background: #64748b;
}

.portal-ticket-event__dot--device {
  background: #059669;
}

.portal-ticket-back {
  margin: 0 0 0.35rem;
}

.portal-ticket-back a {
  color: var(--text-muted);
  text-decoration: none;
}

.portal-ticket-detail-header__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-ticket-detail-header__title h1 {
  margin: 0;
}

.portal-ticket-detail-header__subject {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.portal-ticket-qr {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.portal-ticket-summary__stat strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-ticket-qr img {
  width: 120px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto 0.35rem;
}

.portal-ticket-qr code {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.portal-ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.portal-ticket-message {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-ticket-message:last-child {
  border-bottom: 0;
}

.portal-ticket-message--internal {
  background: #fffbeb;
  margin: 0 -1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid #f59e0b;
}

.portal-ticket-message__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.portal-ticket-message__meta strong {
  color: var(--text);
}

.portal-ticket-message__body {
  line-height: 1.55;
}

.portal-ticket-info-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.portal-ticket-info-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.portal-ticket-detail-sidebar .portal-ticket-info-list div {
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.portal-ticket-detail-sidebar .portal-ticket-info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.portal-ticket-info-list dt {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.portal-ticket-info-list dd {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-ticket-info-list dd a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-ticket-event__body {
  min-width: 0;
}

.portal-ticket-event__label,
.portal-ticket-event__note {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portal-ticket-timeline {
  margin-top: 1rem;
}

.portal-ticket-event {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-ticket-event:last-child {
  border-bottom: 0;
}

.portal-ticket-event__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 0.35rem;
}

.portal-ticket-event__dot--status {
  background: #2563eb;
}

.portal-ticket-event__dot--assigned {
  background: #7c3aed;
}

.portal-ticket-event__label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.portal-ticket-event__note {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-ticket-event__meta {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.portal-ticket-internal-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}

.portal-ticket-detail-sidebar .portal-card + .portal-card {
  margin-top: 0;
}

@media (max-width: 960px) {
  .portal-ticket-detail-grid,
  .portal-ticket-detail-layout {
    grid-template-columns: 1fr;
  }

  .portal-ticket-timeline {
    margin-top: 0;
  }

  .portal-ticket-stats {
    grid-template-columns: 1fr;
  }

  .portal-list-filter-bar {
    flex-wrap: wrap;
  }

  .portal-list-filter-pill {
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 5rem;
  }

  .portal-list-filter-bar__divider {
    display: none;
  }
}

/* Warehouse import */
.portal-import-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.portal-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.portal-import-panel .portal-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-import-help {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.portal-import-note {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-import-upload-form input[type=file] {
  width: 100%;
}

.portal-import-export-actions {
  display: flex;
  gap: 0.5rem;
}

.portal-import-back {
  margin: 0 0 0.35rem;
}

.portal-import-back a {
  color: var(--text-muted);
  text-decoration: none;
}

.portal-import-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-import-map-table-wrap,
.portal-import-preview-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.portal-import-map-table,
.portal-import-preview-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-import-map-table th,
.portal-import-map-table td,
.portal-import-preview-table th,
.portal-import-preview-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.portal-import-map-table select {
  width: 100%;
  min-width: 220px;
}

.portal-import-options {
  margin-bottom: 0.5rem;
}

.portal-import-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.portal-import-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.portal-import-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.portal-import-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.portal-import-stat strong {
  font-size: 1.35rem;
}

.portal-import-stat span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-import-loc__meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-import-confirm-form {
  margin-top: 1rem;
}

.portal-import-confirm-text {
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.portal-import-result-list {
  margin: 0;
  padding-left: 1.1rem;
}

.portal-import-shelf-legend {
  margin-bottom: 1rem;
}

.portal-import-shelf-legend--compact {
  background: var(--surface-alt, rgba(0, 0, 0, 0.03));
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.portal-import-shelf-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 0.5rem;
}

.portal-import-shelf-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
}

.portal-import-shelf-arrow {
  color: var(--text-muted);
}

.portal-import-shelf-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.portal-import-stat--ok strong {
  color: var(--success, #15803d);
}

.portal-import-stat--muted strong {
  color: var(--text-muted);
}

.portal-import-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.portal-import-filters .portal-form-field--grow {
  flex: 1 1 180px;
}

.portal-import-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.portal-import-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.portal-import-toolbar .portal-form-field--inline {
  min-width: 160px;
}

.portal-import-review-table .portal-import-inline-input {
  width: 3.5rem;
  padding: 0.25rem 0.35rem;
  font-size: 0.85rem;
}

.portal-import-pkg-input {
  width: 4.5rem !important;
  text-transform: uppercase;
}

.portal-import-qty-input {
  width: 3.25rem !important;
}

.portal-import-loc-fields {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.portal-import-loc-fields label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-import-loc--excel span {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-import-loc__computed {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.portal-import-place-select {
  min-width: 120px;
  max-width: 160px;
  font-size: 0.85rem;
}

.portal-import-row--declined {
  opacity: 0.55;
  background: rgba(0, 0, 0, 0.02);
}

.portal-import-row--approved {
  background: rgba(21, 128, 61, 0.04);
}

.portal-import-decision-btns {
  display: flex;
  gap: 0.25rem;
}

.portal-import-btn-approve.is-active {
  background: var(--success, #15803d);
  color: #fff;
  border-color: transparent;
}

.portal-import-btn-decline.is-active {
  background: #b91c1c;
  color: #fff;
  border-color: transparent;
}

.portal-btn--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
}

.portal-badge--xs {
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  margin-left: 0.25rem;
}

.portal-import-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.portal-import-pagination__info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-import-actions--footer {
  margin-top: 0.75rem;
}

/* Project management */
.portal-pm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.portal-pm-header-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.portal-pm-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* Project show — modern shell */
.portal-pm-show {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-pm-show-hero {
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.portal-pm-show-hero__main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.portal-pm-show-hero__code code {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.portal-pm-show-hero__title {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.portal-pm-show-hero__sub {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.portal-pm-show-hero__sub svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.portal-pm-show-hero__badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.portal-pm-show-hero__progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.portal-pm-show-hero__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.portal-pm-tabnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.portal-pm-tabnav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

.portal-pm-tabnav__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.portal-pm-tabnav__link:hover {
  background: var(--bg);
  color: var(--text);
}

.portal-pm-tabnav__link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.25);
}

.portal-pm-tabnav__link--external {
  margin-left: auto;
}

.portal-pm-show-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-pm-show-panel .portal-card {
  box-shadow: var(--shadow);
}

.portal-pm-text--pre {
  white-space: pre-wrap;
}

.portal-pm-row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.portal-pm-row-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-pm-row-list__item:last-child {
  border-bottom: none;
}

.portal-pm-row-list__item--stack {
  flex-wrap: wrap;
  align-items: flex-start;
}

.portal-pm-row-list__main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.portal-pm-row-list__main strong {
  display: block;
  font-size: 0.95rem;
}

.portal-pm-row-list__main .portal-badge {
  margin-top: 0.2rem;
}

.portal-pm-row-list__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.portal-pm-row-list__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.portal-pm-row-list__icon svg {
  width: 16px;
  height: 16px;
}

.portal-pm-row-list__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-pm-row-list__empty {
  padding: 1.25rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.portal-pm-row-list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-pm-row-list__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.portal-pm-row-list__meta svg {
  width: 14px;
  height: 14px;
}

.portal-pm-photo-form,
.portal-pm-photo-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-pm-activity-photo {
  display: block;
  margin-top: 0.5rem;
  max-width: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.portal-pm-activity-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

.portal-pm-comment-card .portal-pm-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-pm-comment-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.portal-pm-meeting-card__links {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
}

.portal-pm-meeting-card__report {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-pm-empty--inline {
  padding: 1.5rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.portal-pm-activity-feed--timeline .portal-pm-activity-item {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-pm-activity-feed--timeline .portal-pm-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.portal-pm-activity-item__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.portal-pm-activity-item__icon svg {
  width: 16px;
  height: 16px;
}

.portal-pm-activity-item__content {
  min-width: 0;
}

@media (max-width: 720px) {
  .portal-pm-tabnav__link--external {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .portal-pm-show-hero__title {
    font-size: 1.35rem;
  }
}

.portal-pm-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 960px;
}

.portal-pm-form-page .portal-pm-form {
  max-width: none;
}

/* PM colored hero + page shell (all project menu pages) */
.portal-pm-page {
  max-width: 960px;
  margin: 0 auto;
}

.portal-pm-page--wide {
  max-width: 1080px;
}

.portal-pm-page--full {
  max-width: none;
  width: 100%;
}

.portal-table--stock {
  width: 100%;
  min-width: 1180px;
}

.portal-table--stock thead th,
.portal-table--stock tbody td {
  vertical-align: top;
}

.portal-table--stock .portal-table__name {
  min-width: 8rem;
  max-width: 12rem;
  white-space: normal;
}

.portal-table--stock .portal-stock-name-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.portal-table--stock .portal-stock-name-btn:hover .portal-stock-name-btn__title,
.portal-table--stock .portal-stock-name-btn:focus-visible .portal-stock-name-btn__title {
  text-decoration: underline;
  color: var(--accent, #2563eb);
}

.portal-table--stock .portal-table__desc {
  display: block;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--text-muted, #64748b);
  margin-top: 0.15rem;
  font-weight: 400;
}

.portal-table--stock .portal-row-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.portal-table--stock-compact thead th {
  font-size: 0.68rem;
  letter-spacing: 0;
  padding: 0.4rem 0.28rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-table--stock-compact tbody td {
  padding: 0.35rem 0.28rem;
  font-size: 0.78rem;
}

.portal-table--stock-compact .stock-col-thumb {
  width: 40px;
}

.portal-table--stock-compact .stock-col-thumb .portal-thumb,
.portal-table--stock-compact .stock-col-thumb .portal-thumb-btn {
  width: 34px;
  height: 34px;
}

.portal-table--stock-compact .stock-col-code {
  width: 5.5rem;
  max-width: 6.2rem;
}

.portal-table--stock-compact .stock-col-code .stock-code-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.portal-table--stock-compact .stock-col-package {
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  width: 4.2rem;
  max-width: 4.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-table--stock-compact .stock-col-qty {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  width: 2.6rem;
}

.portal-table--stock-compact .stock-col-barcode {
  width: 5.2rem;
  max-width: 5.8rem;
  font-size: 0.7rem;
}

.portal-table--stock-compact .stock-barcode-gen {
  display: inline;
}

.portal-table--stock-compact .stock-col-actions {
  width: 6.8rem;
  text-align: right;
}

.portal-table--stock-compact .inventory-warranty-form,
.portal-table--stock-compact .inventory-state-form,
.portal-table--stock-compact .stock-category-form,
.portal-table--stock-compact .stock-loc-form,
.portal-table--stock-compact .portal-inline-price {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  width: 100%;
}

.portal-table--stock-compact .inventory-warranty-form--compact,
.portal-table--stock-compact .inventory-state-form--compact,
.portal-table--stock-compact .stock-category-form--compact {
  min-width: 0;
}

.portal-table--stock-compact .inventory-warranty-form input,
.portal-table--stock-compact .inventory-warranty-form select,
.portal-table--stock-compact .inventory-state-form select,
.portal-table--stock-compact .stock-category-form select,
.portal-table--stock-compact .stock-loc-form select,
.portal-table--stock-compact .stock-loc-form input,
.portal-table--stock-compact .portal-inline-price input,
.portal-table--stock-compact .portal-inline-price select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.18rem 0.28rem;
  font-size: 0.7rem;
  line-height: 1.2;
  border-radius: 5px;
}

.portal-table--stock-compact .inventory-state-form select,
.portal-table--stock-compact .stock-category-form select,
.portal-table--stock-compact .stock-loc-form select,
.portal-table--stock-compact .inventory-warranty-form select {
  text-overflow: ellipsis;
}

.portal-table--stock-compact .stock-col-warranty {
  width: 6.4rem;
  max-width: 7rem;
}

.portal-table--stock-compact .stock-col-state {
  width: 5.8rem;
  max-width: 6.4rem;
}

.portal-table--stock-compact .stock-col-category {
  width: 6.4rem;
  max-width: 7.2rem;
}

.portal-table--stock-compact .stock-col-location {
  width: 11.5rem;
  min-width: 10.5rem;
  max-width: 13rem;
}

.me-web-sale {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 11px;
  font-weight: 700;
  color: #0055d4;
  cursor: pointer;
  user-select: none;
}
.me-web-sale input { accent-color: #0055d4; }
.portal-table--stock-compact .stock-col-web,
.portal-table--stock-cards .stock-col-web { width: 3.2rem; text-align: center; }

.portal-table--me-shop th,
.portal-table--me-shop td { white-space: nowrap; vertical-align: top; }
.portal-table--me-shop .portal-table__name { white-space: normal; min-width: 11rem; }
.portal-table--me-shop td.me-shop-photos { white-space: normal; min-width: 11rem; }
.me-shop-row { cursor: default; }
.me-shop-row.is-saving [data-me-published] { opacity: 0.55; }
.me-shop-row.is-saved [data-me-published] { outline: 2px solid #16a34a; outline-offset: 2px; border-radius: 4px; }
.portal-table--me-shop .me-shop-col-published {
  width: 7.2rem;
  min-width: 7.2rem;
  max-width: 7.2rem;
  box-sizing: border-box;
}
.me-shop-published {
  display: grid;
  gap: 0.08rem;
  min-height: 2.7em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.me-shop-published s {
  display: block;
  min-height: 1.1em;
  color: var(--text-muted);
  text-decoration: line-through;
}
.me-shop-published s[hidden] { display: block; visibility: hidden; }
.me-shop-published strong { display: block; }
.me-shop-row.is-duplicate { background: #fff7ed; }
.me-shop-dup-flag {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.68rem;
  font-weight: 700;
}
.me-shop-dup { margin-bottom: 0.85rem; border-color: #f59e0b; }
.me-shop-dup h2 { margin: 0; font-size: 1.05rem; }
.me-shop-dup p { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.me-shop-dup__toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.me-shop-dup__empty { margin: 1rem 0 0; color: var(--text-muted); }
.me-shop-row__name {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.me-shop-row__qty { font-variant-numeric: tabular-nums; }
.portal-table--me-shop td.me-shop-row__ticks {
  white-space: normal;
  min-width: 12rem;
}
.me-shop-row__ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  align-items: center;
}
.me-shop-row__warehouses {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: normal;
  min-width: 8rem;
}
.me-shop-row__warehouses .is-off { color: var(--text-muted); }
.portal-me-shop-toolbar { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
.portal-me-shop-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.portal-me-shop-filters form { margin: 0; }
.portal-me-shop-filters__n {
  display: inline-block;
  min-width: 1.2rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e8eefc;
  font-size: 0.72rem;
}
.me-shop-live { margin-bottom: 0.85rem; padding: 0.9rem 1rem; }
.me-shop-live__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.me-shop-live__head h2 { margin: 0; font-size: 1rem; }
.me-shop-live__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
}
.me-shop-live__item {
  display: grid;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}
.me-shop-live__item img,
.me-shop-live__empty {
  width: 100%;
  height: 8.4rem;
  object-fit: contain;
  background: #f4f7fb;
  border: 1px solid var(--border, #d5dbe6);
  border-radius: 10px;
}
.me-shop-live__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.me-shop-live__item strong {
  font-size: 0.78rem;
  line-height: 1.25;
}
.me-shop-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr));
  gap: 1.1rem;
}
.me-shop-card {
  display: grid;
  grid-template-columns: minmax(11rem, 0.9fr) minmax(0, 1.15fr);
  gap: 0.9rem;
  padding: 0.9rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d5dbe6);
  border-radius: 14px;
}
.me-shop-card { cursor: pointer; }
.me-shop-card__hero {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.me-shop-card__media img[data-me-hero],
.me-shop-card__hero img,
.me-shop-card__no-photo {
  width: 100%;
  height: 16rem;
  object-fit: contain;
  background: #f4f7fb;
  border: 1px solid var(--border, #d5dbe6);
  border-radius: 12px;
}
.me-shop-card__name {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.me-shop-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.45rem;
}
.me-shop-card__stock {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  background: #f4f7fb;
  border-radius: 10px;
}
.me-shop-card__qty {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: baseline;
}
.me-shop-card__qty strong { font-size: 1.35rem; }
.me-shop-card__qty span,
.me-shop-card__qty em { font-size: 0.78rem; font-style: normal; color: var(--text-muted); }
.me-shop-card__warehouses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}
.me-shop-card__warehouses li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.78rem;
}
.me-shop-card__warehouses .is-off { color: var(--text-muted); }
.me-shop-photo__zoom {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: 0;
  border-radius: 0 6px 0 0;
  background: rgba(20, 28, 40, 0.72);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: zoom-in;
  z-index: 2;
}
.portal-stock-card-modal__warehouses { margin: 0.4rem 0; }
.me-shop-card__warehouses--modal { max-width: 22rem; }
.me-shop-card__no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.me-shop-card__body { display: grid; gap: 0.65rem; align-content: start; }
.me-shop-card__title strong { font-size: 1.05rem; }
.me-shop-card__places { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.me-shop-card__places span {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e8eefc;
  color: #0055d4;
  font-size: 0.7rem;
  font-weight: 700;
}
.me-shop-card__places span.is-off { background: #f1f4f8; color: #7a8494; }
.me-shop-card__live { font-size: 0.78rem; font-weight: 700; }
.me-shop-card__price { font-size: 1.25rem; }
.me-shop-card__price s { color: var(--text-muted); margin-right: 0.35rem; font-size: 0.95rem; }
.me-shop-card__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.me-shop-card__fields label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.me-shop-card__toggles { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.me-shop-empty { grid-column: 1 / -1; text-align: center; padding: 1.5rem; color: var(--text-muted); }
@media (max-width: 720px) {
  .me-shop-card,
  .me-shop-card__fields { grid-template-columns: 1fr; }
}
.me-shop-photos__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-start;
  margin-top: 0.45rem;
}
button.me-shop-photo { font: inherit; color: inherit; }
.me-shop-photo {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 7px;
  border: 1px solid var(--border, #d5dbe6);
  background: #f4f7fb;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}
.me-shop-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.me-shop-photo__empty {
  font-size: 0.62rem;
  font-weight: 700;
  color: #7a8494;
}
.me-shop-photo__open {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
}
.me-shop-photo__open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.me-shop-photo__upload {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1.05rem;
  height: 1.05rem;
  z-index: 3;
  border-radius: 0 6px 0 0;
  background: rgba(20, 28, 40, 0.72);
  cursor: pointer;
}
.me-shop-photo__upload::after {
  content: "+";
  display: block;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.05rem;
  text-align: center;
}
.me-shop-photo--empty .me-shop-photo__upload {
  inset: 0;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
}
.me-shop-photo--empty .me-shop-photo__upload::after { content: none; }
.me-shop-photo input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.me-shop-photo__clear {
  position: absolute;
  top: 0;
  right: 0;
  width: 1rem;
  height: 1rem;
  border: 0;
  border-radius: 0 0 0 6px;
  background: rgba(20, 28, 40, 0.72);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.me-shop-photo--old { cursor: zoom-in; }
.me-shop-photo--real { cursor: default; }
.me-shop-photo--vitrin { border-color: #c9a227; box-shadow: 0 0 0 1px #c9a227; }
.me-shop-photo--old em,
.me-shop-photo--vitrin em,
.me-shop-photo--real em {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-style: normal;
  font-size: 0.52rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: rgba(0, 85, 212, 0.78);
  letter-spacing: 0.02em;
}
.me-shop-photo--old em { background: rgba(15, 118, 110, 0.82); }
.me-shop-photo--vitrin em { background: rgba(180, 131, 16, 0.88); }
.me-shop-photo--old em { background: rgba(15, 118, 110, 0.82); }
.me-shop-photo--vitrin em { background: rgba(180, 131, 16, 0.88); }
.me-shop-margin { display: flex; gap: 0.3rem; align-items: center; }
.me-shop-margin select,
.me-shop-margin input,
.me-shop-sale-pct {
  width: 4.6rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border, #d5dbe6);
  border-radius: 6px;
  font: inherit;
}
.me-shop-margin select { width: 4.8rem; }
.me-shop-margin input[data-me-field="last_price"],
.me-shop-margin input[data-me-field="me_list_price"] { width: 6.2rem; }
.me-shop-price strong { font-variant-numeric: tabular-nums; }
.me-shop-price s { color: var(--text-muted, #7a8494); margin-right: 0.3rem; }

.portal-table--stock-compact .stock-col-price {
  width: 11.5rem;
  max-width: 12.5rem;
  min-width: 10.5rem;
}

.portal-table--stock-compact .stock-loc-form__shelf {
  display: grid;
  grid-template-columns: minmax(2.6rem, 1.15fr) minmax(2.4rem, 0.95fr) minmax(2.4rem, 0.95fr);
  gap: 0.18rem;
  align-items: stretch;
}

.portal-table--stock-compact .stock-loc-form__shelf input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.2rem 0.12rem;
  letter-spacing: 0;
}

.portal-table--stock-compact .stock-loc-form__shelf input.warehouse-shelf-input {
  text-align: left;
  padding-inline: 0.28rem;
  font-weight: 500;
}

.portal-table--stock-compact .stock-loc-form__shelf input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.portal-table--stock-compact .stock-loc-form__shelf input[type="number"]::-webkit-outer-spin-button,
.portal-table--stock-compact .stock-loc-form__shelf input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.portal-table--stock-compact .portal-inline-price {
  grid-template-columns: minmax(5.5rem, 1fr) minmax(3.4rem, auto);
  align-items: center;
  gap: 0.35rem;
}

.portal-table--stock-compact .portal-inline-price input,
.portal-table--stock-compact .portal-inline-price select {
  padding: 0.38rem 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 2.1rem;
}

.portal-table--stock-compact .portal-inline-price input {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.portal-table--stock-compact .portal-inline-price select {
  padding-inline: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-table--stock-compact .inventory-warranty-meta,
.portal-table--stock-compact .inventory-warranty-save-hint,
.portal-table--stock-compact .inventory-state-save-hint,
.portal-table--stock-compact .stock-category-save-hint,
.portal-table--stock-compact .portal-inline-price-hint,
.portal-table--stock-compact .warehouse-save-hint {
  display: none;
  font-size: 0.65rem;
  color: #16a34a;
  line-height: 1.2;
}

.portal-table--stock-compact .inventory-warranty-meta {
  display: block;
  color: var(--text-muted, #64748b);
}

.portal-production-part-hit,
.portal-production-part-unit {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  padding: 0.55rem 0.7rem;
}

.portal-production-part-results--picker {
  max-height: 240px;
  overflow: auto;
}

.portal-production-parts-table .portal-row-actions {
  justify-content: flex-end;
}

.portal-production-part-status-icon {
  width: 1rem;
  height: 1rem;
}

.portal-production-part-status-icon--planned {
  color: var(--text-muted, #94a3b8);
}

.portal-production-part-status-icon--installed {
  color: var(--success, #16a34a);
}

.portal-production-part-status-icon--damaged {
  color: var(--danger, #dc2626);
}

.portal-production-part-row--planned:hover td {
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, transparent);
}

.portal-production-part-row--damaged td {
  background: color-mix(in srgb, var(--danger, #dc2626) 6%, transparent);
}

.portal-table--stock-compact .inventory-warranty-save-hint.is-visible,
.portal-table--stock-compact .inventory-state-save-hint.is-visible,
.portal-table--stock-compact .stock-category-save-hint.is-visible,
.portal-table--stock-compact .warehouse-save-hint.is-visible,
.portal-table--stock-compact .portal-inline-price-hint.is-visible {
  display: inline;
}

.portal-table--stock-compact .portal-inline-price-hint {
  display: none;
}

.portal-table--stock-cards {
  width: 100%;
  min-width: 980px;
}

.portal-table--stock-cards thead th,
.portal-table--stock-cards tbody td {
  vertical-align: middle;
}

.portal-table--stock-cards .portal-table__name {
  min-width: 14rem;
  max-width: 28rem;
  white-space: normal;
}

.portal-table--stock-cards .portal-table__desc {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted, #64748b);
  margin-top: 0.2rem;
  font-weight: 400;
}

.portal-table--stock-cards .portal-row-actions {
  justify-content: flex-end;
}

.portal-stock-card-serial-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.portal-stock-card-serial-toggle input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  accent-color: var(--portal-accent, #0f766e);
  cursor: pointer;
}

.portal-stock-card-serial-toggle input[type="checkbox"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

.portal-package-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.portal-package-picker.is-open {
  z-index: 40;
}

.portal-package-picker__combo {
  position: relative;
  min-width: 7.5rem;
  max-width: 12rem;
  flex: 1 1 auto;
}

.portal-package-picker--inline .portal-package-picker__combo {
  max-width: 10rem;
}

.portal-package-picker__search {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--border, #d4d4d8);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  box-sizing: border-box;
}

.portal-package-picker__search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.portal-package-picker__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  max-height: 14rem;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d4d4d8);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  z-index: 50;
}

.portal-package-picker__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.55rem;
  border: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: inherit;
  cursor: pointer;
}

.portal-package-picker__option:hover,
.portal-package-picker__option.is-active {
  background: rgba(15, 118, 110, 0.12);
}

.portal-package-picker__option--empty {
  color: var(--text-muted, #71717a);
  cursor: default;
}

.portal-package-picker__option--empty:hover {
  background: transparent;
}

.portal-package-picker__add {
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.portal-package-picker.is-saving .portal-package-picker__search,
.portal-package-picker.is-saving .portal-package-picker__add {
  opacity: 0.55;
  pointer-events: none;
}

.portal-table--stock-cards .portal-table__package {
  white-space: nowrap;
  overflow: visible;
}

.portal-pm-hero-colored,
.portal-pm-form-hero-colored {
  margin-bottom: 0;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.portal-pm-hero-colored--projects,
.portal-pm-form-hero-colored {
  background: linear-gradient(125deg, #7c2d12 0%, var(--primary) 42%, #fb923c 100%);
}

.portal-pm-hero-colored--quotes {
  background: linear-gradient(125deg, #1e3a8a 0%, #2563eb 45%, #60a5fa 100%);
}

.portal-pm-hero-colored--inbox {
  background: linear-gradient(125deg, #4c1d95 0%, #7c3aed 45%, #a78bfa 100%);
}

.portal-pm-hero-colored--reports {
  background: linear-gradient(125deg, #065f46 0%, #059669 45%, #34d399 100%);
}

.portal-pm-hero-colored--categories,
.portal-pm-hero-colored--warehouse {
  background: linear-gradient(125deg, #78350f 0%, #d97706 45%, #fbbf24 100%);
}

.portal-pm-hero-colored--sales {
  background: linear-gradient(125deg, #0c4a6e 0%, #0284c7 45%, #38bdf8 100%);
}

.portal-pm-hero-colored--mail {
  background: linear-gradient(125deg, #164e63 0%, #0891b2 45%, #67e8f9 100%);
}

.portal-pm-hero-colored--accounting {
  background: linear-gradient(125deg, #14532d 0%, #16a34a 45%, #86efac 100%);
}

.portal-pm-hero-colored--service_rentals {
  background: linear-gradient(125deg, #0e7490 0%, #0891b2 42%, #5eead4 100%);
}

.portal-pm-hero-colored--expenses {
  background: linear-gradient(125deg, #115e59 0%, #0d9488 42%, #5eead4 100%);
}

.portal-expense-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.35rem;
  border-radius: var(--radius-sm, 6px);
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  vertical-align: middle;
}
.portal-expense-category-icon i { width: 1rem; height: 1rem; }
.portal-stat-card--expense { border-left: 3px solid #0d9488; }
.portal-badge--expense-paid { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.portal-badge--expense-recorded { background: rgba(14, 116, 144, 0.12); color: #0e7490; }
.portal-badge--expense-draft { background: rgba(100, 116, 139, 0.12); color: #475569; }
.portal-table--expenses tbody tr:hover { background: rgba(13, 148, 136, 0.04); }

.portal-expense-dashboard {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.portal-expense-dashboard__total {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md, 10px);
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.08), rgba(94, 234, 212, 0.12));
  border: 1px solid rgba(13, 148, 136, 0.18);
}

.portal-stat-card__hint { font-size: 0.78rem; color: var(--text-muted, #64748b); }

.portal-expense-dashboard__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
}

.portal-expense-stat-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md, 10px);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}

.portal-expense-stat-chip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
}

.portal-expense-stat-chip__icon i { width: 1rem; height: 1rem; }

.portal-expense-stat-chip__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.portal-expense-stat-chip__body strong {
  color: var(--text, #0f172a);
  font-size: 0.88rem;
}

.portal-expense-toolbar {
  margin-bottom: 0.85rem;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  overflow: visible;
}

.portal-expense-page .portal-pm-page-sheet {
  max-width: none;
  width: 100%;
  overflow: visible;
}

.portal-expense-page .portal-expense-toolbar.portal-card {
  padding: 1rem 1.1rem;
}

.portal-expense-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 0.75rem 0.85rem;
  align-items: end;
  width: 100%;
}

.portal-expense-filters__search,
.portal-expense-filters .portal-search-field {
  min-width: 0;
  margin: 0;
  width: 100%;
}

.portal-expense-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.portal-expense-filter select,
.portal-expense-filter input[type="date"] {
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-weight: 500;
}

.portal-expense-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: 0;
  white-space: nowrap;
}

.portal-expense-filter-actions .portal-btn {
  width: auto;
  white-space: nowrap;
}

.portal-expense-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #0f766e) 10%, transparent);
  font-size: 0.9rem;
}

@media (max-width: 1280px) {
  .portal-expense-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .portal-expense-filters__search {
    grid-column: 1 / -1;
  }

  .portal-expense-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .portal-expense-filters {
    grid-template-columns: 1fr 1fr;
  }

  .portal-expense-filters__search,
  .portal-expense-filter-actions {
    grid-column: 1 / -1;
  }
}

.portal-expense-row-title {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.portal-expense-row-meta { font-size: 0.78rem; margin-top: 0.1rem; }

.portal-expense-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-expense-col-payment {
  min-width: 320px;
  width: 34%;
}

.portal-expense-pay-form {
  min-width: 0;
  max-width: 100%;
}

.portal-expense-pay-form__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 0.4rem;
  align-items: stretch;
}

.portal-expense-pay-form__grid > input[type="date"] {
  grid-column: 1 / 2;
}

.portal-expense-pay-form__submit {
  grid-column: 2 / 3;
  justify-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.portal-expense-pay-form select,
.portal-expense-pay-form input[type="date"] {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.portal-expense-paid-meta { font-size: 0.82rem; }

.portal-expense-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.portal-cashier-tabnav { margin-bottom: 1rem; }

.portal-table--cash tbody tr:hover { background: rgba(22, 163, 74, 0.04); }

.portal-btn.is-muted,
.portal-btn[aria-disabled="true"] {
  opacity: 0.55;
}

.portal-badge--cash-in { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.portal-badge--cash-out { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }

.portal-text-success { color: #15803d; }
.portal-text-danger { color: #b91c1c; }

@media (max-width: 960px) {
  .portal-expense-dashboard { grid-template-columns: 1fr; }
  .portal-expense-col-payment { min-width: 260px; width: auto; }
  .portal-expense-pay-form__grid {
    grid-template-columns: 1fr;
  }
  .portal-expense-pay-form__grid > input[type="date"],
  .portal-expense-pay-form__submit {
    grid-column: 1;
  }
}

/* Expense create / edit — single-column layout */
.portal-pm-form-page--expenses .portal-pm-form-sheet--expenses {
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.portal-expense-form .portal-pm-form-layout,
.portal-expense-form .portal-pm-form-layout__side {
  display: contents;
}

.portal-expense-amount-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-expense-amount-bar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex: 1;
  min-width: min(100%, 320px);
}

.portal-expense-amount-bar__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
  margin-bottom: 0.35rem;
}

.portal-expense-amount-bar__field {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}

.portal-expense-amount-bar__field--currency {
  flex: 0 0 auto;
  min-width: 100px;
  max-width: 120px;
}

.portal-expense-amount-bar__input,
.portal-expense-amount-bar__currency {
  width: 100%;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.55rem 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}

.portal-expense-amount-bar__input:focus,
.portal-expense-amount-bar__currency:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.portal-expense-amount-bar__currency {
  font-size: 1rem;
  font-weight: 600;
}

.portal-expense-amount-bar__total {
  text-align: right;
  min-width: 120px;
}

.portal-expense-amount-bar__total-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 0.2rem;
}

.portal-expense-amount-bar__total strong {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.portal-expense-section {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.portal-expense-section--last {
  border-bottom: none;
}

.portal-expense-section__head {
  margin-bottom: 1rem;
}

.portal-expense-section__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.portal-expense-section__head p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.portal-expense-category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-expense-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

button.portal-expense-category-pill {
  margin: 0;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.portal-expense-category-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-expense-category-pill i {
  width: 1rem;
  height: 1rem;
  color: #0f766e;
}

.portal-expense-category-pill:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.portal-expense-category-pill.is-selected {
  border-color: #0d9488;
  background: #0d9488;
  color: #fff;
}

.portal-expense-category-pill.is-selected i {
  color: #fff;
}

.portal-expense-file-drop--inline .portal-expense-file-drop__inner {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  text-align: left;
}

.portal-expense-file-drop--inline .portal-expense-file-drop__inner i {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.portal-expense-file-drop--inline .portal-expense-file-drop__inner em {
  margin-top: 0;
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-pm-form-footer--expenses .portal-btn--lg {
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .portal-expense-amount-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .portal-expense-amount-bar__total {
    text-align: left;
  }
  .portal-expense-amount-bar__field {
    max-width: none;
  }
}

/* Legacy category cards (list page) — keep below */
.portal-pm-form-block--expense-category {
  --pm-block-accent: #0d9488;
  --pm-block-bg: linear-gradient(90deg, #f0fdfa 0%, #ffffff 32%);
  --pm-block-icon-bg: rgba(13, 148, 136, 0.14);
}

.portal-pm-form-block--expense-bill {
  --pm-block-accent: #0891b2;
  --pm-block-bg: linear-gradient(90deg, #ecfeff 0%, #ffffff 32%);
  --pm-block-icon-bg: rgba(8, 145, 178, 0.12);
}

.portal-pm-form-block--expense-supplier {
  --pm-block-accent: #6366f1;
  --pm-block-bg: linear-gradient(90deg, #eef2ff 0%, #ffffff 32%);
  --pm-block-icon-bg: rgba(99, 102, 241, 0.12);
}

.portal-pm-form-block--expense-details {
  --pm-block-accent: #64748b;
  --pm-block-bg: linear-gradient(90deg, #f8fafc 0%, #ffffff 32%);
  --pm-block-icon-bg: rgba(100, 116, 139, 0.12);
}

.portal-expense-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.55rem;
}

.portal-expense-category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.portal-expense-category-card:hover {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.08);
}

.portal-expense-category-card.is-selected {
  border-color: #0d9488;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.12);
}

.portal-expense-category-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-expense-category-card__icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
}

.portal-expense-category-card__icon i { width: 1.1rem; height: 1.1rem; }

.portal-expense-category-card__label {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text, #0f172a);
}

.portal-expense-amount-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.portal-expense-summary-hero {
  margin: 0 0 1rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #0f766e;
  letter-spacing: -0.02em;
}

.portal-expense-amount-input {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.portal-expense-currency-select { width: 100%; }

.portal-expense-summary-card h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}

.portal-expense-summary-dl {
  margin: 1rem 0 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.portal-expense-summary-dl dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.portal-expense-summary-dl__amount {
  margin: 0.25rem 0 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: #0f766e;
}

.portal-expense-tips-card h4 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}

.portal-expense-tips {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.portal-expense-file-drop {
  display: block;
  cursor: pointer;
}

.portal-expense-file-drop__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.35rem 1rem;
  border: 2px dashed rgba(13, 148, 136, 0.35);
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.04);
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.portal-expense-file-drop:hover .portal-expense-file-drop__inner,
.portal-expense-file-drop:focus-within .portal-expense-file-drop__inner {
  border-color: #0d9488;
  background: rgba(13, 148, 136, 0.08);
}

.portal-expense-file-drop__inner i { width: 1.75rem; height: 1.75rem; color: #0f766e; }
.portal-expense-file-drop__inner strong { font-size: 0.92rem; }
.portal-expense-file-drop__inner span { font-size: 0.8rem; color: var(--text-muted, #64748b); }
.portal-expense-file-drop__inner em {
  font-style: normal;
  font-size: 0.78rem;
  color: #0f766e;
  margin-top: 0.25rem;
}

.portal-expense-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.portal-entity-picker__wrap {
  position: relative;
}

.portal-entity-picker__search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-muted, #64748b);
  pointer-events: none;
  flex-shrink: 0;
}

.portal-entity-picker__search-icon svg {
  width: 1rem;
  height: 1rem;
}

.portal-entity-picker__wrap:has(.portal-entity-picker__search-icon) .portal-entity-picker__query {
  padding-left: 2.35rem;
}

.portal-pm-form-footer--expenses {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.portal-pm-form-page__flash {
  max-width: 1200px;
  margin: 0 auto 0.75rem;
  padding: 0 1rem;
}

@media (max-width: 960px) {
  .portal-expense-category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Service rental create / edit — single-column layout (matches expense form) */
.portal-pm-form-page--service_rentals .portal-pm-form-sheet--service_rentals {
  border-radius: var(--radius-lg, 12px);
}

.portal-service-rental-form .portal-pm-form-layout,
.portal-service-rental-form .portal-pm-form-layout__side {
  display: contents;
}

.portal-service-rental-amount-bar {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 55%, #22d3ee 100%);
  border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  overflow: hidden;
}

.portal-service-rental-activate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md, 8px);
  border: 1px dashed var(--border, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  cursor: pointer;
}

.portal-service-rental-activate input {
  width: 1rem;
  height: 1rem;
  accent-color: #0891b2;
}

.portal-service-rental-lines {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

.portal-service-rental-lines__table {
  margin: 0;
}

.portal-service-rental-lines__table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  background: var(--surface-2, #f8fafc);
}

.portal-service-rental-lines__table td {
  vertical-align: middle;
  padding: 0.5rem 0.65rem;
}

.portal-service-rental-lines__table .portal-input--sm {
  min-width: 0;
  width: 100%;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
}

.portal-service-rental-lines__table .portal-input--qty {
  max-width: 5.5rem;
}

.portal-service-rental-lines__table .portal-input--unit {
  max-width: 4.5rem;
  min-width: 4rem;
}

.portal-service-rental-line-monthly {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  margin-top: 0.15rem;
}

.portal-service-rental-totals__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  text-align: right;
}

.portal-service-rental-lines__table .portal-input--tax {
  max-width: 4.5rem;
}

.portal-service-rental-line-total {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  font-size: 0.88rem;
}

.portal-service-rental-totals {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-2, #f8fafc);
}

.portal-expense-section--first {
  border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
}

.portal-pm-form-footer--service_rentals {
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
}

.portal-pm-form-footer--service_rentals .portal-btn--lg {
  min-width: 10rem;
}

@media (max-width: 960px) {
  .portal-service-rental-lines__table thead {
    display: none;
  }
  .portal-service-rental-lines__table tr {
    display: block;
    padding: 0.65rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
  }
  .portal-service-rental-lines__table td {
    display: block;
    padding: 0.35rem 0;
  }
  .portal-service-rental-lines__table .portal-input--qty,
  .portal-service-rental-lines__table .portal-input--tax {
    max-width: none;
  }
}

.portal-timeline { display: flex; flex-direction: column; gap: 1rem; }
.portal-timeline__item { padding: 0.85rem 1rem; border-radius: var(--radius-md); background: var(--surface-2, #f8fafc); border: 1px solid var(--border, #e2e8f0); }
.portal-timeline__item.is-internal { border-left: 3px solid var(--primary, #ea580c); }
.portal-timeline__item header { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--text-muted, #64748b); }
.portal-timeline__item p { margin: 0; white-space: pre-wrap; }
.portal-timeline__reply { margin-top: 0.65rem; padding-left: 0.75rem; border-left: 2px solid var(--border, #e2e8f0); }

.portal-pm-hero-colored--support {
  background: linear-gradient(125deg, #881337 0%, #e11d48 45%, #fb7185 100%);
}

.portal-pm-hero-colored--hr {
  background: linear-gradient(125deg, #581c87 0%, #9333ea 45%, #c084fc 100%);
}

.portal-pm-hero-colored--settings {
  background: linear-gradient(125deg, #1e293b 0%, #475569 45%, #94a3b8 100%);
}

.portal-pm-hero-colored--overview {
  background: linear-gradient(125deg, #1e3a8a 0%, var(--primary) 42%, #fb923c 100%);
}

.portal-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.portal-section-tabs__label {
  flex: 0 0 100%;
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-section-tabs .portal-btn {
  width: auto;
}

.portal-section-tabs .portal-btn.is-active,
.portal-section-tabs .portal-btn.portal-btn--primary {
  pointer-events: none;
}

.portal-module-toolbar {
  margin-bottom: 1rem;
}

.portal-mail-table-wrap {
  overflow-x: auto;
}

.portal-mail-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-mail-table th,
.portal-mail-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.portal-mail-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.portal-mail-actions {
  min-width: 8.5rem;
  vertical-align: top;
}

.portal-mail-col--manage {
  width: 1%;
  text-align: center;
}

.portal-mail-col--manage i {
  width: 1rem;
  height: 1rem;
}

.portal-mail-actions__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.portal-mail-actions__icon-form {
  display: inline;
  margin: 0;
}

.portal-mail-actions__icon--active {
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.portal-mail-actions__popover-wrap {
  position: relative;
}

.portal-mail-actions__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  min-width: 16.5rem;
  max-width: min(20rem, 90vw);
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.portal-mail-actions__panel[hidden] {
  display: none;
}

.portal-mail-actions__route-form,
.portal-mail-actions__project-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.portal-mail-actions__route-form select,
.portal-mail-actions__project-form select {
  flex: 1 1 7rem;
  min-width: 0;
  font-size: 0.82rem;
}

.portal-mail-actions__body {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.08);
  border-radius: var(--radius-sm);
  max-height: 7.5rem;
  overflow-y: auto;
  white-space: pre-wrap;
}

.portal-mail-actions__body[hidden] {
  display: none;
}

.portal-mail-actions__label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-mail-row--hidden td {
  opacity: 0.65;
}

.portal-mail-row--support {
  box-shadow: inset 3px 0 0 #d97706;
}

.portal-mail-row--sales {
  box-shadow: inset 3px 0 0 #7c3aed;
}

.portal-mail-row--general {
  box-shadow: inset 3px 0 0 #64748b;
}

.portal-mail-row--spam td {
  background: rgba(220, 38, 38, 0.04);
}

.portal-mail-col--select {
  width: 2.5rem;
}

.portal-mail-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.portal-mail-channel svg {
  width: 13px;
  height: 13px;
}

.portal-mail-channel--support {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
}

.portal-mail-channel--sales {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}

.portal-mail-channel--general {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.25);
}

.portal-mail-mailbox {
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
}

.portal-mail-mailbox.portal-mail-channel--support {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.portal-mail-mailbox.portal-mail-channel--sales {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}

.portal-mail-mailbox.portal-mail-channel--general {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

.portal-mail-assignee {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.portal-mail-assignee--none {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  font-weight: 500;
}

.portal-mail-assignee--c0 { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.2); }
.portal-mail-assignee--c1 { background: rgba(8, 145, 178, 0.12); color: #0e7490; border-color: rgba(8, 145, 178, 0.2); }
.portal-mail-assignee--c2 { background: rgba(21, 128, 61, 0.12); color: #15803d; border-color: rgba(21, 128, 61, 0.2); }
.portal-mail-assignee--c3 { background: rgba(124, 58, 237, 0.12); color: #6d28d9; border-color: rgba(124, 58, 237, 0.2); }
.portal-mail-assignee--c4 { background: rgba(217, 119, 6, 0.12); color: #b45309; border-color: rgba(217, 119, 6, 0.2); }
.portal-mail-assignee--c5 { background: rgba(219, 39, 119, 0.12); color: #be185d; border-color: rgba(219, 39, 119, 0.2); }
.portal-mail-assignee--c6 { background: rgba(234, 88, 12, 0.12); color: #c2410c; border-color: rgba(234, 88, 12, 0.2); }
.portal-mail-assignee--c7 { background: rgba(79, 70, 229, 0.12); color: #4338ca; border-color: rgba(79, 70, 229, 0.2); }

.portal-mail-bulk-bar,
.portal-notify-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.portal-mail-bulk-bar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-btn--warn {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.35);
}

.portal-icon-btn--warn {
  color: #b45309;
}

.portal-mail-subject {
  max-width: 18rem;
}

.portal-mail-from {
  font-size: 0.88rem;
}

.portal-mail-empty {
  color: var(--text-muted);
}

.portal-mail-view-tabs {
  margin-bottom: 0.5rem;
}

.portal-mail-actions__field {
  display: block;
  margin-bottom: 0.45rem;
}

.portal-mail-actions__field-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-mail-actions__field select {
  width: 100%;
}

.portal-mail-actions__block--danger {
  text-align: right;
}

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

.portal-pm-hero-colored__back,
.portal-pm-form-hero-colored__back {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.portal-pm-hero-colored__back a,
.portal-pm-form-hero-colored__back a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.portal-pm-hero-colored__back a:hover,
.portal-pm-form-hero-colored__back a:hover {
  color: #fff;
  text-decoration: underline;
}

.portal-pm-hero-colored__row,
.portal-pm-form-hero-colored__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-pm-hero-colored__main h1,
.portal-pm-form-hero-colored h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.portal-pm-hero-colored__eyebrow,
.portal-pm-form-hero-colored__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 0.45rem;
}

.portal-pm-hero-colored__sub,
.portal-pm-form-hero-colored p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 40rem;
}

.portal-pm-hero-colored__sub svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

.portal-pm-hero-colored__aside,
.portal-pm-form-hero-colored__code {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-start;
  justify-content: flex-end;
}

.portal-pm-hero-colored__aside .portal-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.portal-pm-hero-colored__aside code,
.portal-pm-form-hero-colored__code code {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.portal-pm-form-hero-colored__code {
  flex-direction: column;
  text-align: right;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.portal-pm-form-hero-colored__code span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-bottom: 0.2rem;
}

.portal-pm-hero-colored__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.portal-pm-hero-colored__btn,
.portal-pm-hero-colored__btn-ghost {
  width: auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-pm-hero-colored__btn-ghost {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  box-shadow: none;
  font-weight: 700;
}

.portal-pm-hero-colored__btn-ghost:hover {
  background: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.portal-pm-hero-colored__btn-ghost i,
.portal-pm-hero-colored__btn-ghost svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

/* New Arrived: solid, high-contrast hero actions (not washed-out / disabled-looking) */
.portal-pm-hero-colored__actions .portal-new-arrived-hero-btn {
  opacity: 1 !important;
  filter: none !important;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #ffffff;
  color: #9a3412;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.portal-pm-hero-colored__actions .portal-new-arrived-hero-btn:hover {
  background: #fff7ed;
  color: #7c2d12;
}

.portal-pm-hero-colored__actions .portal-new-arrived-hero-btn.portal-btn--primary,
.portal-pm-hero-colored__actions .portal-new-arrived-hero-btn--primary {
  background: #ffffff;
  color: #c2410c;
  border-color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.portal-pm-hero-colored__actions .portal-new-arrived-hero-btn.portal-btn--primary:hover,
.portal-pm-hero-colored__actions .portal-new-arrived-hero-btn--primary:hover {
  background: #fff7ed;
  color: #9a3412;
}

.portal-new-arrived-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  align-items: end;
}

.portal-new-arrived-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid #fdba74;
  border-radius: var(--radius-lg, 12px);
  background: #fff7ed;
}

.portal-new-arrived-actions .portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.95rem;
  opacity: 1 !important;
  filter: none !important;
  font-weight: 700;
}

.portal-new-arrived-actions .portal-btn--secondary {
  background: #ffffff;
  border: 1px solid #ea580c;
  color: #c2410c;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.12);
}

.portal-new-arrived-actions .portal-btn--secondary:hover {
  background: #ffedd5;
  border-color: #c2410c;
  color: #9a3412;
}

.portal-new-arrived-actions .portal-btn--primary {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #fff;
  border: 1px solid #c2410c;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.28);
}

.portal-new-arrived-actions .portal-btn i,
.portal-new-arrived-actions .portal-btn svg,
.portal-new-arrived-filters .portal-btn i,
.portal-new-arrived-filters .portal-btn svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.portal-new-arrived-actions .portal-btn.is-muted,
.portal-new-arrived-actions .portal-btn[aria-disabled="true"],
.portal-pm-hero-colored__actions .portal-btn.is-muted,
.portal-pm-hero-colored__actions .portal-btn[aria-disabled="true"] {
  opacity: 1;
  filter: none;
  cursor: pointer;
}

.portal-pm-hero-colored__footer {
  margin-top: 0.85rem;
}

.portal-pm-hero-colored__progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.portal-pm-hero-colored__progress-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
}

.portal-pm-page-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.15rem 1.25rem;
}

.portal-pm-page-sheet + .portal-pm-form-sheet,
.portal-pm-hero-colored + .portal-pm-form--single .portal-pm-form-sheet {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: none;
}

.portal-pm-page-sheet .portal-pm-stats--filters {
  margin-bottom: 1rem;
}

.portal-pm-page-sheet .portal-pm-stat--link {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.portal-pm-page-sheet .portal-pm-stat--active {
  background: var(--primary-soft);
}

.portal-pm-page-sheet .portal-pm-qa-hint--page {
  margin: 0 0 0.85rem;
}

.portal-pm-page-sheet .portal-pm-list {
  gap: 0.75rem;
}

.portal-pm-page-sheet .portal-pm-card {
  border-left: 4px solid var(--primary);
}

.portal-pm-page-sheet--quotes .portal-pm-card {
  border-left-color: #2563eb;
}

.portal-pm-page-sheet .portal-pm-pagination {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.portal-pm-page-sheet .portal-pm-tabnav {
  margin: -1rem -1.15rem 1rem;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.portal-pm-page-sheet--quotes .portal-pm-tabnav {
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.portal-pm-page-sheet .portal-pm-qa {
  margin-bottom: 1rem;
}

.portal-pm-page-sheet .portal-pm-show-panel .portal-card,
.portal-pm-page-sheet .portal-pm-detail-card {
  box-shadow: var(--shadow);
  border-left: 4px solid rgba(234, 88, 12, 0.35);
}

.portal-pm-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-pm-report-stat {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border-left: 4px solid #059669;
}

.portal-pm-report-stat span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.portal-pm-report-stat strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.portal-pm-report-block {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(90deg, #eff6ff 0%, #ffffff 24%);
  border-left: 4px solid #2563eb;
}

.portal-pm-report-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.portal-pm-report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.portal-pm-report-list li {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.portal-pm-inbox-block {
  border-left: 4px solid #7c3aed;
  background: linear-gradient(90deg, #f5f3ff 0%, #ffffff 20%);
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border);
}

.portal-pm-inbox-block__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.portal-pm-inbox-block:first-of-type {
  border-top: none;
}

.portal-pm-form-page--single {
  max-width: 920px;
  margin: 0 auto;
}

.portal-pm-form-page--single .portal-pm-hero-colored,
.portal-pm-form-page--single .portal-pm-form-hero-colored {
  margin-bottom: 0;
}

.portal-pm-form--single .portal-pm-form-sheet {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: none;
}

/* Single-page colored project form */
.portal-pm-form-page--single {
  max-width: 920px;
  margin: 0 auto;
}

.portal-pm-form-hero-colored {
  margin-bottom: 1rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(125deg, #7c2d12 0%, var(--primary) 42%, #fb923c 100%);
  box-shadow: var(--shadow-lg);
}

.portal-pm-form-hero-colored__back {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.portal-pm-form-hero-colored__back a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.portal-pm-form-hero-colored__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-pm-form-hero-colored__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 0.45rem;
}

.portal-pm-form-hero-colored h1 {
  margin: 0;
  font-size: 1.65rem;
}

.portal-pm-form-hero-colored p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
}

.portal-pm-form--single {
  max-width: none;
}

.portal-pm-form-sheet {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}

.portal-pm-form-block {
  padding: 1.15rem 1.35rem 1.25rem;
  border-bottom: 1px solid var(--border);
  border-left: 5px solid var(--pm-block-accent, var(--primary));
  background: var(--pm-block-bg, #fff);
}

.portal-pm-form-block__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-pm-form-block__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.portal-pm-form-block__head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-pm-form-block__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--pm-block-icon-bg, var(--primary-soft));
  color: var(--pm-block-accent, var(--primary));
}

.portal-pm-form-block__icon svg {
  width: 18px;
  height: 18px;
}

.portal-pm-form-block--identity {
  --pm-block-accent: #ea580c;
  --pm-block-bg: linear-gradient(90deg, #fff7ed 0%, #ffffff 28%);
  --pm-block-icon-bg: rgba(234, 88, 12, 0.15);
}

.portal-pm-form-block--customer {
  --pm-block-accent: #2563eb;
  --pm-block-bg: linear-gradient(90deg, #eff6ff 0%, #ffffff 28%);
  --pm-block-icon-bg: rgba(37, 99, 235, 0.12);
}

.portal-pm-form-block--team {
  --pm-block-accent: #7c3aed;
  --pm-block-bg: linear-gradient(90deg, #f5f3ff 0%, #ffffff 28%);
  --pm-block-icon-bg: rgba(124, 58, 237, 0.12);
}

.portal-pm-form-block--schedule {
  --pm-block-accent: #059669;
  --pm-block-bg: linear-gradient(90deg, #ecfdf5 0%, #ffffff 28%);
  --pm-block-icon-bg: rgba(5, 150, 105, 0.12);
}

.portal-pm-form-block--details {
  --pm-block-accent: #d97706;
  --pm-block-bg: linear-gradient(90deg, #fffbeb 0%, #ffffff 28%);
  --pm-block-icon-bg: rgba(217, 119, 6, 0.12);
}

.portal-pm-form-block .portal-input,
.portal-pm-form-block .portal-form-field select,
.portal-pm-form-block .portal-form-field textarea {
  background: rgba(255, 255, 255, 0.92);
}

.portal-pm-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.35rem;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-top: 1px solid rgba(234, 88, 12, 0.25);
}

.portal-pm-form-footer__hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.84rem;
  color: #9a3412;
}

.portal-pm-form-footer__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-pm-form-footer__actions .portal-btn {
  width: auto;
}

.portal-pm-form-footer--quotes {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-top-color: rgba(37, 99, 235, 0.25);
}

.portal-pm-form-footer--quotes .portal-pm-form-footer__hint {
  color: #1e40af;
}

.portal-pm-form-sheet--quotes .portal-pm-form-block {
  border-left-color: rgba(37, 99, 235, 0.45);
}

.portal-pm-page-sheet--quotes .portal-pm-detail-card,
.portal-pm-page-sheet--quotes .portal-pm-form-block {
  border-left-color: rgba(37, 99, 235, 0.35);
}

.portal-pm-page-sheet--categories .portal-pm-form-block {
  border-left-color: rgba(217, 119, 6, 0.45);
}

.portal-cat-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.portal-cat-stat {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border-left: 4px solid #d97706;
}

.portal-cat-stat span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.portal-cat-stat strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.portal-cat-add {
  margin-bottom: 1rem;
}

.portal-cat-tree-hint {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
}

.portal-cat-tree-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-cat-tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.portal-cat-tree-toolbar__search {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}

.portal-cat-tree-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.portal-cat-tree__main-head {
  display: flex;
  align-items: stretch;
  position: relative;
}

.portal-cat-tree__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #b45309;
  cursor: pointer;
  border-radius: 6px;
}

.portal-cat-tree__toggle:hover {
  background: rgba(217, 119, 6, 0.12);
}

.portal-cat-tree__toggle--spacer {
  cursor: default;
  pointer-events: none;
}

.portal-cat-tree__toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.portal-cat-tree__item--main > .portal-cat-tree__main-head .portal-cat-tree__row {
  flex: 1 1 auto;
  min-width: 0;
}

.portal-cat-tree__item--main > .portal-cat-tree__main-head .portal-cat-tree__delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
}

.portal-cat-tree__item--collapsed > .portal-cat-tree--nested {
  display: none;
}

.portal-cat-tree__item--search-empty {
  background: #fff;
}

.portal-cat-tree__item--main[hidden],
.portal-cat-tree__item--sub[hidden] {
  display: none;
}

.portal-cat-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-cat-tree--nested {
  margin-left: 1.35rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(217, 119, 6, 0.25);
}

.portal-cat-tree__item {
  position: relative;
  border-bottom: 1px solid var(--border);
}

.portal-cat-tree__item:last-child {
  border-bottom: none;
}

.portal-cat-tree__item--main {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.portal-cat-tree__item--sub {
  background: #fff;
}

.portal-cat-tree__item--root-add {
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  border-bottom: 2px solid rgba(217, 119, 6, 0.2);
}

.portal-cat-tree__item--sub-add {
  background: rgba(255, 247, 237, 0.5);
}

.portal-cat-tree__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  min-height: 2.75rem;
}

.portal-cat-tree__delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
}

.portal-cat-tree__item--main > .portal-cat-tree__main-head .portal-cat-tree__row,
.portal-cat-tree__item--sub > .portal-cat-tree__row {
  padding-right: 2.5rem;
}

.portal-cat-tree__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.portal-cat-tree__glyph--root {
  background: rgba(217, 119, 6, 0.2);
}

.portal-cat-tree__glyph--sub {
  width: 1.5rem;
  height: 1.5rem;
  background: rgba(217, 119, 6, 0.08);
}

.portal-cat-tree__glyph svg {
  width: 15px;
  height: 15px;
}

.portal-cat-tree__branch {
  width: 0.65rem;
  height: 1px;
  background: rgba(217, 119, 6, 0.45);
  flex-shrink: 0;
}

.portal-cat-tree__input {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 0.9rem;
}

.portal-cat-tree__row--main .portal-cat-tree__input {
  font-weight: 600;
}

.portal-cat-tree__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.portal-cat-tree__test-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: center;
  margin-right: 2.4rem;
  padding: 0 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.portal-cat-tree__test-flag input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary, #2563eb);
}

.portal-icon-btn--test {
  color: #0f766e;
}

.portal-cat-tree__tools {
  display: inline-flex;
  align-items: center;
}

.portal-cat-tree__row--add-sub .portal-cat-tree__input {
  font-style: italic;
  color: var(--text-muted);
}

.portal-cat-tree__row--add-sub .portal-cat-tree__input::placeholder {
  font-style: italic;
}

.portal-cat-add__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.portal-form-field--grow {
  flex: 1 1 220px;
  min-width: 0;
}

.portal-cat-list {
  display: grid;
  gap: 0.75rem;
}

.portal-cat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  border-left: 4px solid #d97706;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-cat-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}

.portal-cat-card__identity {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  min-width: 0;
}

.portal-cat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  flex-shrink: 0;
}

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

.portal-cat-card__identity h3 {
  margin: 0;
  font-size: 1.02rem;
}

.portal-cat-card__meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-cat-card__actions,
.portal-cat-sub__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.portal-cat-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.portal-input--sm {
  min-width: 8rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.84rem;
}

.portal-cat-card__body {
  padding: 0.65rem 1rem 0.85rem;
  display: grid;
  gap: 0.45rem;
}

.portal-cat-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: linear-gradient(90deg, #fff7ed 0%, #ffffff 40%);
  border: 1px solid rgba(217, 119, 6, 0.15);
}

.portal-cat-sub__label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.88rem;
}

.portal-cat-sub__label svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.portal-cat-sub-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.portal-cat-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.portal-icon-btn--sm {
  width: 1.85rem;
  height: 1.85rem;
}

.portal-pm-stats--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portal-pm-quote-actions {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-pm-quote-action {
  margin: 0;
}

.portal-pm-quote-action--highlight {
  box-shadow: var(--shadow);
}

.portal-pm-partner-client-actions {
  margin: 0.5rem 0 0.75rem;
}

.portal-pm-quick-client {
  margin-top: 0.75rem;
}

.portal-pm-quick-client summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.portal-pm-quick-client__form {
  margin-top: 0.75rem;
}

.portal-pm-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 1rem;
  align-items: start;
}

.portal-pm-form-layout__main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-pm-form-layout__side {
  position: sticky;
  top: calc(var(--topbar-height, 68px) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-pm-form-section {
  margin: 0;
  box-shadow: var(--shadow);
}

.portal-pm-form-section__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-pm-form-section__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.portal-pm-form-section__icon svg {
  width: 18px;
  height: 18px;
}

.portal-pm-form-section__head-text h3 {
  margin: 0;
}

.portal-pm-form-section__head-text p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-pm-form-sidebar-card {
  box-shadow: var(--shadow);
}

.portal-pm-form-sidebar-card dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.portal-pm-form-sidebar-card dt {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.portal-pm-form-sidebar-card dd {
  margin: 0;
  font-size: 0.92rem;
}

.portal-pm-form-sidebar-card dd code {
  font-size: 0.88rem;
  background: var(--bg);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.portal-pm-form-sidebar__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-pm-form-sidebar__actions .portal-btn {
  width: 100%;
  justify-content: center;
}

.portal-pm-form-hero .portal-pm-show-hero__title {
  font-size: 1.55rem;
}

@media (max-width: 960px) {
  .portal-pm-form-layout {
    grid-template-columns: 1fr;
  }

  .portal-pm-form-layout__side {
    position: static;
    order: -1;
  }
}

.portal-pm-section {
  margin: 0;
}

.portal-pm-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.portal-pm-hint--block {
  margin: 0 0 0.75rem;
}

.portal-pm-form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-pm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-pm-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.portal-pm-stat span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-pm-stat strong {
  font-size: 1.25rem;
}

.portal-pm-detail-card {
  margin: 0;
}

.portal-pm-dl {
  margin: 0;
  display: grid;
  gap: 0.5rem 1rem;
}

.portal-pm-dl dt {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.portal-pm-dl dd {
  margin: 0;
  font-size: 0.92rem;
}

.portal-pm-dl--grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-pm-text {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.portal-pm-scope-note {
  margin: -0.5rem 0 1rem;
  padding: 0.55rem 0.75rem;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.portal-pm-my-projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.portal-pm-my-projects__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.portal-pm-my-projects__item:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.portal-pm-my-projects__item code {
  font-size: 0.75rem;
  color: var(--primary, #2563eb);
}

.portal-pm-my-projects__item strong {
  font-size: 0.92rem;
}

.portal-pm-my-projects__item span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-pm-inbox-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-pm-inbox-item--unread {
  border-left: 3px solid var(--primary, #2563eb);
  padding-left: 0.65rem;
}

.portal-pm-inbox-item p {
  margin: 0.25rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.portal-pm-inbox-item__actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.portal-pm-form .portal-input,
.portal-pm-form select.portal-input,
.portal-pm-form textarea.portal-input {
  width: 100%;
}

.portal-pm-header__cta {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-pm-stats--filters {
  margin-bottom: 1.25rem;
}

.portal-pm-stats--compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.portal-pm-stat--link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-pm-stat--link:hover {
  border-color: var(--primary);
}

.portal-pm-stat--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Project list cards */
.portal-pm-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.portal-pm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.portal-pm-card:hover {
  border-color: rgba(234, 88, 12, 0.35);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.portal-pm-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.portal-pm-card__identity {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.portal-pm-card__code {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--primary);
}

.portal-pm-card__ref {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-pm-health {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 600;
}

.portal-pm-health--ok {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
}

.portal-pm-health--warn {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

.portal-pm-health--bad {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

.portal-pm-card__metrics {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 140px;
}

.portal-pm-card__progress {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}

.portal-pm-card__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 999px;
}

.portal-pm-card__budget {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.portal-pm-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.portal-pm-card__title a {
  color: inherit;
  text-decoration: none;
}

.portal-pm-card__title a:hover {
  color: var(--primary, #2563eb);
}

.portal-pm-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.portal-pm-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.portal-pm-card__meta svg {
  width: 14px;
  height: 14px;
}

.portal-pm-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
}

.portal-pm-empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.portal-pm-pagination {
  margin-top: 1rem;
}

/* Quick action toolbar */
.portal-pm-qa {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow);
}

.portal-pm-qa__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-start;
}

.portal-pm-qa-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.portal-pm-qa-hint--page {
  margin: -0.5rem 0 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 8px;
}

.portal-pm-qa__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.1s;
  position: relative;
}

.portal-pm-qa__btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary, #2563eb);
  transform: translateY(-1px);
}

.portal-pm-qa__btn--open {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--primary, #2563eb);
}

.portal-pm-qa__btn--notify,
.portal-pm-qa__btn--progress {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary, #2563eb);
}

.portal-pm-qa__btn svg {
  width: 15px;
  height: 15px;
}

.portal-pm-qa__label {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  background: #1e293b;
  color: #fff;
  border-radius: 6px;
  pointer-events: none;
  z-index: 5;
}

.portal-pm-qa__btn:hover .portal-pm-qa__label {
  display: block;
}

.portal-pm-qa__item {
  position: relative;
}

.portal-pm-qa__btn--accent.portal-ticket-priority--urgent,
.portal-pm-qa__btn--flag.portal-ticket-priority--urgent {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

.portal-pm-qa__btn--accent.portal-ticket-priority--high,
.portal-pm-qa__btn--flag.portal-ticket-priority--high {
  background: rgba(234, 88, 12, 0.12);
  border-color: rgba(234, 88, 12, 0.35);
  color: #ea580c;
}

.portal-pm-qa__btn--accent.portal-ticket-priority--low,
.portal-pm-qa__btn--flag.portal-ticket-priority--low {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.35);
  color: #64748b;
}

.portal-pm-qa__btn--accent.portal-pm-stage--draft { background: rgba(100, 116, 139, 0.12); border-color: rgba(100, 116, 139, 0.35); color: #475569; }
.portal-pm-qa__btn--accent.portal-pm-stage--sent { background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.35); color: #2563eb; }
.portal-pm-qa__btn--accent.portal-pm-stage--follow { background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.35); color: #7c3aed; }
.portal-pm-qa__btn--accent.portal-pm-stage--nego { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); color: #d97706; }
.portal-pm-qa__btn--accent.portal-pm-stage--won { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #16a34a; }
.portal-pm-qa__btn--accent.portal-pm-stage--lost { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #dc2626; }
.portal-pm-qa__btn--accent.portal-pm-stage--cancelled { background: rgba(100, 116, 139, 0.1); border-color: rgba(100, 116, 139, 0.35); color: #64748b; }
.portal-pm-qa__btn--accent.portal-pm-stage--muted { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.35); color: #64748b; }

.portal-pm-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  min-width: 240px;
  max-width: min(320px, 90vw);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.portal-pm-popover__title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-pm-popover__form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.portal-pm-popover__form .portal-form-field {
  margin: 0;
}

.portal-pm-popover__form textarea {
  resize: vertical;
  min-height: 3rem;
}

.portal-pm-popover__form .portal-btn {
  align-self: flex-start;
}

.portal-pm-quick-panel--focus {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Quote kanban */
.portal-pm-kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
}

.portal-pm-kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 120px;
}

.portal-pm-kanban-col__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.portal-pm-kanban-col__head h3 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-pm-kanban-col__count {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--border);
}

.portal-pm-kanban-col__body {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 70vh;
  overflow-y: auto;
}

.portal-pm-kanban-col__empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.portal-pm-kanban-col--draft .portal-pm-kanban-col__head { border-top: 3px solid #94a3b8; }
.portal-pm-kanban-col--sent .portal-pm-kanban-col__head { border-top: 3px solid #3b82f6; }
.portal-pm-kanban-col--follow .portal-pm-kanban-col__head { border-top: 3px solid #8b5cf6; }
.portal-pm-kanban-col--nego .portal-pm-kanban-col__head { border-top: 3px solid #f59e0b; }
.portal-pm-kanban-col--won .portal-pm-kanban-col__head { border-top: 3px solid #22c55e; }
.portal-pm-kanban-col--lost .portal-pm-kanban-col__head { border-top: 3px solid #ef4444; }

.portal-pm-kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  transition: box-shadow 0.12s;
}

.portal-pm-kanban-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.portal-pm-kanban-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.portal-pm-kanban-card__code {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary, #2563eb);
}

.portal-pm-kanban-card__prob {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.portal-pm-kanban-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.portal-pm-kanban-card__title a {
  color: inherit;
  text-decoration: none;
}

.portal-pm-kanban-card__firm,
.portal-pm-kanban-card__value,
.portal-pm-kanban-card__date {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-pm-kanban-card .portal-pm-qa {
  border-top: none;
  padding-top: 0.5rem;
  margin-top: 0.35rem;
}

.portal-pm-activity-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.portal-pm-activity-row__time {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

@media (max-width: 640px) {
  .portal-pm-qa__btn {
    width: 1.85rem;
    height: 1.85rem;
  }
}

/* Quote pipeline stage badges */
.portal-pm-stage--draft {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.portal-pm-stage--sent {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.portal-pm-stage--follow {
  background: rgba(8, 145, 178, 0.1);
  color: #0891b2;
  border: 1px solid rgba(8, 145, 178, 0.25);
}

.portal-pm-stage--nego {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.portal-pm-stage--won {
  background: rgba(21, 128, 61, 0.1);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.25);
}

.portal-pm-stage--lost {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.portal-pm-stage--cancelled {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.portal-pm-stage--muted {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

/* Quote detail layout */
.portal-pm-quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 1rem;
  align-items: start;
}

.portal-pm-quote-layout__main,
.portal-pm-quote-layout__side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-pm-action-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-pm-action-card .portal-form-field {
  margin: 0;
}

.portal-pm-action-card .portal-btn {
  width: auto;
  align-self: flex-start;
}

.portal-pm-action-card--highlight {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}

.portal-pm-quote-notes {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.portal-pm-quote-notes h4 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-pm-quote-notes p {
  margin: 0;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.portal-pm-quote-comment__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-pm-quote-comment__form textarea {
  min-height: 6rem;
}

.portal-pm-activity-feed {
  display: flex;
  flex-direction: column;
}

.portal-pm-activity-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-pm-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.portal-pm-activity-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.portal-pm-activity-item__event {
  font-weight: 600;
  font-size: 0.9rem;
}

.portal-pm-activity-item__user {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-pm-activity-item__body {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.portal-pm-activity-item__time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .portal-pm-quote-layout {
    grid-template-columns: 1fr;
  }

  .portal-pm-quote-layout__side {
    order: -1;
  }
}

.portal-import-sessions--history {
  margin-top: 1rem;
}

.portal-import-sessions-table td:last-child {
  white-space: nowrap;
}

.portal-import-session-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.portal-import-remove-form {
  display: inline-flex;
  margin: 0;
}

.portal-import-sessions-table td:last-child .portal-import-remove-form {
  margin-left: 0.15rem;
}

.portal-import-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-import-progress {
  font-size: 0.85rem;
}

.portal-import-progress--muted {
  color: var(--text-muted);
}

.portal-import-autosave-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(21, 128, 61, 0.08);
  border: 1px solid rgba(21, 128, 61, 0.2);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Notification center */
.portal-icon-btn--badge {
  position: relative;
}

.portal-icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.portal-notify-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.portal-notify-channels-hint {
  margin-bottom: 1rem;
}

.portal-notify-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portal-notify-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-notify-channel svg {
  width: 14px;
  height: 14px;
}

.portal-notify-channel--on {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--primary, #2563eb);
}

.portal-notify-channel--soon em {
  font-style: normal;
  font-size: 0.72rem;
  opacity: 0.75;
}

.portal-notify-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-notify-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.portal-notify-item--unread {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: inset 3px 0 0 var(--primary, #2563eb);
}

.portal-notify-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.portal-notify-item__head time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-notify-item__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.portal-notify-item__body {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.portal-notify-item__actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.portal-notify-cat--project { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.portal-notify-cat--quote { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.portal-notify-cat--ticket { background: rgba(217, 119, 6, 0.1); color: #d97706; }
.portal-notify-cat--rental { background: rgba(8, 145, 178, 0.1); color: #0891b2; }
.portal-notify-cat--warehouse { background: rgba(21, 128, 61, 0.1); color: #15803d; }
.portal-notify-cat--system { background: rgba(100, 116, 139, 0.12); color: #64748b; }

.portal-notify-stats {
  margin-bottom: 0.75rem;
}

.portal-notify-cat-filters,
.portal-mail-cat-filters {
  margin-bottom: 0.75rem;
}

.portal-notify-cat-filters .portal-pm-stat span,
.portal-mail-cat-filters .portal-pm-stat span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-notify-cat-filters .portal-pm-stat svg,
.portal-mail-cat-filters .portal-pm-stat svg {
  width: 14px;
  height: 14px;
}

.portal-notify-list.portal-card,
.portal-mail-list.portal-card {
  padding: 1rem 1.1rem;
}

.portal-module-alert {
  margin-bottom: 1rem;
}

.portal-notify-list__toolbar,
.portal-mail-list__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.portal-mail-list__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: min(100%, 280px);
}

.portal-notify-list__actions,
.portal-mail-list__toolbar .portal-notify-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.portal-notify-filters {
  flex: 1;
  min-width: min(100%, 320px);
}

.portal-notify-table,
.portal-mail-table.portal-ticket-table {
  min-width: 760px;
}

.portal-mail-table.portal-ticket-table {
  min-width: 980px;
}

.portal-notify-table .portal-notify-col-icon,
.portal-mail-col-icon {
  width: 3rem;
}

.portal-notify-row__icon-wrap,
.portal-mail-row__icon .portal-notify-row__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
}

.portal-notify-row__icon-wrap svg,
.portal-mail-row__icon svg {
  width: 16px;
  height: 16px;
}

.portal-notify-row--unread .portal-notify-row__title strong,
.portal-mail-row__subject {
  font-weight: 600;
}

.portal-notify-row--unread .portal-notify-row__title strong {
  font-weight: 700;
}

.portal-notify-row__title--unread strong {
  color: var(--text);
}

.portal-notify-row__excerpt {
  display: block;
  max-width: 42rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-notify-row--hidden,
.portal-mail-row--hidden td {
  opacity: 0.72;
}

.portal-mail-stats {
  margin-bottom: 0.75rem;
}

.portal-mail-row--support {
  box-shadow: inset 3px 0 0 #d97706;
}

.portal-mail-row--sales {
  box-shadow: inset 3px 0 0 #7c3aed;
}

.portal-mail-row--general {
  box-shadow: inset 3px 0 0 #64748b;
}

.portal-mail-row--spam td {
  background: rgba(220, 38, 38, 0.03);
}

.portal-mail-row__body {
  margin-top: 0.35rem;
}

.portal-mail-row-toolbar__inner {
  position: relative;
}

.portal-mail-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.portal-mail-channel svg {
  width: 13px;
  height: 13px;
}

.portal-mail-channel--support {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
}

.portal-mail-channel--sales {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}

.portal-mail-channel--general {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.25);
}

.portal-mail-mailbox {
  font-size: 0.76rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: transparent;
}

.portal-mail-assignee {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.portal-mail-assignee--none {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  font-weight: 500;
}

.portal-mail-assignee--c0 { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.2); }
.portal-mail-assignee--c1 { background: rgba(8, 145, 178, 0.12); color: #0e7490; border-color: rgba(8, 145, 178, 0.2); }
.portal-mail-assignee--c2 { background: rgba(21, 128, 61, 0.12); color: #15803d; border-color: rgba(21, 128, 61, 0.2); }
.portal-mail-assignee--c3 { background: rgba(124, 58, 237, 0.12); color: #6d28d9; border-color: rgba(124, 58, 237, 0.2); }
.portal-mail-assignee--c4 { background: rgba(217, 119, 6, 0.12); color: #b45309; border-color: rgba(217, 119, 6, 0.2); }
.portal-mail-assignee--c5 { background: rgba(219, 39, 119, 0.12); color: #be185d; border-color: rgba(219, 39, 119, 0.2); }
.portal-mail-assignee--c6 { background: rgba(234, 88, 12, 0.12); color: #c2410c; border-color: rgba(234, 88, 12, 0.2); }
.portal-mail-assignee--c7 { background: rgba(79, 70, 229, 0.12); color: #4338ca; border-color: rgba(79, 70, 229, 0.2); }

.portal-mail-empty {
  color: var(--text-muted);
}

.portal-btn--warn {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.35);
}

.portal-icon-btn--warn {
  color: #b45309;
}

.portal-ticket-stat--warn .portal-ticket-stat__value {
  color: var(--primary, #2563eb);
}

.portal-notify-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.portal-notify-settings-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.portal-notify-setting {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  cursor: pointer;
}

.portal-notify-setting input {
  margin-top: 0.35rem;
}

.portal-notify-setting__box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  flex: 1;
  min-height: 100%;
}

.portal-notify-setting__box strong {
  font-size: 0.92rem;
}

.portal-notify-setting__box span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.portal-notify-setting__warn,
.portal-notify-setting__soon {
  font-size: 0.78rem;
  color: #d97706;
  font-style: normal;
}

.portal-notify-setting--disabled {
  opacity: 0.72;
}

.portal-notify-responsible-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.portal-notify-responsible-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.portal-notify-responsible-list svg {
  width: 16px;
  height: 16px;
  color: var(--primary, #2563eb);
}

.portal-notify-device-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-notify-device-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.portal-notify-device-list em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.portal-notify-device-list svg {
  width: 16px;
  height: 16px;
  color: var(--primary, #2563eb);
}

/* Project phases */
.portal-pm-phases {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-pm-phase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.portal-pm-phase--overdue {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: inset 3px 0 0 #dc2626;
}

.portal-pm-phase--delayed {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: inset 3px 0 0 #d97706;
}

.portal-pm-phase--done {
  opacity: 0.85;
  background: rgba(21, 128, 61, 0.04);
  border-color: rgba(21, 128, 61, 0.25);
}

.portal-pm-phase__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.portal-pm-phase__num {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.portal-pm-phase__head h4 {
  margin: 0 0 0.25rem;
}

.portal-pm-phase__amount {
  margin-left: auto;
  white-space: nowrap;
}

.portal-pm-phase__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-pm-phase__meta svg {
  width: 14px;
  height: 14px;
}

.portal-pm-phase__delay {
  color: #d97706;
}

.portal-pm-phase__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.portal-pm-phase-delay__form {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 220px;
}

.portal-pm-phase-admin {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.portal-pm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
}

.portal-pm-meeting-form .portal-form-field {
  margin: 0;
}

.portal-pm-meeting-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-pm-progress-range {
  width: 100%;
}

.portal-pm-progress-output {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Integrations tab navigation */
.portal-integration-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.portal-integration-nav__btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 9.5rem;
  max-width: 14rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.25;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.portal-integration-nav__btn:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.portal-integration-nav__btn.is-active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.portal-integration-nav__btn.is-soon {
  opacity: 0.72;
}

.portal-integration-nav__btn svg {
  width: 18px;
  height: 18px;
  color: #2563eb;
}

.portal-integration-nav__label {
  font-weight: 600;
}

.portal-integration-nav__status {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.portal-integration-nav__status--ok {
  color: #10b981;
}

.portal-integration-nav-hint {
  margin: 0 0 1rem;
}

.portal-integration-panel {
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .portal-integration-nav__btn {
    min-width: calc(50% - 0.35rem);
    max-width: none;
    flex: 1 1 calc(50% - 0.35rem);
  }
}

/* Dashboard redesign */
.portal-dashboard-page .portal-pm-hero-colored {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.portal-dashboard-page .portal-pm-page-sheet {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.portal-dash-currency {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.07) 0%, rgba(37, 99, 235, 0.02) 100%);
}

.portal-dash-currency__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 0.88rem;
}

.portal-dash-currency__head svg {
  width: 1rem;
  height: 1rem;
  color: var(--primary, #2563eb);
}

.portal-dash-currency__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.portal-dash-currency__pending {
  font-style: normal;
  font-weight: 600;
  margin-inline-start: 0.35rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.portal-dash-currency__rates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}

.portal-dash-currency__rate {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.portal-dash-currency__rate strong {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-dashboard-top {
  display: none;
}

.portal-dashboard-hero-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  width: 100%;
}

.portal-pm-hero-colored__footer .portal-dashboard-hero-bar {
  padding-top: 0.85rem;
  margin-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.portal-dashboard-datetime__shamsi {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.portal-dashboard-page .portal-dashboard-datetime__date,
.portal-dashboard-page .portal-dashboard-datetime__time {
  color: #fff;
}

.portal-dashboard-page .portal-dashboard-datetime__weekday {
  color: rgba(255, 255, 255, 0.78);
}

.portal-dash-currency--hero {
  flex: 1 1 320px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.portal-dash-currency--hero .portal-dash-currency__head strong,
.portal-dash-currency--hero .portal-dash-currency__rate span {
  color: #fff;
}

.portal-dash-currency--hero .portal-dash-currency__meta,
.portal-dash-currency--hero .portal-dash-currency__rate strong {
  color: rgba(255, 255, 255, 0.78);
}

.portal-dash-currency__type-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.portal-dash-currency__type-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.portal-dash-currency__change.is-up {
  color: #86efac;
}

.portal-dash-currency__change.is-down {
  color: #fca5a5;
}

.portal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.portal-footer__copy a {
  color: inherit;
  text-decoration: none;
}

.portal-footer__copy a:hover {
  text-decoration: underline;
}

.portal-footer__credit {
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: default;
}

.portal-footer__version {
  margin-left: auto;
}

.portal-dashboard-datetime {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  line-height: 1.2;
}

.portal-dashboard-datetime__date,
.portal-dashboard-datetime__time {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.portal-dashboard-datetime__time {
  font-variant-numeric: tabular-nums;
}

.portal-dashboard-datetime__weekday {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.portal-dashboard-role-switcher--top {
  margin: 0;
  margin-left: auto;
}

.portal-pm-hero-colored__footer .portal-dashboard-role-switcher--top .portal-role-switcher__btn {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.portal-pm-hero-colored__footer .portal-dashboard-role-switcher--top .portal-role-switcher__btn.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary, #2563eb);
}

.portal-dashboard-role-switcher--top .portal-role-switcher__btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  justify-content: center;
  border-radius: 12px;
}

.portal-dashboard-role-switcher--top .portal-role-switcher__btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.portal-dashboard-alerts-grid--summary {
  gap: 0.85rem;
}

.portal-dash-summary-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-dash-summary-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.portal-dash-summary-card--warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07) 0%, var(--surface) 2.5rem);
}

.portal-dash-summary-card--active {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, var(--surface) 2.5rem);
}

.portal-dash-summary-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}

.portal-dash-summary-card--warn .portal-dash-summary-card__icon {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.portal-dash-summary-card__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.portal-dash-summary-card__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.55rem;
  min-width: 0;
  flex: 1;
}

.portal-dash-summary-card__label {
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-dash-summary-card__value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.portal-dash-summary-card__status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.portal-dash-summary-card__status--warn {
  color: #b45309;
}

.portal-dash-summary-card__status--notify {
  color: #1d4ed8;
}

.portal-dash-summary-card__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.portal-dash-summary-card__arrow {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.55;
}

.portal-dashboard-alerts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 960px) {
  .portal-dashboard-alerts-grid {
    grid-template-columns: 1fr;
  }
}

.portal-dash-alert-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  min-height: 0;
}

.portal-dash-alert-panel--warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07) 0%, var(--surface) 2.5rem);
}

.portal-dash-alert-panel--notify {
  border-color: rgba(37, 99, 235, 0.28);
}

.portal-dash-alert-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.portal-dash-alert-panel__title {
  margin: 0;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-dash-alert-panel__title svg {
  width: 1rem;
  height: 1rem;
  color: var(--primary, #2563eb);
}

.portal-dash-alert-panel--warn .portal-dash-alert-panel__title svg {
  color: #d97706;
}

.portal-dash-alert-panel__sub {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.portal-dash-alert-panel__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
}

.portal-dash-alert-panel__badge--warn {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.portal-dash-alert-panel__badge--notify {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.portal-dash-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.portal-dash-alert-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.portal-dash-alert-item--warn {
  border-color: rgba(245, 158, 11, 0.35);
}

.portal-dash-alert-item--unread {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
}

.portal-dash-alert-item__trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.portal-dash-alert-item__trigger[aria-expanded="true"] .portal-dash-alert-item__chevron {
  transform: rotate(180deg);
}

.portal-dash-alert-item__chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.portal-dash-alert-item__main {
  min-width: 0;
  flex: 1;
}

.portal-dash-alert-item__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.portal-dash-alert-item__top time {
  margin-left: auto;
}

.portal-dash-alert-item__subject {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.portal-dash-alert-item__from {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-dash-alert-item__detail {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px dashed var(--border);
}

.portal-dash-alert-item__body {
  padding: 0.65rem 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.portal-dash-alert-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.portal-dash-alert-item__link,
.portal-dash-alert-item__static {
  display: block;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  color: inherit;
}

.portal-dash-alert-item__link strong,
.portal-dash-alert-item__static strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.portal-dash-alert-item__link span,
.portal-dash-alert-item__static span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-dash-alert-empty {
  padding: 0.85rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem;
  align-items: start;
}

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

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

.portal-dashboard-panel--qa {
  position: sticky;
  top: 1rem;
}

.portal-dashboard-qa-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-dashboard-qa-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.portal-dashboard-qa-row:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.12);
}

.portal-dashboard-qa-row > svg:first-child {
  width: 1rem;
  height: 1rem;
  color: var(--primary, #2563eb);
  flex-shrink: 0;
}

.portal-dashboard-qa-row__arrow {
  width: 0.9rem;
  height: 0.9rem;
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
}

.portal-badge--warn {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.portal-dashboard-page .portal-pm-hero-colored__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.portal-version-badge--hero {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.portal-version-badge--hero .portal-version-badge__label,
.portal-version-badge--hero .portal-version-badge__value {
  color: #fff;
}

.portal-badge--hero {
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.portal-dashboard-sheet {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.portal-dashboard-role-switcher {
  margin-bottom: 0;
}

.portal-dashboard-role-switcher .portal-role-switcher__btn {
  width: auto;
  min-width: 36px;
  height: auto;
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-dashboard-role-switcher .portal-role-switcher__btn span {
  font-size: 0.78rem;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-dashboard-stats {
  margin-bottom: 0;
}

.portal-dashboard-stat__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.portal-dashboard-stat__label svg {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.7;
}

.portal-dashboard-stat__hint {
  font-size: 0.72rem;
  font-style: normal;
  color: #d97706;
}

.portal-dashboard-stat--warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.06);
}

.portal-dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.portal-dashboard-panel--mail {
  border-color: rgba(8, 145, 178, 0.35);
  background: linear-gradient(180deg, rgba(8, 145, 178, 0.06) 0%, var(--surface) 3rem);
}

.portal-dashboard-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.portal-dashboard-panel__title {
  margin: 0;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-dashboard-panel__title svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary, #2563eb);
}

.portal-dashboard-panel--mail .portal-dashboard-panel__title svg {
  color: #0891b2;
}

.portal-dashboard-panel__sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-dashboard-mail-stats {
  margin-bottom: 0.85rem;
}

.portal-dashboard-mail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.portal-dashboard-mail-item {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.portal-dashboard-mail-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-dashboard-mail-item__subject {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.portal-dashboard-mail-item__from {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.portal-dashboard-mail-item__foot {
  margin-top: 0.45rem;
}

.portal-dashboard-mail-item__pending {
  font-size: 0.78rem;
  color: #d97706;
}

.portal-dashboard-mail-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.portal-dashboard-qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.65rem;
}

.portal-dashboard-qa-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  font-size: 0.82rem;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.1s;
}

.portal-dashboard-qa-card svg {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--primary, #2563eb);
}

.portal-dashboard-qa-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.portal-dashboard-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.portal-dashboard-warehouse-pills {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.portal-dashboard-notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-dashboard-notify-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-dashboard-notify-item:last-child {
  border-bottom: none;
}

.portal-dashboard-notify-item--unread {
  border-left: 3px solid var(--primary, #2563eb);
  padding-left: 0.65rem;
}

.portal-dashboard-notify-item p {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .portal-dashboard-role-switcher .portal-role-switcher__btn span {
    display: none;
  }

  .portal-dashboard-qa-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Service rental — detail / show page */
.portal-sr-show-page .portal-pm-page-sheet--service-rentals {
  padding-top: 0.25rem;
}

.portal-sr-show__stats {
  margin-bottom: 1.25rem;
}

.portal-sr-show__stat--primary strong {
  color: var(--primary, #ea580c);
  font-size: 1.05rem;
}

.portal-sr-show__grid {
  gap: 1rem;
}

.portal-sr-show__amount {
  color: var(--primary, #ea580c);
}

.portal-sr-show__notes {
  margin-top: 1rem;
}

.portal-sr-show__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.portal-sr-show__table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.portal-sr-show__table-head .portal-card__title {
  margin: 0;
}

.portal-sr-show__table-card {
  padding: 1rem 1.15rem;
}

.portal-sr-show__billing-toolbar {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.portal-sr-show__billing-toolbar .portal-form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.portal-sr-show__hint {
  font-size: 0.85rem;
  margin: 0.35rem 0 0.75rem;
}

.portal-sr-show__reply-form {
  margin-top: 0.5rem;
}

.portal-sr-show__history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-sr-show__history li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.portal-sr-show__history li [data-lucide] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--text-muted, #64748b);
}

.portal-badge--sr-draft { background: #f1f5f9; color: #475569; }
.portal-badge--sr-active { background: #ecfdf5; color: #047857; }
.portal-badge--sr-suspended { background: #fffbeb; color: #b45309; }
.portal-badge--sr-ended { background: #f8fafc; color: #64748b; }
.portal-badge--sr-cancelled { background: #fef2f2; color: #b91c1c; }

.portal-input--xs {
  width: 5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
}

/* Service rental — list row */
.portal-sr-row__track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-sr-row__alarm {
  display: inline-flex;
  color: #dc2626;
  animation: portal-sr-alarm-pulse 2s ease-in-out infinite;
}

.portal-sr-row__alarm [data-lucide] {
  width: 16px;
  height: 16px;
}

@keyframes portal-sr-alarm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.portal-sr-invoice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.portal-sr-invoice-chip {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.portal-sr-invoice-chip:hover {
  background: #dbeafe;
}

.portal-sr-invoice-chip--more {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

.portal-table-wrap--service-rentals {
  overflow-x: visible;
}

.portal-table--service-rentals .portal-sr-row-main td {
  border-bottom: none;
  padding-bottom: 0.35rem;
}

.portal-table--service-rentals .portal-sr-row-main.portal-sr-row--overdue td {
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.45) 0%, transparent 55%);
}

.portal-table--service-rentals .portal-sr-row-toolbar td {
  padding-top: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #fafbfc;
}

.portal-table--service-rentals .portal-sr-row-toolbar.portal-sr-row--overdue td {
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.35) 0%, #fafbfc 45%);
}

.portal-sr-row-toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.45rem 0.15rem 0.15rem;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.portal-sr-row-toolbar__invoices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  min-width: 0;
  flex: 1 1 12rem;
}

.portal-sr-row-toolbar__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.portal-sr-row-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  flex: 0 1 auto;
}

.portal-table--service-rentals .portal-icon-btn svg {
  width: 16px;
  height: 16px;
}

.portal-icon-btn--warn {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.portal-icon-btn--success {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.portal-icon-btn--accent {
  color: #0891b2;
  border-color: #a5f3fc;
  background: #ecfeff;
}

.portal-icon-btn--has-doc {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.portal-table--service-rentals td {
  vertical-align: middle;
}

.portal-sr-renew-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.portal-sr-renew-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.portal-sr-renew-dialog__panel {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.1rem 1.25rem 1rem;
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border, #e2e8f0);
}

.portal-sr-renew-dialog__title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.portal-sr-renew-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.portal-sr-renew-dialog__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.portal-sr-renew-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Service rental — notes tab */
.portal-sr-notes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 820px;
}

.portal-sr-notes__help {
  margin: -0.25rem 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.portal-sr-notes__form-actions {
  margin-top: 0.5rem;
}

.portal-sr-notes__feed-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.portal-sr-notes__feed-head .portal-card__title {
  margin: 0;
}

.portal-sr-notes__feed .portal-ticket-message {
  margin: 0 -1rem;
  padding: 0.85rem 1rem;
}

.portal-sr-notes__feed .portal-ticket-message:first-of-type {
  border-top: 1px solid var(--border, #e2e8f0);
  margin-top: 0.5rem;
}

.portal-sr-notes__replies {
  margin: 0.65rem 0 0 0.75rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--border, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-sr-notes__reply .portal-ticket-message__meta {
  margin-bottom: 0.25rem;
}

.portal-sr-notes__reply.is-internal {
  background: #fffbeb;
  margin: 0 -0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm, 6px);
}

.portal-sr-notes__reply-toggle {
  margin-top: 0.65rem;
}

.portal-sr-notes__reply-toggle summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--primary, #ea580c);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.portal-sr-notes__reply-toggle summary::-webkit-details-marker {
  display: none;
}

.portal-sr-notes__reply-toggle summary [data-lucide] {
  width: 14px;
  height: 14px;
}

.portal-sr-notes__reply-form {
  margin-top: 0.65rem;
  padding: 0.75rem;
  background: var(--surface-2, #f8fafc);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border, #e2e8f0);
}

.portal-sr-notes__reply-form .portal-form-field {
  margin-bottom: 0.5rem;
}

.portal-sr-notes__reply-form textarea {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
}

.portal-sr-notes__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 2rem 1rem 1.5rem;
  color: var(--text-muted, #64748b);
}

.portal-sr-notes__empty [data-lucide] {
  width: 36px;
  height: 36px;
  opacity: 0.45;
  margin-bottom: 0.35rem;
}

.portal-sr-notes__empty p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text, #334155);
}

.portal-sr-notes__empty .portal-text-muted {
  font-size: 0.85rem;
}

.portal-role-permissions__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.portal-role-permissions__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.portal-role-permissions__group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.portal-role-permissions__group-head .portal-firm-modal__card-title {
  margin: 0;
}

.portal-role-permissions__select-all {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.portal-role-permissions__group {
  margin-bottom: 1rem;
}

.portal-role-permissions__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.45rem 1rem;
}

.portal-role-permissions__item {
  align-items: flex-start;
  gap: 0.45rem;
}

.portal-role-permissions__label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.portal-role-permissions__kind {
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-role-permissions__item--menu .portal-role-permissions__kind {
  color: var(--primary, #2563eb);
}

.portal-role-permissions__code {
  margin-left: auto;
  font-size: 0.62rem;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

/* RTL (Persian) */
body.portal-rtl {
  font-family: 'Vazirmatn', 'Plus Jakarta Sans', system-ui, sans-serif;
}

html[dir="rtl"] .portal-sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}

html[dir="rtl"] .portal-main {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

html[dir="rtl"] .portal-topbar__search input {
  text-align: right;
}

html[dir="rtl"] .portal-form-field input,
html[dir="rtl"] .portal-form-field select,
html[dir="rtl"] .portal-form-field textarea {
  text-align: right;
}

.portal-lang-switch--stacked {
  flex-direction: column;
  align-items: stretch;
}

.portal-lang-switch--stacked a {
  text-align: center;
}

.portal-lang-switch--compact a {
  min-width: 2rem;
  text-align: center;
  padding: 0.35rem 0.45rem;
}

@media (max-width: 900px) {
  html[dir="rtl"] .portal-main {
    margin-right: 0;
  }
}

/* Locale translation editor */
.portal-locale-editor__top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.portal-locale-editor__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  flex: 1 1 320px;
}

.portal-locale-editor__search {
  min-width: min(100%, 280px);
  flex: 1 1 220px;
}

.portal-locale-editor__check .portal-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  font-size: 0.9rem;
}

.portal-locale-editor__stats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-locale-editor__ui-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.portal-locale-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}

.portal-locale-editor__toolbar--bottom {
  margin-top: 1rem;
}

.portal-locale-editor__page {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portal-locale-editor__table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.portal-locale-editor__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.portal-locale-editor__table th,
.portal-locale-editor__table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  vertical-align: top;
}

.portal-locale-editor__table th {
  background: var(--surface-elevated, #f8fafc);
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

.portal-locale-editor__key code {
  font-size: 0.78rem;
  word-break: break-all;
}

.portal-locale-editor__input {
  width: 100%;
  min-width: 10rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  resize: vertical;
}

.portal-locale-editor__input.is-missing {
  border-color: #f59e0b;
  background: #fffbeb;
}

.portal-locale-editor__table tr.is-missing .portal-locale-editor__key code {
  color: #b45309;
}

.portal-locale-editor__empty {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

.portal-locale-editor__pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.portal-locale-editor__pager a {
  min-width: 2rem;
  text-align: center;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.portal-locale-editor__pager a.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
  font-weight: 600;
}

/* Embedded in iOS / Android app WebView — full module tools, no duplicate app chrome */
body.portal-mobile-embed .portal-sidebar,
body.portal-mobile-embed .portal-sidebar-backdrop {
  display: none !important;
}

body.portal-mobile-embed .portal-main {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.portal-mobile-embed .portal-topbar__menu-btn {
  display: none;
}

body.portal-mobile-embed .portal-footer {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

/* Personnel staff cards */
.portal-staff-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.portal-staff-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-staff-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #fff);
  overflow: hidden;
}

.portal-staff-card--open {
  border-color: var(--accent, #0d9488);
  box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.15);
}

.portal-staff-card__main {
  display: grid;
  grid-template-columns: minmax(10rem, 1.2fr) minmax(12rem, 2fr) minmax(8rem, 1fr) minmax(9rem, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
}

@media (max-width: 1100px) {
  .portal-staff-card__main {
    grid-template-columns: 1fr 1fr;
  }
  .portal-staff-card__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .portal-staff-card__main {
    grid-template-columns: 1fr;
  }
}

.portal-staff-card__name {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.portal-staff-card__code {
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.35rem;
}

.portal-staff-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.8125rem;
}

.portal-staff-card__meta dt {
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}

.portal-staff-card__meta dd {
  margin: 0;
  text-align: left;
}

.portal-staff-card__user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.portal-staff-card__fingerprint {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.portal-staff-card__fingerprint-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.portal-staff-card__fp-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  max-width: 100%;
}

.portal-staff-card__fp-form .portal-input {
  width: 5.5rem;
  min-width: 0;
  flex: 0 1 auto;
}

.portal-staff-card__actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.portal-staff-card__edit {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
  background: var(--surface-alt, #f8fafc);
}

/* Attendance monthly calendar */
.portal-attendance-monthly__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.portal-attendance-monthly__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.portal-attendance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.portal-attendance-legend__item {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid transparent;
}

.portal-attendance-legend__item--full { background: #dcfce7; color: #166534; }
.portal-attendance-legend__item--partial { background: #fef9c3; color: #854d0e; }
.portal-attendance-legend__item--overtime { background: #dbeafe; color: #1e40af; }
.portal-attendance-legend__item--undertime { background: #fee2e2; color: #991b1b; }
.portal-attendance-legend__item--absent { background: #f1f5f9; color: #64748b; }

.portal-table-wrap--attendance-cal {
  overflow-x: auto;
  max-width: 100%;
}

.portal-table--attendance-cal {
  font-size: 0.6875rem;
  min-width: 720px;
}

.portal-table--attendance-cal th,
.portal-table--attendance-cal td {
  text-align: center;
  vertical-align: middle;
  padding: 0.25rem 0.15rem;
}

.portal-attendance-cal__name {
  text-align: left !important;
  min-width: 8rem;
  max-width: 10rem;
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}

.portal-attendance-cal__day {
  min-width: 2.1rem;
  line-height: 1.1;
}

.portal-attendance-cal__dow {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  font-weight: 500;
}

.portal-attendance-cal__tot {
  min-width: 2.5rem;
  font-weight: 600;
  background: var(--surface-alt, #f8fafc);
}

.portal-attendance-cal__cell {
  font-size: 0.625rem;
  line-height: 1.15;
  cursor: default;
}

.portal-attendance-cal__cell--full { background: #ecfdf5; }
.portal-attendance-cal__cell--partial { background: #fefce8; }
.portal-attendance-cal__cell--overtime { background: #eff6ff; }
.portal-attendance-cal__cell--undertime { background: #fef2f2; }
.portal-attendance-cal__cell--absent { background: #f8fafc; color: var(--muted); }

.portal-attendance-cal__in,
.portal-attendance-cal__out {
  display: block;
}

.portal-attendance-cal__in { color: #166534; }
.portal-attendance-cal__out { color: #1e40af; }


/* Warehouse intake / manual entry quantity stepper */
.portal-intake-qty {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}
.portal-intake-qty__input {
  flex: 1 1 auto;
  min-width: 4.5rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: auto !important;
}
.portal-intake-qty__btn {
  flex: 0 0 2.5rem;
  min-width: 2.5rem;
  padding: 0.4rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}
.portal-intake-qty__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* RMA photo lightbox + open problem banner */
.portal-rma-photo-lightbox-modal[hidden] { display: none !important; }
.portal-rma-photo-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-rma-photo-lightbox-modal .portal-rma-photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.portal-rma-photo-lightbox-modal .portal-rma-photo-lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  margin: 1rem;
}
.portal-rma-photo-lightbox-modal .portal-rma-photo-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.portal-rma-photo-lightbox-modal .portal-rma-photo-lightbox__close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.portal-stock-card-images__preview.portal-rma-photo-trigger {
  border: none;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.portal-stock-card-images__preview.portal-rma-photo-trigger img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.portal-rma-problem-banner {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #f59e0b;
  border-left-width: 4px;
  border-radius: 10px;
  background: #fffbeb;
}
.portal-rma-problem-banner__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #92400e;
  margin-bottom: 0.35rem;
}
.portal-rma-problem-banner__head svg { width: 1.1rem; height: 1.1rem; }
.portal-rma-problem-banner__body {
  white-space: pre-wrap;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #1f2937;
}
.portal-rma-problem-banner__body--empty {
  color: #6b7280;
  font-style: italic;
}
