/* SignBoard AI - application styles (clean SaaS, desktop-first, responsive) */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff4ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .08);
  --sidebar: 248px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---------- boot / spinner */
.boot { display: flex; align-items: center; justify-content: center; height: 100vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30; transition: transform .2s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; }
.brand .name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand .sub { font-size: 11.5px; color: var(--muted); margin-top: -2px; }
.nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 12px 10px 4px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #374151; font-weight: 500; }
.nav a:hover { background: #f3f4f6; text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 12px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.userbox .who { flex: 1; min-width: 0; }
.userbox .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.content { padding: 28px 32px 48px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .4); z-index: 25; display: none; }

/* ---------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px 22px; }
.card-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 15.5px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fafafa; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 20px; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .hint { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-danger) .spin { border-color: var(--border); border-top-color: var(--primary); }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #374151; }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--danger); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.input.invalid { border-color: var(--danger); }
.input[readonly] { background: #f9fafb; color: var(--muted); }
textarea.input { min-height: 90px; resize: vertical; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group .suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 8px 8px 0; background: #f9fafb; color: var(--muted); font-size: 13px; font-weight: 500; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { position: relative; width: 38px; height: 22px; background: #d1d5db; border-radius: 999px; border: 0; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--primary); }
.switch.on::after { left: 19px; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafafa; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafbff; }
.table .thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #f3f4f6; display: block; }
.table .thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 11px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state .icon { font-size: 34px; margin-bottom: 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pagination .pages { display: flex; gap: 6px; }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f3f4f6; color: #374151; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--primary-soft); color: var(--primary); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- alerts */
.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert.info { background: var(--primary-soft); border-color: #c7d7fe; color: #1e3a8a; }
.alert.warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }
.alert.danger { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert.success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }

/* ---------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: var(--shadow-md); animation: fadein .18s ease; max-width: 380px; }
.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: fadein .15s ease; }
.modal.wide { max-width: 860px; }
.modal .card-head { position: sticky; top: 0; background: #fff; z-index: 1; }

/* ---------- auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%); }
.auth .card { width: 100%; max-width: 400px; }
.auth .brand { justify-content: center; border: 0; padding-bottom: 4px; }

/* ---------- wizard */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.steps { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--border); }
.steps .step .n { width: 18px; height: 18px; border-radius: 50%; background: #e5e7eb; color: #374151; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.steps .step.active { color: var(--primary); border-color: #bfd0fb; background: var(--primary-soft); }
.steps .step.active .n { background: var(--primary); color: #fff; }
.steps .step.done { color: var(--success); }
.steps .step.done .n { background: var(--success); color: #fff; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; text-align: left; transition: border-color .12s, box-shadow .12s; display: flex; flex-direction: column; gap: 4px; }
.choice:hover { border-color: #93b4f6; }
.choice.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); background: var(--primary-soft); }
.choice .t { font-weight: 600; font-size: 14px; }
.choice .d { font-size: 12px; color: var(--muted); line-height: 1.35; }
.choice .swatch { width: 100%; height: 34px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); margin-bottom: 4px; }
.choice .shape { height: 52px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.choice .shape div { background: #cbd5e1; }
.choice.selected .shape div { background: var(--primary); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 34px 20px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s; background: #fafafa; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon { font-size: 30px; margin-bottom: 6px; }
.logo-preview { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
.logo-preview img { max-height: 110px; max-width: 220px; object-fit: contain; }
.logo-preview .meta { background: rgba(255,255,255,.9); padding: 8px 10px; border-radius: 6px; font-size: 12.5px; }
.artwork-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.artwork-compare .pane { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fff; }
.artwork-compare .pane.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.artwork-compare .label { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.artwork-compare .img { height: 190px; display: flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden; background: #f6f7f9; }
.artwork-compare .img.checker { background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
.artwork-compare .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 720px) { .artwork-compare { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 20px; }
.summary .kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.summary .kv:last-child { border-bottom: 0; }
.summary .kv span:first-child { color: var(--muted); }
.price-box { background: #0f172a; color: #fff; border-radius: 10px; padding: 16px 18px; margin-top: 12px; }
.price-box .label { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.price-box .amount { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.price-box .sub { font-size: 12.5px; color: #cbd5e1; }
.logo-thumb-sm { width: 64px; height: 44px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 12px 12px; }

/* ---------- generating overlay */
.generating { padding: 48px 24px; text-align: center; }
.generating .ring { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--primary); animation: spin 1s linear infinite; margin: 0 auto 20px; }
.generating .status { font-size: 17px; font-weight: 600; min-height: 26px; }
.generating .progress { width: 320px; max-width: 100%; height: 6px; background: var(--border); border-radius: 999px; margin: 16px auto 0; overflow: hidden; }
.generating .progress div { height: 100%; background: var(--primary); width: 0; transition: width .6s ease; }
.generating ul { list-style: none; padding: 0; margin: 18px auto 0; max-width: 320px; text-align: left; font-size: 13.5px; color: var(--muted); }
.generating li { padding: 4px 0; display: flex; gap: 8px; align-items: center; }
.generating li.done { color: var(--success); }
.generating li.current { color: var(--text); font-weight: 600; }

/* ---------- result */
.result-image { background: #0f172a; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.result-image img { width: 100%; height: auto; display: block; }
.spec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.spec { padding: 12px 14px; background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; }
.spec .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.spec .v { font-weight: 600; margin-top: 3px; }

/* ---------- misc */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 14px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 150px; }
.kbd { font-family: ui-monospace, monospace; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 12px; border: 1px solid var(--border); }
.formula { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 13px; line-height: 1.7; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.list-plain li:last-child { border-bottom: 0; }
.bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; flex: 1; }
.bar div { height: 100%; background: var(--primary); }
pre.details { background: #f9fafb; border: 1px solid var(--border); padding: 10px; border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.img-setting { display: flex; align-items: center; gap: 14px; }
.img-setting img { height: 56px; max-width: 160px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; padding: 4px; background: #fff; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-md); }
  .overlay.show { display: block; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .content { padding: 18px 16px 90px; }
  .wizard { grid-template-columns: 1fr; }
  .summary { position: static; }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .bottom-nav { display: flex; }
}
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); z-index: 20; }
.bottom-nav a { flex: 1; text-align: center; padding: 8px 4px 10px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.burger { background: none; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.burger svg { width: 20px; height: 20px; stroke: #374151; fill: none; stroke-width: 2; }
