/* PrintSync dashboard — scoped under .psd-root */
@font-face { font-family: "PS Inter"; src: url("../fonts/inter-latin-var.woff2") format("woff2-variations"), url("../fonts/inter-latin-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

.psd-root, .psd-toast, .psd-dialog {
  --d-ink: #011631; --d-navy: #021f45; --d-blue: #027a79; --d-blue-2: #35b5b1; --d-on-blue: #fff; --d-link: #027a79; --d-text: #0b1a30; --d-muted: #5b6475; --d-line: #e2e8ee; --d-soft: #f5f8fa; --d-ok: #15803d; --d-err: #b91c1c;
  font-family: "PS Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--d-text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.psd-root *, .psd-root *::before, .psd-root *::after, .psd-dialog * { box-sizing: border-box; }
.psd-root h1, .psd-root h2, .psd-root p, .psd-root ul, .psd-root ol, .psd-dialog h2, .psd-dialog p { margin: 0; padding: 0; }
/* Wide app layout even inside a narrow theme/Divi column (positioning, not margins, so themes can't undo it). */
.psd-root { width: min(1240px, calc(100vw - 32px)); max-width: none !important; position: relative; left: 50%; transform: translateX(-50%); min-height: 70vh; margin-left: 0; margin-right: 0; }
.psd-root a { color: var(--d-link); }
.psd-root [hidden] { display: none !important; }
.psd-ico { width: 18px; height: 18px; flex: none; }
.psd-loading { padding: 80px 20px; text-align: center; color: var(--d-muted); }

/* Cards & text */
.psd-card { background: #fff; border: 1px solid var(--d-line); border-radius: 16px; padding: 24px; box-shadow: 0 1px 2px rgba(2, 31, 69, .04), 0 10px 30px -14px rgba(2, 31, 69, .18); }
.psd-card + .psd-card { margin-top: 16px; }
.psd-h1 { font-size: 1.7rem; font-weight: 740; letter-spacing: -.025em; line-height: 1.2; color: var(--d-text); }
.psd-h2 { font-size: 1.12rem; font-weight: 690; letter-spacing: -.01em; margin-bottom: 6px !important; color: var(--d-text); }
.psd-sub { color: var(--d-muted); }
.psd-muted { color: var(--d-muted); font-size: 14px; }
.psd-fine { color: var(--d-muted); font-size: 13px; margin-top: 16px !important; text-align: center; }
.psd-notice { color: var(--d-text); }
.psd-callout { background: #ebf6f5; border: 1px solid #cde8e6; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14.5px; }
.psd-msg { min-height: 1.4em; font-size: 14px; margin-top: 10px !important; }
.psd-ok { color: var(--d-ok); }
.psd-err { color: var(--d-err); }

/* Forms & buttons */
.psd-root label, .psd-dialog label { font-weight: 600; font-size: 14px; color: var(--d-text); }
.psd-root input:not([type=checkbox]):not([type=file]):not([type=color]), .psd-root select { width: 100%; font: inherit; font-size: 15px; padding: 11px 13px; border: 1px solid #d5dbe7; border-radius: 10px; background: #fff; color: var(--d-text); transition: border-color .15s, box-shadow .15s; }
.psd-root input:focus, .psd-root select:focus { outline: none; border-color: var(--d-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--d-blue) 18%, transparent); }
.psd-form { display: grid; gap: 8px; margin-top: 18px; }
.psd-form .psd-btn { margin-top: 10px; }
.psd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid #d5dbe7; background: #fff; color: var(--d-text); font: inherit; font-weight: 620; font-size: 14.5px; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .1s; }
.psd-btn:hover { border-color: #b9c3d6; }
.psd-btn:active { transform: translateY(1px); }
.psd-btn:disabled { opacity: .55; cursor: default; }
.psd-btn.is-busy { position: relative; color: transparent !important; }
.psd-btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--d-muted) transparent var(--d-muted) transparent; border-radius: 50%; animation: psd-spin .8s linear infinite; }
.psd-primary.is-busy::after { border-color: var(--d-on-blue) transparent var(--d-on-blue) transparent; }
@keyframes psd-spin { to { transform: rotate(360deg); } }
.psd-primary { background: var(--d-blue); border-color: var(--d-blue); color: var(--d-on-blue) !important; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--d-blue) 70%, transparent); }
.psd-primary:hover { filter: brightness(.93); }
.psd-danger { color: var(--d-err); }
.psd-small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.psd-block { width: 100%; }
.psd-google { margin-top: 18px; }
.psd-link { background: none; border: 0; color: var(--d-link); font: inherit; font-size: 14px; font-weight: 560; cursor: pointer; padding: 0; }
.psd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.psd-inline { display: flex; gap: 10px; margin-top: 14px; }
.psd-inline input { max-width: 260px; }
.psd-grid2 { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px 18px; align-items: center; margin-top: 14px; }

/* Auth */
.psd-auth { display: grid; place-items: center; padding: clamp(24px, 6vw, 72px) 16px; background: radial-gradient(600px 300px at 80% 0%, color-mix(in srgb, var(--d-blue) 13%, transparent), transparent 70%); }
.psd-auth-card { width: min(440px, 100%); padding: 34px; }
.psd-brand { display: flex; align-items: center; gap: 10px; font-weight: 760; font-size: 18px; letter-spacing: -.02em; margin-bottom: 22px; color: var(--d-text); }
.psd-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--d-blue); color: var(--d-on-blue); }
.psd-auth .psd-sub { margin-top: 6px !important; }
.psd-auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; }
.psd-or { display: flex; align-items: center; gap: 12px; color: var(--d-muted); font-size: 13px; margin-top: 16px; }
.psd-or::before, .psd-or::after { content: ""; flex: 1; height: 1px; background: var(--d-line); }

