:root {
    --bg: #0f1115;
    --surface: #181b22;
    --surface-2: #1f232c;
    --border: #2a2f3a;
    --text: #e7e9ee;
    --text-dim: #9aa3b2;
    --accent: #4f8cff;
    --accent-hover: #5f9bff;
    --success: #2dbe6c;
    --warning: #f0a83a;
    --error: #ef4f5b;
    --info: #4f8cff;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

header h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.subtitle {
    margin: 0 0 20px;
    color: var(--text-dim);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

form .row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.hint {
    color: var(--text-dim);
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}

input, textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s ease, background .15s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #20242e;
}

input[type="text"]#fnsku {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

textarea {
    resize: vertical;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

button {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

button:hover {
    background: #262b36;
}

button:active {
    transform: translateY(1px);
}

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

button.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

button.ghost {
    background: transparent;
}

.message {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid transparent;
}

.message.hidden {
    display: none;
}

.message.success {
    background: rgba(45, 190, 108, 0.1);
    border-color: rgba(45, 190, 108, 0.4);
    color: #7be0a4;
}

.message.error {
    background: rgba(239, 79, 91, 0.1);
    border-color: rgba(239, 79, 91, 0.4);
    color: #ff8a91;
}

.message.info {
    background: rgba(79, 140, 255, 0.1);
    border-color: rgba(79, 140, 255, 0.4);
    color: #aac3ff;
}

.preview-card.hidden {
    display: none;
}

.preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preview-head h2 {
    margin: 0;
}

#preview-frame {
    width: 100%;
    height: 240px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.recent-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recent-head h2 {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

td.mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
}

td.ts {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

td.title {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.empty {
    color: var(--text-dim);
    text-align: center;
    padding: 24px;
}

.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.status-pending  { background: rgba(240,168,58,0.14);  color: #f0a83a; border-color: rgba(240,168,58,0.4); }
.status-printing { background: rgba(79,140,255,0.14);  color: #6ea6ff; border-color: rgba(79,140,255,0.4); }
.status-done     { background: rgba(45,190,108,0.14);  color: #7be0a4; border-color: rgba(45,190,108,0.4); }
.status-failed   { background: rgba(239,79,91,0.14);   color: #ff8a91; border-color: rgba(239,79,91,0.4); }
