/* Label Factory: top bar, sign-in pages and account page. Uses the tokens from style.css. */

.lf-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.3px; color: var(--ink); text-decoration: none; }
.lf-brand img { display: block; border-radius: 8px; }
.lf-brand span { font-size: 20px; }
.lf-brand-small span { font-size: 16px; }
.lf-brand-bar span { font-size: 15px; }

/* top bar (main app and account page) */
.lf-topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.lf-topbar:empty { display: none; }
.lf-topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lf-org-select { max-width: 220px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.lf-user-menu { position: relative; }
.lf-user-menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.lf-user-menu summary::-webkit-details-marker { display: none; }
.lf-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--accent); font-weight: 650; font-size: 12px; }
.lf-user-panel { position: absolute; right: 0; top: 40px; z-index: 10001; width: 240px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); box-shadow: 0 10px 36px #0003; display: grid; gap: 4px; }
.lf-user-name { font-weight: 600; overflow-wrap: anywhere; }
.lf-user-email { overflow-wrap: anywhere; margin-bottom: 4px; }
.lf-menu-item { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; text-decoration: none; }
.lf-menu-item:hover { background: var(--subtle); }

/* sign-in pages */
.lf-auth-body { min-height: 100dvh; }
.lf-auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lf-auth-brand { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 48px max(32px, 8vw); background: linear-gradient(150deg, #9a72ff, #6a3de8); color: #fff; }
.lf-auth-brand .lf-brand { color: #fff; }
.lf-auth-brand .lf-brand span { font-size: 26px; }
.lf-auth-tagline { font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25; font-weight: 600; letter-spacing: -.6px; max-width: 460px; }
.lf-auth-points { display: grid; gap: 10px; font-size: 14px; opacity: .92; }
.lf-auth-points li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: #d2f76f; }
.lf-auth-card { display: flex; flex-direction: column; justify-content: center; padding: 48px max(24px, 6vw); background: var(--bg); }
.lf-auth-card > .lf-brand { display: none; margin-bottom: 28px; }
.lf-form { display: grid; gap: 14px; width: 100%; max-width: 380px; }
.lf-form h1 { font-size: 26px; font-weight: 650; letter-spacing: -.6px; margin-bottom: 4px; }
.lf-form button[type="submit"] { justify-self: start; padding: 10px 18px; }
.lf-lead { color: var(--muted); font-size: 14px; line-height: 1.6; }
.lf-links { color: var(--muted); }
.lf-links a, .lf-lead a { color: var(--accent); }
.lf-error { padding: 9px 12px; border-left: 3px solid light-dark(#b24b4b, #ee8383); border-radius: 8px; background: light-dark(#faecec, #3a252b); }
label { display: grid; gap: 5px; font-weight: 550; }
label small { font-weight: 400; color: var(--muted); }
.lf-form input, .lf-account input, .lf-account select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-weight: 400; }
.lf-form input:focus, .lf-account input:focus { border-color: var(--accent); }

@media (max-width: 760px) {
  .lf-auth { grid-template-columns: 1fr; }
  .lf-auth-brand { display: none; }
  .lf-auth-card > .lf-brand { display: inline-flex; }
}

/* account page */
.lf-page { min-height: 100dvh; display: flex; flex-direction: column; }
.lf-account { width: 100%; max-width: 860px; margin: 0 auto; padding: 28px 16px 64px; display: grid; gap: 18px; }
.lf-panel { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); display: grid; gap: 16px; }
.lf-panel header { display: grid; gap: 4px; }
.lf-panel h2 { font-size: 17px; font-weight: 650; }
.lf-panel h3 { font-size: 13px; font-weight: 650; margin: 6px 0 2px; }
.lf-inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.lf-inline label { flex: 1 1 200px; }
.lf-stack { display: grid; gap: 12px; max-width: 420px; }
.lf-table { width: 100%; border-collapse: collapse; }
.lf-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.lf-table td { padding: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.lf-table select { width: auto; padding: 5px 8px; }
.lf-link-button { border: 0; background: none; padding: 0; color: var(--accent); }
.lf-link-button:hover { text-decoration: underline; }
.lf-roles-help { font-size: 12px; }
.lf-more summary { cursor: pointer; color: var(--accent); margin-bottom: 10px; }
.lf-banner { padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 11px; background: var(--tint); }

@media (max-width: 600px) {
  .lf-table thead { display: none; }
  .lf-table tr { display: grid; grid-template-columns: 1fr auto; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .lf-table td { border: 0; padding: 3px 4px; }
}

/* printers page */
.lf-page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lf-page-head h1 { font-size: 26px; font-weight: 650; letter-spacing: -.6px; margin-bottom: 4px; }
.lf-agents { display: grid; gap: 14px; }
.lf-agent { padding: 16px; border: 1px solid var(--line); border-radius: 11px; display: grid; gap: 12px; background: var(--bg); }
.lf-agent-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.lf-agent-head h3 { font-size: 15px; font-weight: 650; margin: 0 0 2px; }
.lf-agent-actions { display: flex; gap: 14px; }
.lf-danger { color: light-dark(#b24b4b, #ee8383); }
.lf-dot { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.lf-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.lf-dot.on { color: var(--ink); }
.lf-dot.on::before { background: #3fb36b; box-shadow: 0 0 0 3px color-mix(in srgb, #3fb36b 25%, transparent); }
.lf-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--tint); color: var(--accent); font-size: 11px; }
.lf-cell-actions { text-align: right; white-space: nowrap; }
.lf-cell-actions .lc-action { padding: 5px 10px; }
.lf-status { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--subtle); font-size: 12px; }
.lf-status.done { background: color-mix(in srgb, #3fb36b 18%, transparent); }
.lf-status.failed { background: light-dark(#faecec, #3a252b); color: light-dark(#b24b4b, #ee8383); }
.lf-status.printing, .lf-status.sent { background: var(--tint); color: var(--accent); }
.lf-job-error { font-size: 12px; margin-top: 2px; }
.lf-steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; list-style: decimal; }
.lf-steps li { line-height: 1.6; }
.lf-steps .lc-action { margin-right: 8px; }
.lf-code { margin: 8px 0 2px; font: 600 30px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 4px; color: var(--accent); }
.lf-steps code { padding: 1px 6px; border-radius: 6px; background: var(--subtle); }
.lf-waiting { color: var(--muted); }
.lf-waiting::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); animation: lf-pulse 1.2s infinite; }
.lf-waiting.ok { color: var(--ink); }
.lf-waiting.ok::before { background: #3fb36b; animation: none; }
@keyframes lf-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .lf-waiting::before { animation: none; } }

/* print dialog (main app) */
.lf-print { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px #0005; }
.lf-print::backdrop { background: #0007; }
.lf-print-body { display: grid; gap: 14px; padding: 20px; }
.lf-print-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lf-print-head h2 { font-size: 18px; font-weight: 650; }
.lf-print-preview { display: grid; place-items: center; min-height: 160px; max-height: 46dvh; padding: 14px; border-radius: 10px; background: var(--stage); overflow: auto; }
.lf-print-preview img { max-width: 100%; max-height: calc(46dvh - 28px); background: #fff; box-shadow: 0 2px 10px #0003; image-rendering: auto; }
.lf-print-preview img:not([src]) { display: none; }
.lf-print-fields { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.lf-print-fields select, .lf-print-fields input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-weight: 400; }
.lf-print-info { font-size: 12px; }
.lf-print-actions { display: flex; align-items: center; gap: 10px; }
.lf-spacer { flex: 1; }
@media (max-width: 560px) { .lf-print-fields { grid-template-columns: 1fr; } }
/* print language per printer (printers page) */
.lf-lang { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
