:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6f7b8e;
  --line: #e6ebf2;
  --brand: #0a5ea8;
  --brand-dark: #084879;
  --soft: #edf5fc;
  --success: #0c7a49;
  --warning: #9a6b00;
  --danger: #b43b3b;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }
.center-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, #d9ecff 0, transparent 35%),
    linear-gradient(135deg, #f9fbfe, #edf3fa);
}
.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 18px 60px rgba(30, 70, 110, .12);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-row h1, .brand-row p { margin: 0; }
.brand-row p, .brand-row small { color: var(--muted); }
.brand-row.compact { margin-bottom: 28px; }
.brand-row.compact div:last-child { display: flex; flex-direction: column; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-weight: 800;
}
label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 650;
  font-size: 14px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid #dbe2ec;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  background: white;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: #7eb4e2;
  box-shadow: 0 0 0 3px rgba(10, 94, 168, .10);
}
.primary {
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  padding: 12px 18px;
  font-weight: 750;
}
.primary:hover { background: var(--brand-dark); }
.full { width: 100%; margin-top: 22px; }
.error { color: var(--danger); margin-top: 12px; min-height: 20px; }
.muted { color: var(--muted); }

#portalView { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: #0b2440;
  color: white;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}
.sidebar nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #d7e4f2;
  text-align: left;
  border-radius: 10px;
  padding: 12px 14px;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.10);
  color: white;
}
.nav-item.danger { margin-top: auto; color: #ffd0d0; }

.main { margin-left: 250px; min-height: 100vh; }
.topbar {
  min-height: 94px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h2, .topbar p { margin: 0; }
.topbar p { margin-top: 5px; }
.user-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 700;
  color: var(--brand-dark);
}

.page-view { padding: 28px 32px 40px; }
.hero {
  min-height: 230px;
  padding: 34px;
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(5,60,105,.92), rgba(10,94,168,.84)),
    linear-gradient(45deg, #113b65, #0a5ea8);
  color: white;
  display: grid;
  gap: 24px;
  align-items: end;
  grid-template-columns: 1.15fr .85fr;
  box-shadow: 0 16px 40px rgba(10, 70, 120, .14);
}
.hero h1 { font-size: 42px; margin: 8px 0; }
.hero p { max-width: 700px; color: #e7f2fd; }
.eyebrow {
  letter-spacing: .15em;
  font-size: 12px;
  font-weight: 800;
  color: #b9dbf7;
}
.search-box {
  background: white;
  padding: 10px;
  border-radius: 16px;
  display: flex;
  gap: 8px;
}
.search-box input { border: 0; box-shadow: none; }

.kpi-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi, .panel, .detail-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.kpi { padding: 20px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; margin-top: 9px; font-size: 26px; }
.panel { margin-top: 22px; padding: 22px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.panel-head h3, .panel-head p { margin: 0; }
.panel-head p { margin-top: 4px; }

.empty-state {
  color: var(--muted);
  border: 1px dashed #d6deea;
  border-radius: 14px;
  padding: 26px;
  text-align: center;
}
.result-row, .ticket-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.result-row {
  grid-template-columns: 1.15fr .9fr 1.25fr .75fr .8fr .75fr auto;
}

.result-row:last-child, .ticket-row:last-child { border-bottom: 0; }
.result-row strong, .ticket-row strong { color: var(--brand-dark); }
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
  background: var(--soft);
  color: var(--brand-dark);
}
.pill.success { background: #e8f7ef; color: var(--success); }
.pill.warning { background: #fff5da; color: var(--warning); }
.pill.danger { background: #fdeaea; color: var(--danger); }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font-weight: 700;
}
.secondary {
  border: 1px solid #ccd8e6;
  background: white;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin: 16px 0;
}
.detail-header h1 { margin: 0; font-size: 32px; }
.detail-header p { margin: 6px 0 0; color: var(--muted); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.detail-card { padding: 18px; }
.detail-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}
.detail-card strong { font-size: 17px; }

.two-col {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
  align-items: start;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

.form-grid { display: grid; gap: 12px; }
.ticket-row {
  grid-template-columns: .8fr .8fr .7fr 1.25fr .7fr 1fr 1fr auto;
}
.message {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
}
.message small { color: var(--muted); }
.document-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #172033;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  z-index: 100;
}

@media (max-width: 1000px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
  }
  #portalView { display: block; }
  .main { margin-left: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .nav-item.danger { margin: 0 0 0 auto; }
  .hero { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .result-row, .ticket-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .topbar, .page-view { padding-left: 18px; padding-right: 18px; }
  .topbar { align-items: flex-start; gap: 12px; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 32px; }
  .search-box { flex-direction: column; }
  .kpi-grid, .detail-grid { grid-template-columns: 1fr; }
  .result-row, .ticket-row { grid-template-columns: 1fr; }
}


.document-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.document-meta strong {
  overflow-wrap: anywhere;
}

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

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}


.full-secondary {
  width: 100%;
  margin-top: 0;
  padding: 12px 18px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 18px 0;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.wide-card {
  width: min(760px, 100%);
}

.two-form-cols {
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}

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

.form-message {
  margin-top: 10px;
  min-height: 20px;
  font-size: 14px;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(130px, .8fr) minmax(120px, .7fr) auto;
  gap: 12px;
  align-items: center;
}

.user-card small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.user-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2ff;
  color: #334d9c;
  font-size: 12px;
  font-weight: 750;
}

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

  .user-card {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .two-form-cols {
    grid-template-columns: 1fr;
  }

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

  .user-card {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }
}


.cs-ticket-row {
  display: grid;
  grid-template-columns: .75fr .75fr .7fr 1.2fr .7fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

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

.assignment-box {
  background: var(--soft);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}

.assignment-inline {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 1000px) {
  .cs-ticket-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .cs-ticket-row,
  .assignment-inline {
    grid-template-columns: 1fr;
  }
}


.ticket-search-bar {
  display: grid;
  grid-template-columns: 150px minmax(240px, 520px) auto auto;
  gap: 10px;
  align-items: center;
  margin: 4px 0 18px;
}

.ticket-search-bar select,
.ticket-search-bar input {
  margin: 0;
}

.ticket-search-bar .text-btn {
  justify-self: start;
}

.search-summary {
  color: var(--muted);
  font-size: 13px;
  margin: -6px 0 12px;
}

@media (max-width: 760px) {
  .ticket-search-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .ticket-search-bar {
    grid-template-columns: 1fr;
  }
}


.shipment-results {
  overflow-x: auto;
}

.result-header {
  padding-top: 10px;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
  border-radius: 10px 10px 0 0;
}

.result-header > div {
  white-space: nowrap;
}

@media (max-width: 1000px) {
  .shipment-results .result-row {
    min-width: 920px;
    grid-template-columns: 1.15fr .9fr 1.25fr .75fr .8fr .75fr auto;
  }
}


.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.lang-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
  color: var(--muted);
}

.lang-btn.active {
  background: var(--brand);
  color: white;
}

.login-language {
  display: flex;
  justify-content: flex-end;
  margin-top: -12px;
  margin-bottom: 18px;
}

html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .sidebar {
  inset: 0 0 0 auto;
}

html[dir="rtl"] .main {
  margin-left: 0;
  margin-right: 250px;
}

html[dir="rtl"] .nav-item {
  text-align: right;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] .panel-head,
html[dir="rtl"] .detail-header,
html[dir="rtl"] .document-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .result-row,
html[dir="rtl"] .ticket-row,
html[dir="rtl"] .cs-ticket-row,
html[dir="rtl"] table {
  direction: rtl;
}

html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: right;
}

html[dir="rtl"] .text-btn {
  direction: rtl;
}

html[dir="rtl"] .user-actions,
html[dir="rtl"] .document-actions {
  justify-content: flex-start;
}

@media (max-width: 1000px) {
  html[dir="rtl"] .sidebar {
    inset: auto;
  }

  html[dir="rtl"] .main {
    margin-right: 0;
  }
}


#ticketList,
#csTicketList {
  overflow-x: auto;
}

.ticket-list-header {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 10px 10px 0 0;
  padding-top: 11px;
  padding-bottom: 11px;
}

html[dir="rtl"] .ticket-list-header {
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 1000px) {
  .ticket-list-header {
    display: none !important;
  }
}




.cs-dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.cs-dashboard-head h1 {
  margin: 6px 0 4px;
  font-size: 32px;
}

.cs-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cs-recent-row {
  display: grid;
  grid-template-columns: .8fr .8fr .7fr 1.2fr .7fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

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

.cs-recent-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
  border-radius: 10px 10px 0 0;
  padding-top: 11px;
  padding-bottom: 11px;
}

html[dir="rtl"] .cs-recent-header {
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 1000px) {
  .cs-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #csDashboardRecentTickets {
    overflow-x: auto;
  }

  .cs-recent-row {
    min-width: 930px;
  }
}

@media (max-width: 620px) {
  .cs-dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cs-kpi-grid {
    grid-template-columns: 1fr;
  }
}


.password-panel {
  max-width: 620px;
}

.password-panel .form-grid {
  max-width: 520px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, .48);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: white;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

html[dir="rtl"] .modal-actions {
  justify-content: flex-start;
}


.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 4px;
  flex-wrap: wrap;
}

