/* ============================================================
   Simracing Buttonbox Configurator
   Minimal, professional engineering-style UI
   ============================================================ */

/* ---- Design tokens --------------------------------------- */
:root {
    --c-black:  #111111;
    --c-dark:   #222222;
    --c-mid:    #444444;
    --c-muted:  #888888;
    --c-border: #e5e5e5;
    --c-bg:     #ffffff;
    --c-bg-alt: #f7f7f7;
    --nav-h:    60px;
    --yellow:   #F5C518;
}

/* ---- Reset / Base ---------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, Arial, sans-serif;
    font-size: 13px;
    color: #222222;
    background: #ffffff;
    line-height: 1.5;
}

/* ---- Top Bar --------------------------------------------- */
#topbar {
    display: flex;
    align-items: center;
    height: var(--nav-h);
    padding: 0 20px;
    gap: 14px;
    border-bottom: 1px solid var(--c-border);
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    z-index: 10;
}

#topbar-home {
    font-size: 16px;
    color: var(--c-muted);
    text-decoration: none;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

#topbar-home:hover { color: var(--c-dark); }

.topbar-sep {
    color: var(--c-border);
    font-size: 16px;
    flex-shrink: 0;
}

#topbar h1 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--c-black);
}

#topbar .topbar-sub {
    font-size: 11px;
    color: var(--c-muted);
    letter-spacing: 0.04em;
}

/* ---- App Layout ------------------------------------------ */
html, body { height: 100%; }

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    font-family: system-ui, -apple-system, Arial, sans-serif;
}

#workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ---- Sidebars -------------------------------------------- */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--c-bg);
}

.sidebar.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--c-border);
    width: 220px;
}

.sidebar-section {
    padding: 12px 13px 10px;
    border-bottom: 1px solid var(--c-border);
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 8px;
}

/* ---- Component Items ------------------------------------- */
.component-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border: 1px solid var(--c-border);
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
    background: var(--c-bg);
    transition: border-color 0.15s, background 0.15s;
}

.component-item:hover  { background: var(--c-bg-alt); border-left: 2px solid rgba(245,197,24,0.5); }
.component-item.active { background: #fffbe6; border-left: 2px solid var(--yellow) !important; }
.component-item.active .comp-name   { color: #111; }
.component-item.active .comp-detail { color: #666; }
.component-item.active .comp-icon   { border-color: var(--yellow); color: var(--yellow); background: #fff8d0; }

.comp-icon {
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--c-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--c-mid);
    background: var(--c-bg-alt);
    overflow: hidden;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.comp-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.comp-icon img {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

.comp-info    { flex: 1; min-width: 0; }
.comp-name    { font-size: 12px; font-weight: 600; color: var(--c-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.comp-detail  { font-size: 11px; color: var(--c-muted); transition: color 0.15s; }

/* ---- Center Canvas Area ---------------------------------- */
#center {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: #f0f0f0;
}

/* Baseplate selector */
#baseplate-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

#baseplate-selector h2 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--c-dark);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#baseplate-selector p {
    font-size: 12px;
    color: var(--c-muted);
    margin-bottom: 24px;
}

.baseplate-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 280px;
}

.baseplate-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--c-border);
    background: var(--c-bg);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--c-dark);
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.baseplate-btn:hover   { border-color: var(--c-dark); background: var(--c-bg-alt); }
.baseplate-btn .bp-dims { font-size: 11px; color: var(--c-muted); font-weight: 400; }

/* Canvas area — fills center, no padding */
#canvas-area {
    display: none;
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #d4d4d4;
    min-height: 0;
}

#canvas-area.visible {
    display: flex;
    flex-direction: column;
}

/* The canvas itself fills the available space */
#editor-canvas {
    flex: 1;
    display: block;
    width: 100%;
    min-height: 0;
    cursor: default;
}

/* Footer strip below canvas */
#canvas-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 5px 12px;
    background: var(--c-bg-alt);
    border-top: 1px solid var(--c-border);
    flex-shrink: 0;
    min-height: 28px;
}

#canvas-hint {
    font-size: 11px;
    color: var(--c-muted);
    flex: 1;
}

