body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.mono { font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace; }

.inp {
    width: 100%; padding: .5rem .75rem; border: 1px solid #cbd5e1; border-radius: .5rem;
    font-size: .875rem; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.inp:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
textarea.inp { resize: vertical; }
.inp-sm { padding: .25rem .5rem; font-size: .8125rem; }

.btn {
    display: inline-flex; align-items: center; gap: .375rem; padding: .5rem .875rem; border-radius: .5rem;
    font-size: .875rem; font-weight: 500; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: #fff; } .btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; } .btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; } .btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-light { background: #fff; border-color: #cbd5e1; color: #334155; } .btn-light:hover:not(:disabled) { background: #f1f5f9; }
.btn-sm { padding: .25rem .5rem; font-size: .75rem; }
.link { color: #2563eb; } .link:hover { color: #1e40af; text-decoration: underline; }

.nav-link {
    display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: .5rem;
    white-space: nowrap; color: #cbd5e1;
}
.nav-link:hover { background: #1e293b; color: #fff; }
.nav-link.active { background: #2563eb; color: #fff; }
.badge:empty { display: none; }
.badge {
    margin-left: auto; min-width: 1.25rem; padding: 0 .375rem; border-radius: 9999px; background: #ef4444;
    color: #fff; font-size: .6875rem; line-height: 1.25rem; text-align: center; font-weight: 700;
}

.card { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; }
.tbl { width: 100%; font-size: .875rem; }
.tbl th { text-align: left; font-size: .6875rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em; padding: .625rem .75rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.tbl th.text-right { text-align: right; } .tbl th.text-center { text-align: center; }
.tbl td { padding: .625rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl tr.dim td { opacity: .55; }

.pill { display: inline-block; padding: .0625rem .5rem; border-radius: 9999px; font-size: .6875rem; font-weight: 600; white-space: nowrap; }
.st-new, .st-review { background: #dbeafe; color: #1d4ed8; }
.st-processing, .st-draft { background: #fef3c7; color: #92400e; }
.st-shipped, .st-approved { background: #e0e7ff; color: #3730a3; }
.st-done, .st-published { background: #d1fae5; color: #065f46; }
.st-cancelled, .st-rejected { background: #fee2e2; color: #991b1b; }
.st-gray { background: #f1f5f9; color: #475569; }

.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tab { padding: .375rem .75rem; border-radius: .5rem; font-size: .8125rem; color: #475569; border: 1px solid transparent; }
.tab:hover { background: #fff; border-color: #e2e8f0; }
.tab.active { background: #fff; border-color: #cbd5e1; color: #0f172a; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tab small { color: #94a3b8; margin-left: .25rem; }

.thumb { width: 44px; height: 44px; object-fit: contain; border-radius: .375rem; border: 1px solid #e2e8f0; background: #f8fafc; }
.thumb-ph { width: 44px; height: 44px; border-radius: .375rem; border: 1px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .625rem; }

.img-tile { position: relative; width: 96px; height: 96px; border: 1px solid #e2e8f0; border-radius: .5rem; background: #f8fafc; overflow: hidden; }
.img-tile img { width: 100%; height: 100%; object-fit: contain; }
.img-tile .main-flag { position: absolute; left: 4px; top: 4px; background: #2563eb; color: #fff; font-size: 10px; padding: 0 4px; border-radius: 4px; }
.img-tile .tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: rgba(15,23,42,.65); }
.img-tile .tools button { color: #fff; font-size: 12px; padding: 2px 6px; }
.img-tile .tools button:hover { background: rgba(255,255,255,.2); }

.toggle { position: relative; width: 34px; height: 20px; border-radius: 9999px; background: #cbd5e1; transition: background .15s; flex-shrink: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle.on { background: #16a34a; } .toggle.on::after { transform: translateX(14px); }

.cell-input { width: 84px; padding: .1875rem .375rem; border: 1px solid transparent; border-radius: .375rem; background: transparent; font-size: .8125rem; text-align: right; }
.cell-input:hover { border-color: #cbd5e1; background: #fff; }
.cell-input:focus { outline: none; border-color: #3b82f6; background: #fff; }
.cell-input.saved { border-color: #16a34a; }

.toast { background: #fff; border: 1px solid #e2e8f0; border-left-width: 4px; border-radius: .5rem; padding: .75rem 1rem; font-size: .875rem; box-shadow: 0 10px 25px rgba(0,0,0,.08); animation: tin .2s ease-out; }
.toast.ok { border-left-color: #16a34a; } .toast.err { border-left-color: #dc2626; } .toast.info { border-left-color: #2563eb; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { padding: 3rem 1rem; text-align: center; color: #94a3b8; font-size: .875rem; }
.spinner { width: 1.5rem; height: 1.5rem; border: 2px solid #cbd5e1; border-top-color: #2563eb; border-radius: 50%; animation: spin .7s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.prose-pre { white-space: pre-wrap; word-break: break-word; }