/* Shell */
.psd-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 80vh; background: var(--d-soft); border: 1px solid var(--d-line); border-radius: 20px; overflow: hidden; position: relative; }
.psd-side { background: #fff; border-right: 1px solid var(--d-line); padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; }
.psd-side .psd-brand { padding: 0 8px; margin-bottom: 12px; }
.psd-logo { display: block; height: 34px; width: auto; max-width: 100%; }
.psd-side .psd-logo { height: 30px; }
.psd-acct-name { padding: 8px 10px; margin-bottom: 8px; font-weight: 640; font-size: 14px; background: var(--d-soft); border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psd-switch { margin-bottom: 8px; }
.psd-nav { display: grid; gap: 2px; }
.psd-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--d-muted); font: inherit; font-weight: 580; font-size: 14.5px; cursor: pointer; }
.psd-nav-item:hover { background: var(--d-soft); color: var(--d-text); }
.psd-nav-item.is-active { background: color-mix(in srgb, var(--d-blue) 11%, #fff); color: var(--d-link); }
.psd-signout { margin-top: auto; }
.psd-main { padding: clamp(20px, 3vw, 36px); min-width: 0; }
.psd-head { margin-bottom: 22px; }
.psd-head .psd-sub { margin-top: 4px !important; }
.psd-menu-btn { display: none; }

/* Overview */
.psd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.psd-stat { padding: 18px 20px; }
.psd-stat + .psd-stat { margin-top: 0; }
.psd-stat-label { font-size: 13px; color: var(--d-muted); font-weight: 560; }
.psd-stat-value { font-size: 1.8rem; overflow-wrap: anywhere; font-weight: 760; letter-spacing: -.03em; margin: 4px 0 2px !important; }
.psd-stat-sub { font-size: 13px; color: var(--d-muted); }
.psd-checklist { list-style: none; display: grid; gap: 10px; margin-top: 14px !important; }
.psd-checklist li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--d-line); border-radius: 12px; }
.psd-checklist li p { color: var(--d-muted); font-size: 13.5px; }
.psd-checklist li.is-done { background: var(--d-soft); color: var(--d-muted); }
.psd-tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfd6e4; display: grid; place-items: center; color: #fff; }
.is-done .psd-tick { background: var(--d-ok); border-color: var(--d-ok); }
.psd-tick .psd-ico { width: 14px; height: 14px; }

/* Lists & tables */
.psd-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.psd-row > div:first-child { flex: 1; min-width: 200px; }
.psd-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #eef1f6; color: var(--d-muted); font-size: 12.5px; font-weight: 640; white-space: nowrap; }
.psd-pill-ok, .psd-s-confirmed_printed, .psd-s-accepted_by_spooler { background: #dcfce7; color: var(--d-ok); }
.psd-s-failed, .psd-s-uncertain { background: #fee2e2; color: var(--d-err); }
.psd-printers { list-style: none; display: grid; gap: 8px; margin-top: 14px !important; }
.psd-printers li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--d-soft); border-radius: 10px; }
.psd-printers li span:nth-child(2) { flex: 1; font-weight: 600; }
.psd-empty { text-align: center; padding: 40px 24px; }
.psd-empty p { color: var(--d-muted); max-width: 520px; margin: 8px auto 18px !important; }
.psd-table-card { padding: 0; overflow: hidden; }
.psd-scroll { overflow-x: auto; }
.psd-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.psd-table th, .psd-table td { padding: 12px 16px; border-bottom: 1px solid var(--d-line); text-align: left; vertical-align: middle; }
.psd-table th { background: var(--d-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--d-muted); font-weight: 650; }
.psd-table tr:last-child td { border-bottom: 0; }
.psd-limits { list-style: none; display: grid; gap: 10px; margin: 18px 0 !important; }
.psd-limits li { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--d-soft); border-radius: 10px; }