#canvas-warning {
    font-size: 11px;
    color: #cc4444;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---- Zoom Controls --------------------------------------- */
#zoom-controls {
    position: absolute;
    bottom: 36px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--c-border);
    padding: 3px 4px;
    z-index: 5;
}

#zoom-level {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-dark);
    min-width: 36px;
    text-align: center;
    user-select: none;
    letter-spacing: 0.02em;
}

.zoom-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--c-border);
    background: var(--c-bg);
    color: var(--c-dark);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}

.zoom-btn:hover {
    background: var(--c-bg-alt);
    border-color: var(--c-mid);
}

/* ---- Right Sidebar: Properties --------------------------- */
#props-empty { font-size: 11px; color: var(--c-muted); }

#props-detail         { display: none; }
#props-detail.visible { display: block; }

.prop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

.prop-label { color: var(--c-muted); min-width: 58px; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.prop-value { font-weight: 600; color: var(--c-dark); text-align: right; font-size: 12px; }

.prop-input {
    width: 72px;
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--c-border);
    background: var(--c-bg-alt);
    color: var(--c-dark);
    text-align: right;
    -moz-appearance: textfield;
}
.prop-input::-webkit-inner-spin-button,
.prop-input::-webkit-outer-spin-button { opacity: 0.4; }
.prop-input:focus { outline: none; border-color: var(--yellow); }

/* ---- Panel Customization --------------------------------- */
.panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.panel-row-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-muted);
}

.color-picker {
    width: 40px;
    height: 24px;
    border: 1px solid #e5e5e5;
    padding: 1px;
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; }

/* Material preset buttons (2-per-row grid) */
.material-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.material-btn {
    padding: 6px 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--c-border);
    background: var(--c-bg);
    color: var(--c-mid);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.material-btn:hover  { background: var(--c-bg-alt); border-color: var(--c-mid); color: var(--c-dark); }