.email-verified {
  color: var(--success);
  font-weight: 750;
}

.email-unverified {
  color: #a16207;
  font-weight: 750;
}

.verification-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
}

@media (max-width: 520px) {
  .login-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}


.shipment-results .live-bl-result-row {
  grid-template-columns:
    1.05fr
    .85fr
    1.25fr
    .75fr
    .9fr
    .9fr
    .9fr
    auto;
}

@media (max-width: 1150px) {
  .shipment-results .live-bl-result-row {
    min-width: 1080px;
  }
}


.ticket-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 20px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: 4px;
  background: var(--brand);
  border: 3px solid #dbeafe;
  position: relative;
  z-index: 1;
}

.timeline-content {
  min-width: 0;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.timeline-top time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-detail {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

html[dir="rtl"] .timeline-item:not(:last-child)::before {
  left: auto;
  right: 6px;
}

@media (max-width: 720px) {
  .timeline-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .timeline-top time {
    white-space: normal;
  }
}


.upload-validation {
  min-height: 20px;
  margin-top: -4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.upload-validation.info {
  color: var(--muted);
}

.upload-validation.success {
  color: #166534;
}

.upload-validation.error {
  color: #b91c1c;
}

input[type="file"].upload-invalid {
  border-color: #b91c1c;
}


.account-confirm-card {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 14px;
  display: grid;
  gap: 5px;
}

.account-confirm-card.hidden {
  display: none;
}

.account-confirm-card strong {
  font-size: 18px;
  color: var(--text);
}

.account-confirm-card small {
  color: var(--muted);
  font-weight: 700;
}

.recovery-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.recovery-step-number {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #0a5ea8;
  color: white;
  font-weight: 800;
}

.recovery-step-body {
  min-width: 0;
}

.recovery-step-body h4 {
  margin: 4px 0 12px;
}

.disabled-step {
  opacity: .55;
}

.disabled-step input,
.disabled-step button {
  cursor: not-allowed;
}


.recovery-match-help {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}


/* v0.31: login has only Forgot Password as the secondary identity action. */
.login-actions:has(#showForgotPasswordBtn:only-child) {
  justify-content: flex-end;
}


/* v0.33: Xtreme line identity shown consistently in portal header. */
.portal-line-heading {
  margin-bottom: 4px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.25;
}

.brand-row #loginBrandHeading,
.brand-row #sidebarBrandHeading {
  overflow-wrap: anywhere;
}

.brand-row.compact #sidebarBrandHeading {
  line-height: 1.25;
}


/* v0.36 multi-line portal */
.line-switcher {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.line-switcher label {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.line-switcher select {
  min-width: 220px;
}

.line-switcher.single-line select {
  min-width: 180px;
}

.line-access-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.line-access-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-weight: 600;
}

.line-access-option input {
  width: auto;
  margin: 0;
}

@media (max-width: 780px) {
  .line-switcher,
  .line-switcher select {
    min-width: 150px;
    width: 100%;
  }
}


/* v0.39 - Admin Document Type Master */
.document-type-flags {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-weight: 600;
}

.check-option input {
  width: auto;
  margin: 0;
}

.document-type-form-actions,
.document-type-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-type-list {
  display: grid;
  gap: 10px;
}

.document-type-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.document-type-card.inactive-record {
  opacity: .72;
  background: #f8fafc;
}

.document-type-main {
  display: grid;
  gap: 4px;
}

.document-type-main small {
  color: var(--muted);
}

.document-type-title-row,
.document-type-flags-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

@media (max-width: 900px) {
  .document-type-card {
    grid-template-columns: 1fr;
  }
}


.module-access-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.module-access-option small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}


/* v1.55.1 - Login password visibility toggle */
.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap > input {
  width: 100%;
  padding-inline-end: 46px;
}

.password-eye-btn {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #1f2937);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

.password-eye-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.password-eye-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.password-eye-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.password-eye-icon.hidden {
  display: none;
}


/* v1.56 - Admin user profile edit */
#adminEditUserModal {
  overflow-y: auto;
}

#adminEditUserModal .modal-card {
  margin-block: 20px;
}

