:root {
  --sidebar-bg: #35394b;
  --sidebar-fg: #c7ccd3;
  --sidebar-fg-active: #ffffff;
  --sidebar-accent: #1a7282;
  --stage-bg: #e9ebee;
  --device-bezel: #14161a;
  --screen-bg: #ffffff;
  --text: #1f2328;
  --text-muted: #6b7280;
  --border: #e2e4e8;
  --danger: #d9534f;
  --success: #2fa84f;
}

@font-face {
  font-family: "YSoft";
  src: url("../assets/fonts/YSoft-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* Used only by the SAFEQ Cloud Portal mock-up, to match the real product's
   body font (confirmed by inspecting the live portal). */
@font-face {
  font-family: "LabGrotesque";
  src: url("../assets/fonts/LabGrotesque-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "LabGrotesque";
  src: url("../assets/fonts/LabGrotesque-Medium.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}

.brand {
  font-family: "YSoft", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--sidebar-fg-active);
  padding: 0 8px 20px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: none;
  color: var(--sidebar-fg);
  font-size: 14px;
  text-align: left;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.nav-item[hidden] {
  display: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-fg-active);
}

.nav-item.active {
  background: rgba(26, 114, 130, 0.3);
  color: var(--sidebar-fg-active);
}

.nav-item-danger {
  margin-top: auto;
  color: #e08a87;
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.badge {
  background: var(--sidebar-accent);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
}

/* Stage + device frame */

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stage-bg);
  padding: 40px;
  overflow: auto;
}

.device {
  width: 100%;
  max-width: 760px;
}

.device-frame {
  position: relative;
  background: var(--device-bezel);
  border-radius: 28px;
  padding: 18px 18px 66px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.device-logo {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  height: 22px;
  width: auto;
}

/* On-screen keyboard: docks over the bottom of the screen, like a real
   touch-terminal would show when a text field is focused. */

.onscreen-keyboard {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 66px;
  background: #262a31;
  border-radius: 0 0 6px 6px;
  padding: 8px 6px 10px;
  box-sizing: border-box;
  z-index: 5;
}

.onscreen-keyboard[hidden] {
  display: none;
}

/* Small in-screen confirmation overlay (e.g. "delete this job?"), scoped to
   the device screen rather than the whole app like the persona modal. */

.confirm-overlay {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  bottom: 66px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.confirm-message {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  word-break: break-word;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

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

.kb-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.kb-row:last-child {
  margin-bottom: 0;
}

.kb-key {
  flex: 1;
  min-width: 0;
  background: #3d4048;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  padding: 9px 0;
  cursor: pointer;
}

.kb-key:hover {
  background: #4a4d56;
}

.kb-key-wide {
  flex: 1.6;
}

.kb-key-space {
  flex: 6;
}

.kb-key-enter {
  background: #1f8a70;
}

.kb-key-enter:hover {
  background: #23a082;
}

.screen {
  background: var(--screen-bg);
  border-radius: 6px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Applied to a screen's root wrapper when its footer needs to stay pinned
   to the bottom of the device (e.g. a scrollable list above it) rather
   than just following the content. */
.screen-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Screen header, shared across all screens */

.screen-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.screen-header > *:first-child {
  justify-self: start;
}

.screen-header > *:last-child {
  justify-self: end;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
}

.icon-btn:hover {
  color: var(--text);
}

.screen-header .header-logo {
  height: 28px;
  width: auto;
}

.screen-header h1 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.screen-header .persona-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.screen-header .persona-tag .persona-icon {
  display: flex;
  color: var(--sidebar-accent);
}

.screen-body {
  flex: 1;
  padding: 20px 18px;
  overflow: auto;
}

.screen-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.screen-footer-center {
  justify-content: center;
}

/* Home tiles */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tile {
  box-sizing: border-box;
  height: 152px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  font-size: 12px;
  color: var(--text);
  text-align: center;
}

.tile:hover {
  border-color: var(--sidebar-accent);
}

.tile-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tile-disabled:hover {
  border-color: var(--border);
}

.tile .tile-icon {
  color: var(--sidebar-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile .tile-icon-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.tile .tile-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.tile .tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--sidebar-accent);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
}

.tile .tile-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  color: #fff;
}

/* Success screen */

.success-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 20px;
}

.success-icon {
  color: var(--success);
}

.success-icon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* Login screen */

.auth-banner {
  background: #eaf6fc;
  color: var(--text);
  text-align: center;
  font-size: 13px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.auth-body {
  flex: 1;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 30px;
}

.auth-card {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
}

.auth-card img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.auth-card:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.auth-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 180px;
}

.auth-login-btn {
  align-self: center;
}

/* Form controls used inside workflow screens */

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.field-row label {
  font-size: 13px;
  color: var(--text);
}

/* Custom dropdown, styled to look embedded on the device rather than a
   native browser <select> (Job detail > Sides, My copies > Color mode/Sides) */

.dropdown-select {
  position: relative;
  min-width: 140px;
}

.dropdown-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.dropdown-select-toggle:hover,
.dropdown-select.open .dropdown-select-toggle {
  border-color: var(--sidebar-accent);
}

.dropdown-select-chevron {
  display: flex;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.dropdown-select.open .dropdown-select-chevron {
  transform: rotate(180deg);
}

.dropdown-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
  max-height: 190px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 5;
}

.dropdown-select-option {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 8px 10px;
  border: none;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.dropdown-select-option + .dropdown-select-option {
  border-top: 1px solid var(--border);
}

.dropdown-select-option:hover {
  background: #f3f4f6;
}

.dropdown-select-option.selected {
  background: var(--sidebar-accent);
  color: #fff;
}

/* My print jobs */

.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.job-bubble {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.job-bubble:hover {
  border-color: var(--sidebar-accent);
}

.job-bubble.selected {
  border-color: var(--sidebar-accent);
  background: var(--sidebar-accent);
  color: #fff;
}

.job-row .job-name {
  flex: 1;
  font-size: 13px;
}

.job-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.job-icon-btn:hover {
  background: #f3f4f6;
  color: var(--text);
}

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin-top: 40px;
}

.empty-folder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-folder-state img {
  width: 64px;
  height: 64px;
  margin-top: 40px;
}

.empty-folder-state .empty-state {
  margin-top: 12px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

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

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.stepper span {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
}

.stepper-input {
  width: 44px;
  text-align: center;
  font-size: 13px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

/* Segmented control, e.g. Color / Black and white on Job detail */

.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.segmented-btn {
  flex: 1;
  padding: 8px 14px;
  border: none;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.segmented-btn + .segmented-btn {
  border-left: 1px solid var(--border);
}

.segmented-btn.active {
  background: var(--sidebar-bg);
  color: #fff;
}

/* Form fields: Destination + filename on "Scan to OneDrive Advanced" */

.form-field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.form-field-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-field-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-field-caption {
  font-size: 11px;
  color: var(--text-muted);
}

.form-field-input {
  flex: 1;
  width: 100%;
  max-width: 260px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  box-sizing: border-box;
}

.form-field-value {
  flex: 1;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field-input:disabled {
  background: #f9fafb;
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-field-input.input-error {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
}

.field-error[hidden] {
  display: none;
}

.destination-input {
  display: flex;
  flex: 1;
  max-width: 260px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.destination-input input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.destination-input input:focus {
  outline: none;
}

.destination-input input[readonly] {
  background: #f9fafb;
  color: var(--text-muted);
}

.destination-browse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--text-muted);
  cursor: pointer;
}

.destination-browse-btn:hover {
  color: var(--sidebar-accent);
}

/* Folder browser (fake OneDrive picker) */

.folder-nav-group {
  display: flex;
  gap: 6px;
}

.folder-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.folder-nav-btn:hover {
  border-color: var(--sidebar-accent);
  color: var(--sidebar-accent);
}

.folder-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.folder-nav-btn:disabled:hover {
  border-color: var(--border);
  color: var(--text);
}

.folder-list {
  display: flex;
  flex-direction: column;
}

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.folder-row:last-child {
  border-bottom: none;
}

.folder-row:hover {
  color: var(--sidebar-accent);
}

.folder-row-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

/* Buttons */

.btn {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--sidebar-accent);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

/* Persona modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.persona-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.instructions-modal {
  width: 480px;
  max-width: calc(100vw - 40px);
}

.instructions-body {
  max-height: 60vh;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}

.instructions-body h3 {
  font-size: 14px;
  margin: 16px 0 4px;
}

.instructions-body h3:first-child {
  margin-top: 0;
}

.instructions-body p {
  margin: 0 0 8px;
}

.instructions-body ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

.instructions-body li {
  margin-bottom: 4px;
}

.persona-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}

.persona-option:hover {
  border-color: var(--sidebar-accent);
}

.persona-option.selected {
  border-color: var(--sidebar-accent);
  background: rgba(26, 114, 130, 0.08);
}

.persona-option .persona-icon {
  display: flex;
  color: var(--sidebar-accent);
}

.language-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}

.language-option:hover {
  border-color: var(--sidebar-accent);
}

.language-option.selected {
  border-color: var(--sidebar-accent);
  background: rgba(26, 114, 130, 0.08);
}

.language-flag {
  display: flex;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

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

/* Your ERP: a separate mock application, only reachable by the Advanced
   Workflows persona. Takes over the full page rather than the device
   screen — it's meant to look like a different piece of software. */

.erp-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  background: #fff;
}

.erp-view[hidden] {
  display: none;
}

.erp-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 20px;
}

.erp-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--sidebar-fg);
  font-size: 12px;
  text-align: left;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.erp-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-fg-active);
}

.erp-brand {
  font-family: "YSoft", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--sidebar-fg-active);
  padding: 0 8px;
}

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

.erp-nav-item {
  background: none;
  border: none;
  color: var(--sidebar-fg);
  font-size: 14px;
  text-align: left;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.erp-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-fg-active);
}

.erp-nav-item.active {
  background: rgba(26, 114, 130, 0.3);
  color: var(--sidebar-fg-active);
}

.erp-main {
  flex: 1;
  overflow: auto;
  padding: 28px 36px;
}

.erp-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.erp-page-header h1,
.erp-page-header h2 {
  margin: 0;
  font-size: 20px;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.erp-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

.erp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.erp-table-row {
  cursor: pointer;
}

.erp-table-row:hover td {
  background: #f9fafb;
}

.erp-status {
  display: inline-block;
  background: rgba(47, 168, 79, 0.12);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.erp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  gap: 18px;
  max-width: 700px;
  margin-bottom: 28px;
}

.erp-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.erp-detail-label {
  font-size: 12px;
  color: var(--text-muted);
}

.erp-section-title {
  font-size: 15px;
  margin: 0 0 12px;
}

.erp-table-action {
  text-align: right;
}

/* Shared generic document preview modal — used by ERP receipts, email
   attachments and OneDrive files alike. */

.pdf-preview-modal {
  align-items: center;
}

.pdf-preview-image {
  align-self: center;
  width: 160px;
}

.pdf-preview-image svg {
  width: 100%;
  height: auto;
}

/* My E-Mail */

.email-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 700px;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: none;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.email-row:hover {
  background: #f9fafb;
}

.email-row-from {
  width: 180px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.email-row-subject {
  flex: 1;
}

.email-row-date {
  flex-shrink: 0;
  color: var(--text-muted);
}

.email-body {
  font-size: 14px;
  line-height: 1.5;
  max-width: 700px;
  margin: 0 0 24px;
}

.email-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.email-attachment:hover {
  border-color: var(--sidebar-accent);
}

.email-attachment-icon {
  display: flex;
  color: var(--sidebar-accent);
}

/* Branded notification email (e.g. the "trip report not found" error),
   modeled on a real SAFEQ Cloud system email rather than this app's own
   look. */

.email-brand-header {
  max-width: 700px;
  background: #ee7203;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding: 16px 20px;
  border-radius: 6px 6px 0 0;
}

.email-brand-body {
  max-width: 700px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.email-brand-body p {
  margin: 0 0 14px;
}

.email-brand-body p:last-child {
  margin-bottom: 0;
}

.email-steps-box {
  background: #eaf4f6;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 14px;
}

.email-steps-heading {
  font-weight: 700;
  margin: 0 0 8px !important;
}

.email-steps-box ul {
  margin: 0;
  padding-left: 20px;
}

.email-steps-box li {
  margin-bottom: 6px;
  word-break: break-word;
}

.email-steps-box li:last-child {
  margin-bottom: 0;
}

.email-link {
  color: var(--sidebar-accent);
  text-decoration: underline;
  cursor: pointer;
}

/* My OneDrive */

.onedrive-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 700px;
}

.onedrive-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: none;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.onedrive-row:hover {
  background: #f9fafb;
}

.onedrive-row-icon {
  display: flex;
  color: var(--sidebar-accent);
}

.onedrive-row-name {
  flex: 1;
}

.onedrive-row-meta {
  color: var(--text-muted);
}

/* SAFEQ Cloud Portal — a mock-up of the real customer-facing portal's "My
   documents > Scans" tab, styled with the real product's own fonts
   (LabGrotesque for body text, YSoft for the big page title) rather than
   the rest of this simulator's look. */

.portal-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #f5f6f7;
  font-family: "LabGrotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #36383b;
}

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

.portal-view button,
.portal-view input {
  font-family: inherit;
}

.portal-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
}

.portal-logo {
  height: 32px;
  width: auto;
}

.portal-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  line-height: 1.4;
}

.portal-user-name {
  font-weight: 600;
  color: var(--sidebar-accent);
}

.portal-user-org {
  color: var(--text-muted);
}

.portal-layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.portal-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.portal-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--sidebar-fg);
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  padding: 10px 16px;
  margin: 0 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.portal-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-fg-active);
}