.material-btn.active { background: var(--c-black); color: #ffffff; border-color: var(--c-black); }

/* ---- Buttons --------------------------------------------- */
.btn {
    display: inline-block;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--c-border);
    background: var(--c-bg);
    color: var(--c-dark);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover        { background: var(--c-bg-alt); border-color: var(--c-mid); }
.btn:disabled     { opacity: 0.45; cursor: not-allowed; }

.btn-primary       { background: var(--c-black); color: #ffffff; border-color: var(--c-black); }
.btn-primary:hover { background: var(--c-mid); border-color: var(--c-mid); }

.btn-danger        { border-color: #cc4444; color: #cc4444; background: var(--c-bg); }
.btn-danger:hover  { background: #fff5f5; border-color: #aa3333; }

.btn-secondary       { border-color: var(--yellow); color: var(--yellow); background: transparent; }
.btn-secondary:hover { background: rgba(245,197,24,0.08); }

.btn-warning       { background: var(--yellow); color: #000 !important; border-color: var(--yellow); }
.btn-warning:hover { background: #c9a00e; border-color: #c9a00e; }

.btn-sm   { padding: 5px 10px; font-size: 10px; }
.btn-full { width: 100%; }

/* ---- Bottom Bar ------------------------------------------ */
#bottombar {
    border-top: 1px solid var(--c-border);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#bottombar .status-text {
    font-size: 11px;
    color: var(--c-muted);
    flex: 1;
    letter-spacing: 0.02em;
}

/* ---- Form (submit.php) ----------------------------------- */
.page-container {
    max-width: 540px;
    margin: 48px auto;
    padding: 0 20px;
}

.page-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #222222;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 12px;
    color: #888888;
    margin-bottom: 28px;
}

.form-group  { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888888;
    margin-bottom: 5px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #222222;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    outline: none;
}

.form-control:focus  { border-color: #333333; }

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-error { font-size: 11px; color: #cc4444; margin-top: 4px; }

.config-preview       { background: #f9f9f9; border: 1px solid #e5e5e5; padding: 12px 14px; margin-bottom: 20px; }
.config-preview-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #888888; margin-bottom: 10px; }
.config-preview-row   { font-size: 12px; color: #222222; padding: 3px 0; }

.success-box    { padding: 20px; border: 1px solid #e5e5e5; background: #f9f9f9; text-align: center; }
.success-box h2 { font-size: 14px; font-weight: 600; color: #222222; margin-bottom: 8px; }
.success-box p  { font-size: 12px; color: #888888; }

/* ---- Admin Page ------------------------------------------ */
.admin-body {
    display: flex;
    height: calc(100vh - var(--nav-h));
    overflow: hidden;
}

.admin-list {
    width: 480px;
    flex-shrink: 0;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
}

.admin-detail {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

table              { width: 100%; border-collapse: collapse; }
thead th           { text-align: left; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: #888888; padding: 8px 14px; border-bottom: 1px solid #e5e5e5; background: #f9f9f9; }
tbody tr           { cursor: pointer; border-bottom: 1px solid #f0f0f0; }
tbody tr:hover     { background: #f5f5f5; }
tbody tr.selected  { background: #f0f0f0; }
tbody td           { padding: 9px 14px; font-size: 12px; color: #222222; vertical-align: middle; }

.badge         { display: inline-block; padding: 2px 7px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid; }
.badge-pending  { color: #888888; border-color: #e5e5e5; }
.badge-checked  { color: #555555; border-color: #cccccc; background: #f5f5f5; }
.badge-accepted { color: #2a7a2a; border-color: #b0d4b0; background: #f0faf0; }
.badge-rejected { color: #cc4444; border-color: #f0b0b0; background: #fff5f5; }

.detail-section       { margin-bottom: 24px; }
.detail-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #888888; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #e5e5e5; }
.detail-field         { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px solid #f5f5f5; font-size: 12px; }
.detail-field-label   { min-width: 90px; color: #888888; flex-shrink: 0; }
.detail-field-value   { color: #222222; word-break: break-all; }

pre.json-view {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #333333;
    max-height: 280px;
    overflow-y: auto;
}

.status-controls { display: flex; gap: 6px; flex-wrap: wrap; }

#admin-canvas-wrapper { border: 1px solid #e5e5e5; background: #d4d4d4; display: inline-block; }

/* ---- Utility --------------------------------------------- */
.hidden { display: none !important; }

.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }

.text-muted { color: #888888; font-size: 12px; }

/* ============================================================
   DARK THEME — Configurator + Admin
   ============================================================ */

body { background: #111111; color: #d4d4d4; }

/* ── Topbar ─────────────────────────────────────────────── */
#topbar {
    background: #0a0a0a !important;
    border-bottom: 1px solid #242424;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#topbar h1    { color: #e0e0e0; }
#topbar-home  { color: #444; }
#topbar-home:hover { color: #e0e0e0; }
#topbar .topbar-sub { color: #444; }
.topbar-sep   { color: #2a2a2a; }

/* ── Sidebars ────────────────────────────────────────────── */
.sidebar { background: #141414; border-color: #222; }
.sidebar.sidebar-right { border-color: #222; }

.sidebar-section { border-bottom-color: #222; }
.sidebar-label   { color: var(--yellow); font-size: 9px; letter-spacing: 0.12em; }

.component-item        { border-bottom: 1px solid #1e1e1e; }
.component-item:hover  { background: #1c1c1c; }
.component-item.active { background: #1a1500; border-left: 2px solid var(--yellow); }

.comp-icon { background: #1e1e1e; color: #777; border-color: #2a2a2a; }
.component-item.active .comp-icon { background: #1a1500; color: var(--yellow); border-color: var(--yellow); }
.comp-name  { color: #d0d0d0; }
.comp-detail { color: #555; }
.component-item.active .comp-name  { color: var(--yellow); }
.component-item.active .comp-detail { color: #888; }

/* ── Center / Canvas area ────────────────────────────────── */
#center { background: #1a1a1a; position: relative; }

/* No-shift: both children fill center absolutely */
#baseplate-selector {
    position: absolute;
    inset: 0;
    background: #111111;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    transition: opacity 0.2s;
}
#baseplate-selector.hidden-out {
    opacity: 0;
    pointer-events: none;
}
#canvas-area {
    position: absolute;
    inset: 0;
    z-index: 1;
}
#canvas-area.visible {
    display: flex;
    flex-direction: column;
    z-index: 3;
}

#baseplate-selector h2 { color: #e0e0e0; font-size: 11px; letter-spacing: 0.14em; }
#baseplate-selector p  { color: #555; }

.baseplate-btn       { background: #1a1a1a; border-color: #2a2a2a; color: #d0d0d0; }
.baseplate-btn:hover  { background: #1e1e1e; border-color: var(--yellow); color: #e0e0e0; }
.baseplate-btn .bp-dims { color: #555; }

#canvas-footer  { background: #0c0c0c; border-top-color: #1e1e1e; }
#canvas-hint    { color: #444; }
#canvas-warning { color: #e05555; }

/* ── Zoom controls ───────────────────────────────────────── */
#zoom-controls {
    background: rgba(15,15,15,0.96);
    border-color: #2a2a2a;
    backdrop-filter: none;
}
#zoom-level { color: #666; }
.zoom-btn   { background: #141414; border-color: #2a2a2a; color: #666; }
.zoom-btn:hover { background: #1e1e1e; border-color: #555; color: #ccc; }

/* ── Properties panel ────────────────────────────────────── */
.prop-row   { border-bottom-color: #1e1e1e; }
.prop-label { color: #555; }
.prop-value { color: #d0d0d0; }
#props-empty { color: #444; }

/* ── Panel customization ─────────────────────────────────── */
.panel-row-label { color: #555; }
.material-btn    { background: #1a1a1a; border-color: #2a2a2a; color: #666; }
.material-btn:hover  { background: #1e1e1e; border-color: var(--yellow); color: #ccc; }
.material-btn.active { background: var(--yellow); color: #000; border-color: var(--yellow); }

.color-picker { border-color: #2a2a2a; }

/* ── Prop inputs ─────────────────────────────────────────── */
.prop-input { background: #1a1a1a; border-color: #2a2a2a; color: #d0d0d0; }
.prop-input:focus { border-color: var(--yellow); }

/* ── Logo upload section ─────────────────────────────────── */
#logo-status { color: #666 !important; }

/* ── Buttons (global dark override) ─────────────────────── */
.btn          { background: #1a1a1a; border-color: #2a2a2a; color: #888; }
.btn:hover    { background: #222; border-color: #444; color: #d0d0d0; }
.btn-primary  { background: var(--yellow); color: #000 !important; border-color: var(--yellow); }
.btn-primary:hover { background: #c9a00e; border-color: #c9a00e; color: #000 !important; }
.btn-danger   { background: transparent; border-color: #5a2222; color: #cc4444; }
.btn-danger:hover { background: #1f0a0a; border-color: #cc4444; }
.btn-secondary       { border-color: rgba(245,197,24,0.4); color: var(--yellow); background: transparent; }
.btn-secondary:hover { background: rgba(245,197,24,0.08); }

/* ── Bottom bar ──────────────────────────────────────────── */
#bottombar {
    background: #0a0a0a !important;
    border-top: 1px solid #1e1e1e;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
#bottombar .status-text { color: #444; }

/* ── Text muted override ─────────────────────────────────── */
.text-muted { color: #555; }

/* ============================================================
   ADMIN DARK THEME
   ============================================================ */
.admin-body   { background: #111; }
.admin-list   { background: #141414; border-color: #222; }
.admin-detail { background: #111; }

table         { background: transparent; }
thead th      { background: #0f0f0f; color: #555; border-bottom-color: #222;
                text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
tbody tr      { border-bottom-color: #1a1a1a; }
tbody tr:hover     { background: #1a1a1a; }
tbody tr.selected  { background: #1c1500; }
tbody td      { color: #c8c8c8; }

.badge-pending  { color: #555; border-color: #2a2a2a; background: transparent; }
.badge-checked  { color: #888; border-color: #333; background: #1a1a1a; }
.badge-accepted { color: #4caf50; border-color: #1a3a1a; background: #0a1a0a; }
.badge-rejected { color: #e05555; border-color: #3a1a1a; background: #1a0a0a; }
.badge-shipped  { color: var(--yellow); border-color: #3a2d00; background: #1a1500; }

.detail-section-title { color: #555; border-bottom-color: #222; }
.detail-field         { border-bottom-color: #1a1a1a; }
.detail-field-label   { color: #555; }
.detail-field-value   { color: #d0d0d0; }

pre.json-view {
    background: #0f0f0f;
    border-color: #222;
    color: #777;
}

.status-controls .btn[style*="background:#333"],
.status-controls .btn[style*="background: #333"] {
    background: var(--yellow) !important;
    color: #000 !important;
    border-color: var(--yellow) !important;
}

#admin-canvas-wrapper { border-color: #222; background: #1a1a1a; }

/* Admin topbar */
#topbar .topbar-sub a { color: #555 !important; }
#topbar .topbar-sub a:hover { color: #d0d0d0 !important; }

/* ============================================================
   v2.0 UI Modernisierung
   ============================================================ */

/* ── Material Swatches in Sidebar-Buttons ─────────────────── */
.material-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.material-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.15);
}

.swatch-plain  { background: #ffffff; border-color: #ccc; }
.swatch-black  { background: #1a1a1a; border-color: rgba(255,255,255,0.15); }
.swatch-carbon { background: repeating-linear-gradient(45deg,#1a1a1a 0,#1a1a1a 2px,#2b2b2b 2px,#2b2b2b 5px); }
.swatch-alu    { background: linear-gradient(135deg,#b8b8b8 0%,#d8d8d8 50%,#9e9e9e 100%); }
.swatch-wood   { background: linear-gradient(90deg,#8b6040 0%,#a0724e 50%,#7a5435 100%); }

/* Dark mode swatches */
.dark .swatch-plain { border-color: rgba(255,255,255,0.25); }

/* ── Placement hints ──────────────────────────────────────── */
.placement-hints {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    line-height: 1.6;
    color: var(--c-muted);
}

.placement-hints span::before {
    content: '· ';
    opacity: 0.5;
}

/* ── Sidebar hint text ────────────────────────────────────── */
.sidebar-hint {
    font-size: 11px;
    font-style: italic;
}

/* ── Properties action buttons ───────────────────────────── */
.prop-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* ── Empty state props panel ──────────────────────────────── */
.props-empty-state {
    font-size: 12px;
    text-align: center;
    padding: 16px 8px;
    border: 1px dashed var(--c-border);
    border-radius: 3px;
    color: var(--c-muted);
}

/* ── Component item improvements ─────────────────────────── */
.component-item {
    cursor: grab;
    transition: background 0.15s, border-left-color 0.15s, transform 0.1s;
}

.component-item:hover {
    transform: translateX(2px);
    border-left: 2px solid var(--yellow);
}

.component-item.active {
    border-left: 2px solid var(--yellow);
}

/* ── Prop input focus ring ────────────────────────────────── */
.prop-input {
    border-radius: 3px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.prop-input:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 0 2px rgba(245,197,24,0.15);
}

/* ── Bottom bar submit button larger ─────────────────────── */
#btn-submit {
    font-size: 12px;
    padding: 9px 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ── Dark mode: new classes ───────────────────────────────── */
.dark .props-empty-state {
    border-color: #2a2a2a;
    color: #444;
}

.dark .placement-hints { color: #444; }
.dark .sidebar-hint    { color: #444; }
.dark .component-item:hover { background: #1c1c1c; }
.dark .swatch-plain    { border-color: rgba(255,255,255,0.2); }

/* ── Admin: btn-active class (replaces inline style) ─────── */
.btn-active {
    background: var(--yellow) !important;
    color: #000 !important;
    border-color: var(--yellow) !important;
}

/* ── Admin: table improvements ───────────────────────────── */
tbody tr {
    transition: background 0.12s;
    border-left: 2px solid transparent;
}

tbody tr:hover {
    border-left-color: rgba(245,197,24,0.4);
}

tbody tr.selected {
    border-left: 2px solid var(--yellow) !important;
    background: rgba(245,197,24,0.05) !important;
}

/* ── Admin: pill badges ───────────────────────────────────── */
.badge {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 10px;
}

/* ── Admin: detail sections as cards ─────────────────────── */
.detail-section {
    background: var(--c-bg-alt, #f7f7f7);
    border: 1px solid var(--c-border, #e5e5e5);
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.detail-section-title {
    margin-bottom: 12px;
    padding-bottom: 8px;
}

/* ── Admin: canvas wrapper better sizing ─────────────────── */
#admin-canvas-wrapper {
    display: block;
    max-height: 280px;
    overflow: hidden;
    border-radius: 3px;
    text-align: center;
}

#admin-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
}

/* ── Admin: empty state ───────────────────────────────────── */
.admin-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 13px;
    color: var(--c-muted);
    text-align: center;
    padding: 40px;
}

/* ── Dark mode: admin improvements ───────────────────────── */
.dark .detail-section {
    background: #1c1c1c;
    border-color: #2a2a2a;
}

.dark tbody tr.selected {
    background: rgba(245,197,24,0.06) !important;
}

.dark tbody tr:hover {
    border-left-color: rgba(245,197,24,0.3);
}

/* ============================================================
   TOAST NOTIFICATION SYSTEM
   ============================================================ */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-left: 3px solid var(--yellow);
    color: #d0d0d0;
    font-size: 12px;
    font-weight: 500;
    min-width: 220px;
    max-width: 340px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    pointer-events: all;
    animation: toast-in 0.25s ease forwards;
    border-radius: 2px;
}

.toast.toast-error  { border-left-color: #e05555; }
.toast.toast-success { border-left-color: #4caf50; }

.toast-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.toast.toast-out {
    animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #2a2a2a;
    border-top-color: var(--yellow);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    font-size: 11px;
    padding: 10px 8px;
}

/* ============================================================
   UNDO / REDO BUTTONS IN TOPBAR
   ============================================================ */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.topbar-icon-btn {
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid #2a2a2a;
    color: #444;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.topbar-icon-btn:hover:not(:disabled) {
    background: #1e1e1e;
    border-color: #444;
    color: #d0d0d0;
}

.topbar-icon-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ============================================================
   BASEPLATE SELECTOR — CARDS
   ============================================================ */

.baseplate-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 420px;
}

.baseplate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 14px 14px;
    border: 1px solid #2a2a2a;
    background: #141414;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
    border-radius: 3px;
    gap: 8px;
}

.baseplate-card:hover {
    border-color: var(--yellow);
    background: #1a1500;
    transform: translateY(-2px);
}

.baseplate-card-icon {
    opacity: 0.35;
    flex-shrink: 0;
}

.baseplate-card-name {
    font-size: 12px;
    font-weight: 700;
    color: #d0d0d0;
    letter-spacing: 0.04em;
}

.baseplate-card-dims {
    font-size: 11px;
    color: #555;
    font-weight: 400;
}

/* ============================================================
   PHASE 4 — DESIGN REFRESH
   ============================================================ */

/* Space Grotesk font */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

/* Topbar uses Space Grotesk */
#topbar {
    height: 64px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

#topbar h1 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* Submit button as yellow pill */
#btn-submit {
    background: var(--yellow) !important;
    color: #000 !important;
    border-color: var(--yellow) !important;
    border-radius: 999px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 700;
    font-size: 12px;
    padding: 10px 22px;
    letter-spacing: 0.03em;
}

#btn-submit:hover {
    background: #c9a00e !important;
    border-color: #c9a00e !important;
}

/* Simulate button outline style */
#btn-sim {
    border-radius: 999px;
}

/* Sidebar section label — yellow accent */
.sidebar-label {
    color: var(--yellow);
    letter-spacing: 0.14em;
    font-size: 9px;
}

/* Component items — hover lift */
.component-item {
    border-radius: 3px;
    border: 1px solid #1e1e1e;
    margin-bottom: 3px;
}

.component-item:hover {
    transform: translateX(3px);
    box-shadow: -2px 0 0 var(--yellow);
}

/* Bottom bar status text */
#bottombar .status-text {
    font-size: 11px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
}