#adminEditUsername[readonly] {
  background: #f1f5f9;
  color: var(--muted);
  cursor: not-allowed;
}

.admin-create-customer-only.hidden,
#adminEditCrField.hidden,
#adminEditVatField.hidden {
  display: none;
}


/* v1.57 - CS Manager customer activation */
#csCustomerAccountsView .user-card {
  align-items: center;
}

#csCustomerAccountsView .user-actions {
  min-width: 130px;
}


/* v1.58 - Global loading / waiting indicator */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(1px);
}

.global-loading-overlay.hidden {
  display: none;
}

.global-loading-card {
  min-width: 160px;
  padding: 18px 24px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.global-loading-hourglass {
  font-size: 32px;
  line-height: 1;
  animation: xtreme-hourglass-turn 1.2s ease-in-out infinite;
}

.global-loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(15, 23, 42, 0.16);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: xtreme-loading-spin 0.8s linear infinite;
}

.global-loading-text {
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}

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

@keyframes xtreme-hourglass-turn {
  0%, 40% {
    transform: rotate(0deg);
  }

  60%, 100% {
    transform: rotate(180deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-loading-hourglass,
  .global-loading-spinner {
    animation: none;
  }
}


/* v1.59 - Force close without customer OTP */
.force-close-panel {
  border: 1px solid rgba(185, 28, 28, 0.22);
}

.danger-action {
  border-color: #b91c1c;
  color: #991b1b;
}

.danger-action:hover {
  background: rgba(185, 28, 28, 0.08);
}


/* v1.60 - Assigned CS Executive customer OTP closure */
#csCloseOtpBox { margin-top: 12px; }
#csCloseOtpBox > * + * { margin-top: 10px; }
#csCloseOtpInput { letter-spacing: 4px; font-weight: 700; }