.portal-nav {
  display: flex;
  flex-direction: column;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--sidebar-fg);
  font-size: 16px;
}

.portal-nav-item-active {
  background: #0b0c0f;
  color: #fff;
}

.portal-nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.85;
}

.portal-main {
  flex: 1;
  padding: 24px 32px 60px;
  max-width: 1000px;
}

.portal-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin: 16px 0 4px;
}

.portal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.portal-title {
  font-family: "YSoft", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 32px;
  text-transform: uppercase;
  color: #000;
  margin: 0;
}

.portal-refresh-btn {
  text-transform: uppercase;
  font-size: 12px;
  border-color: var(--sidebar-accent);
  color: var(--sidebar-accent);
  background: #fff;
}

.portal-refresh-btn:hover {
  background: rgba(26, 114, 130, 0.06);
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.portal-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
}

.portal-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.portal-table-row:hover td {
  background: #f9fafb;
}

.portal-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.portal-status-pending {
  background: rgba(240, 173, 78, 0.18);
  color: #b8791a;
}

.portal-status-completed {
  background: rgba(47, 168, 79, 0.12);
  color: var(--success);
}

.portal-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  background: none;
  border: none;
  color: var(--sidebar-accent);
  cursor: pointer;
  padding: 2px;
  vertical-align: middle;
}

.portal-edit-btn:hover {
  color: var(--text);
}

.portal-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  background: #fff;
  border-radius: 8px;
}

.portal-empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 12px;
}

/* Version tag — bottom-right corner, so a deploy can be visually confirmed */

.version-tag {
  position: fixed;
  right: 10px;
  bottom: 8px;
  z-index: 9999;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  pointer-events: none;
}

/* Debug-only: shows the detected IP/region so region routing can be
   verified while testing (e.g. over a VPN). Remove before a real deploy. */
.region-debug-tag {
  bottom: 24px;
}