/* Designs */
.psd-designs { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
.psd-design-controls { display: grid; gap: 8px; }
.psd-design-controls .psd-sub { font-size: 14px; margin-top: 6px !important; }
.psd-preview-wrap { display: grid; place-items: center; min-height: 320px; padding: 24px; border-radius: 14px; background: linear-gradient(160deg, #e9f5f4, #f7f9fb); border: 1px solid var(--d-line); }
.psd-preview { max-width: 100%; max-height: 520px; background: #fff; border-radius: 6px; box-shadow: 0 20px 50px -20px rgba(2, 31, 69, .4); image-rendering: pixelated; }
.psd-code { font: 700 26px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--d-navy); background: var(--d-soft); border: 2px dashed #028b8a; border-radius: 12px; padding: 10px 16px; display: inline-block; margin: 12px 0 !important; }
.psd-codebox { margin-top: 14px; }

/* Toast & dialog */
.psd-toast { position: fixed; z-index: 100000; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: all .25s ease; background: var(--d-navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 20px 40px -12px rgba(1, 22, 49, .5); max-width: calc(100% - 32px); font-size: 14.5px; }
.psd-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.psd-toast.psd-err { background: #7f1d1d; }
.psd-dialog { border: 0; border-radius: 18px; padding: 28px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 30px 80px -20px rgba(1, 22, 49, .5); }
.psd-dialog::backdrop { background: rgba(1, 22, 49, .5); backdrop-filter: blur(2px); }
.psd-dialog p { color: var(--d-muted); margin-top: 8px !important; }
.psd-dialog .psd-actions { justify-content: flex-end; }

/* Responsive */
@media (max-width: 1100px) { .psd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .psd-designs { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .psd-root { width: 100vw; }
  .psd-shell { grid-template-columns: 1fr; border-radius: 0; border-left: 0; border-right: 0; }
  .psd-menu-btn { display: inline-flex; position: absolute; top: 14px; right: 14px; z-index: 3; width: 42px; height: 42px; align-items: center; justify-content: center; border: 1px solid var(--d-line); background: #fff; border-radius: 10px; cursor: pointer; color: var(--d-text); }
  .psd-side { display: none; border-right: 0; border-bottom: 1px solid var(--d-line); }
  .psd-side.is-open { display: flex; }
  .psd-main { padding-top: 20px; }
  .psd-head { padding-right: 52px; }
  .psd-grid2 { grid-template-columns: 1fr; gap: 6px; }
  .psd-grid2 label { margin-top: 8px; }
}
@media (max-width: 520px) {
  .psd-stats { grid-template-columns: 1fr; }
  .psd-card { padding: 18px; }
  .psd-auth-card { padding: 24px 20px; }
  .psd-inline { flex-direction: column; }
  .psd-inline input { max-width: none; }
  .psd-actions .psd-btn { flex: 1 1 100%; }
  .psd-checklist li { grid-template-columns: 28px 1fr; }
  .psd-checklist li > :last-child:not(div) { grid-column: 2; justify-self: start; }
}

/* Admin & Partner sections */
.psd-nav-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--d-muted); font-weight: 700; padding: 14px 12px 4px; }
.psd-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.psd-toolbar input { flex: 1 1 240px; max-width: 420px; }
.psd-toolbar select { width: auto; }
.psd-table tr.is-click { cursor: pointer; }
.psd-table tr.is-click:hover td { background: var(--d-soft); }
.psd-pill-warn { background: #fef3c7; color: #92400e; }
.psd-pill-partner { background: color-mix(in srgb, var(--d-blue) 14%, #fff); color: var(--d-link); }
.psd-kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; margin-top: 12px; font-size: 14.5px; }
.psd-kv dt { color: var(--d-muted); }
.psd-kv dd { margin: 0; overflow-wrap: anywhere; }
.psd-people { list-style: none; display: grid; gap: 6px; margin-top: 10px !important; }
.psd-people li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--d-soft); border-radius: 10px; font-size: 14px; }
.psd-people li span:first-child { flex: 1; overflow-wrap: anywhere; }
.psd-back { margin-bottom: 14px; }
.psd-secret { font: 600 14px/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--d-soft); border: 1px dashed var(--d-line); border-radius: 10px; padding: 12px; overflow-wrap: anywhere; user-select: all; margin-top: 10px !important; }
.psd-swatches { display: flex; gap: 10px; align-items: center; }
.psd-swatches input[type=color] { flex: none; cursor: pointer; width: 48px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--d-line); background: #fff; }
.psd-portal-preview { margin-top: 16px; border: 1px solid var(--d-line); border-radius: 14px; overflow: hidden; }
.psd-portal-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--d-line); }
.psd-portal-bar img { height: 28px; max-width: 220px; object-fit: contain; }
.psd-portal-body { padding: 16px; background: var(--d-soft); display: flex; gap: 10px; align-items: center; }
.psd-qr { width: 180px; height: 180px; background: #fff; border: 1px solid var(--d-line); border-radius: 10px; padding: 6px; }
.psd-activity { list-style: none; display: grid; gap: 0; margin-top: 8px !important; }
.psd-activity li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--d-line); font-size: 14px; }
.psd-activity li:last-child { border-bottom: 0; }
@media (max-width: 640px) { .psd-kv { grid-template-columns: 1fr; gap: 2px; } .psd-kv dd { margin-bottom: 8px; } .psd-activity li { grid-template-columns: 1fr; gap: 2px; } }
.psd-actions select { width: auto; min-width: 160px; }
