:root {
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-light: #e8f0fe;
  --success: #1e8e3e;
  --success-light: #e6f4ea;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --warning: #f29900;
  --warning-light: #fef7e0;
  --dark: #202124;
  --gray-900: #1f1f1f;
  --gray-800: #3c4043;
  --gray-700: #5f6368;
  --gray-600: #80868b;
  --gray-300: #dadce0;
  --gray-200: #e8eaed;
  --gray-100: #f1f3f4;
  --gray-50: #f8f9fa;
  --viewer-bg: #323639;
  --white: #ffffff;
  --sidebar-width: 350px;
  --topbar-height: 56px;
  --shadow-sheet: 0 10px 30px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.print-dialog-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--viewer-bg);
  color: var(--dark);
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- TOPBAR --- */
.app-topbar {
  height: var(--topbar-height);
  background: var(--dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  flex-shrink: 0;
  gap: 0.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.app-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.app-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-name {
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tag {
  font-size: 0.68rem;
  color: #9aa0a6;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: #34a853;
  box-shadow: 0 0 8px rgba(52, 168, 83, 0.6);
}

.status-dot.offline {
  background: #ea4335;
  box-shadow: 0 0 8px rgba(234, 67, 53, 0.6);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(26, 115, 232, 0.2);
  border: 1px solid rgba(26, 115, 232, 0.4);
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  border-radius: 9999px;
  cursor: pointer;
  color: var(--white);
  max-width: 140px;
}

.user-chip:hover {
  background: rgba(26, 115, 232, 0.35);
}

.user-chip-avatar {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip i {
  font-size: 0.6rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.btn-toggle-queue {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--white);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-toggle-queue:hover {
  background: rgba(255, 255, 255, 0.18);
}

.queue-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- MAIN CONTAINER --- */
.print-dialog-container {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--topbar-height));
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Upload Overlay */
.upload-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(40, 44, 52, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 1rem;
  transition: var(--transition);
}

.upload-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.upload-box {
  background: var(--white);
  border: 2.5px dashed var(--primary);
  border-radius: 16px;
  padding: 2.5rem 1.75rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.upload-box input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.upload-box-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.upload-box h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.35rem;
}

.upload-box p {
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 1.25rem;
}

.btn-browse {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

/* --- VIEWPORT DE PRÉ-VISUALIZAÇÃO (ESQUERDA) --- */
.preview-viewport {
  flex: 1;
  background-color: var(--viewer-bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  position: relative;
  overflow: auto; /* Permite scroll total */
  padding: 25px 20px 85px 20px;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.preview-stage {
  display: inline-block;
  margin: 0 auto;
  transform-origin: top center; /* Garante que o topo NUNCA seja cortado ao dar zoom */
  transition: transform 0.2s ease-out;
}

/* FOLHA DE PAPEL A4 */
.paper-sheet {
  background: var(--white);
  box-shadow: var(--shadow-sheet);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  transition: width 0.25s ease, height 0.25s ease, padding 0.2s ease;
  display: flex;
  flex-direction: column;
}

.paper-sheet.portrait {
  width: 440px;
  height: 622px; /* 440 * 1.4142 */
}

.paper-sheet.landscape {
  width: 622px;
  height: 440px;
}

/* Margens */
.paper-sheet.margin-default { padding: 24px; }
.paper-sheet.margin-minimum { padding: 10px; }
.paper-sheet.margin-none { padding: 0; }

.paper-sheet.monochrome-filter {
  filter: grayscale(100%) contrast(1.08);
}

.sheet-content-layer {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sheet-content-layer canvas, .sheet-content-layer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.text-doc-view {
  width: 100%;
  height: 100%;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #111;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  text-align: left;
}

.sheet-loading-spinner {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
}

.sheet-loading-spinner.hidden { display: none; }
.sheet-loading-spinner i { font-size: 1.6rem; color: var(--primary); }

/* Folha de Rosto / Capa */
.sheet-cover-layer {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--gray-200);
  text-align: left;
}

.cover-header { text-align: center; }
.cover-pill { display: inline-block; font-size: 0.65rem; font-weight: 800; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 9999px; margin-bottom: 4px; letter-spacing: 0.05em; }
.cover-header h2 { font-size: 0.95rem; font-weight: 800; color: var(--dark); }
.cover-divider { width: 100%; height: 2px; background: var(--primary); margin-top: 8px; }

.cover-user-box { background: var(--gray-50); border: 2px solid var(--dark); border-radius: 6px; padding: 12px 10px; text-align: center; margin: 10px 0; }
.cover-box-label { display: block; font-size: 0.62rem; font-weight: 800; color: var(--primary); letter-spacing: 0.05em; }
.cover-box-sub { display: block; font-size: 0.72rem; color: var(--gray-600); margin-top: 2px; }
.cover-user-title { font-size: 1.7rem; font-weight: 900; color: var(--dark); margin-top: 2px; line-height: 1.1; }

.cover-info-table { background: var(--white); border: 1px solid var(--gray-300); border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; font-size: 0.72rem; }
.cover-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-100); padding-bottom: 3px; }
.cover-row:last-child { border-bottom: none; padding-bottom: 0; }
.cover-key { font-weight: 700; color: var(--gray-700); }
.cover-val { font-weight: 600; color: var(--dark); max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-footer-note { font-size: 0.65rem; color: var(--gray-600); text-align: center; border-top: 1px dashed var(--gray-300); padding-top: 6px; }

/* Barra Flutuante de Controles Inferiores (Desktop) */
.preview-controls-bar {
  position: fixed;
  bottom: 1.25rem;
  left: calc((100vw - var(--sidebar-width)) / 2);
  transform: translateX(-50%);
  background: rgba(32, 33, 36, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 30;
  color: var(--white);
}

.btn-ctrl-nav {
  background: transparent;
  border: none;
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
}

.btn-ctrl-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.btn-ctrl-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.3rem;
  min-width: 80px;
  text-align: center;
}

.ctrl-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
}

.btn-ctrl-mode {
  background: rgba(26, 115, 232, 0.35);
  border: 1px solid rgba(26, 115, 232, 0.5);
  color: var(--white);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.btn-ctrl-mode:hover {
  background: var(--primary);
}

.zoom-text {
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 38px;
  text-align: center;
}

/* --- BARRA LATERAL DE CONFIGURAÇÕES (DIREITA) --- */
.print-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: var(--white);
  border-left: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 20;
  overflow-x: hidden; /* ELIMINA SCROLL HORIZONTAL */
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  padding: 1rem 1.25rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.file-badge-name {
  display: block;
  font-size: 0.74rem;
  color: var(--gray-600);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sidebar-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem;
  gap: 0.95rem;
  width: 100%;
}

/* Setting Rows com min-width seguro */
.setting-row {
  display: grid;
  grid-template-columns: 75px 1fr;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.setting-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-700);
  white-space: nowrap;
}

.setting-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

/* Printer Box Compacta */
.printer-select-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.printer-icon {
  width: 26px;
  height: 26px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.printer-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.printer-info strong {
  font-size: 0.76rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.printer-sub {
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs & Selects */
.styled-select, .styled-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  background-color: var(--white);
  transition: var(--transition);
  min-width: 0;
}

.styled-select:focus, .styled-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2.5px rgba(26, 115, 232, 0.15);
}

/* Stepper */
.stepper-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
  width: 110px;
}

.step-btn {
  background: var(--gray-100);
  border: none;
  width: 32px;
  height: 30px;
  cursor: pointer;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.step-btn:hover { background: var(--gray-200); color: var(--primary); }

.stepper-box input {
  width: 100%;
  border: none;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  -moz-appearance: textfield;
}

.stepper-box input::-webkit-outer-spin-button,
.stepper-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Cover Toggle Card */
.cover-toggle-card {
  background: linear-gradient(135deg, #f0f7ff, #ffffff);
  border: 1.5px solid var(--primary-light);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.cover-toggle-text {
  min-width: 0;
  flex: 1;
}

.cover-toggle-text strong {
  display: block;
  font-size: 0.78rem;
  color: var(--dark);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-toggle-text p {
  font-size: 0.68rem;
  color: var(--gray-700);
  line-height: 1.25;
}

.user-highlight {
  font-weight: 800;
  color: var(--primary);
  text-decoration: underline;
}

/* Switch */
.switch-ui {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch-ui input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--gray-300);
  transition: .25s;
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

input:checked + .switch-slider { background-color: var(--primary); }
input:checked + .switch-slider:before { transform: translateX(18px); }

/* Accordion */
.accordion-item {
  border-top: 1px solid var(--gray-200);
  padding-top: 0.65rem;
}

.accordion-toggle {
  background: transparent;
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  padding: 0.35rem 0;
}

.accordion-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.setting-row-sub {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.setting-row-sub label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-700);
}

.styled-select-sm, .styled-input-sm {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--dark);
}

/* Sidebar Actions */
.sidebar-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-action-print {
  width: 100%;
  padding: 0.8rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
  transition: var(--transition);
}

.btn-action-print:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-action-change {
  width: 100%;
  padding: 0.6rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-action-change:hover {
  background: var(--gray-200);
  color: var(--dark);
}

/* --- GAVETA DA FILA (DRAWER) --- */
.queue-drawer-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 60;
}

.queue-drawer {
  position: fixed;
  top: 0; right: 0; width: 380px; max-width: 100vw; height: 100vh;
  background: var(--white);
  z-index: 70;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.25s ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark);
}

.drawer-title i { color: var(--primary); }
.drawer-title h3 { font-size: 1rem; font-weight: 800; }

.btn-close-drawer {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--gray-600);
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem;
}

.drawer-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.empty-drawer {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--gray-500);
}

.empty-drawer i { font-size: 2.5rem; color: var(--gray-300); margin-bottom: 0.65rem; }

/* Modais e Toasts */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-card {
  background: var(--white);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1rem; font-weight: 800; }
.btn-close-modal { background: transparent; border: none; font-size: 1.1rem; cursor: pointer; color: var(--gray-600); }

.modal-body { padding: 1.25rem; }
.modal-desc { font-size: 0.82rem; color: var(--gray-700); margin-bottom: 0.85rem; }
.modal-input { width: 100%; padding: 0.65rem 0.85rem; border-radius: 6px; border: 1px solid var(--gray-300); font-size: 0.95rem; font-weight: 700; }

.quick-users-section { margin-top: 0.85rem; }
.quick-users-label { font-size: 0.72rem; font-weight: 700; color: var(--gray-600); display: block; margin-bottom: 0.4rem; text-transform: uppercase; }
.quick-users-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.quick-user-chip { background: var(--gray-100); border: 1px solid var(--gray-300); padding: 0.3rem 0.65rem; border-radius: 9999px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.quick-user-chip:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.modal-footer { padding: 0.85rem 1.25rem; background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.btn-save-user { width: 100%; padding: 0.75rem; background: var(--primary); color: white; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; }

/* Toast */
.toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; display: flex; flex-direction: column; gap: 0.45rem; z-index: 120; }
.toast { background: var(--dark); color: white; padding: 0.75rem 1.1rem; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,0.3); font-size: 0.82rem; font-weight: 600; animation: toast-in 0.25s ease-out; display: flex; align-items: center; gap: 0.5rem; }
.toast.success { border-left: 4px solid #34a853; }
.toast.error { border-left: 4px solid #ea4335; }
.toast.info { border-left: 4px solid #1a73e8; }
@keyframes toast-in { from { transform: translateY(15px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.hidden { display: none !important; }

/* --- RESPONSIVIDADE PARA CELULAR (IPHONE / ANDROID) --- */
@media (max-width: 850px) {
  .app-topbar {
    padding: 0 0.65rem;
  }
  .app-tag {
    display: none; /* Remove subtítulo longo no celular */
  }
  .status-indicator {
    padding: 0.25rem 0.45rem;
  }
  .status-indicator .status-text {
    display: none; /* Mostra apenas o ponto colorido no celular para não espremer */
  }
  .user-chip {
    max-width: 105px;
    padding: 0.2rem 0.45rem 0.2rem 0.25rem;
  }

  .print-dialog-container {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }

  .preview-viewport {
    height: 420px;
    min-height: 420px;
    padding: 15px 10px 15px 10px;
    overflow-y: auto;
  }

  .paper-sheet.portrait {
    width: 260px;
    height: 367px;
  }
  .paper-sheet.landscape {
    width: 367px;
    height: 260px;
  }

  /* BARRA DE CONTROLES NO CELULAR (NÃO FICA FIXA EMBAIXO DA TELA!) */
  .preview-controls-bar {
    position: static; /* Fica logo abaixo da folha A4 e rola com ela */
    transform: none;
    margin: 14px auto 8px auto;
    padding: 0.35rem 0.65rem;
    gap: 0.35rem;
    max-width: 320px;
  }

  .print-sidebar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--gray-300);
    box-shadow: none;
  }

  .sidebar-form {
    padding-bottom: 2rem;
  }
}
