:root {
    --bg:          #f5f7fa;
    --panel:       #d9e0ea;
    --surface:     #ffffff;
    --surface-soft:#eef2f7;
    --text:        #18202a;
    --text-soft:   #5f6b7a;
    --line:        #d7dee8;
    --shadow:      0 10px 30px rgba(15,23,42,0.08);
    --shadow-soft: 0 6px 18px rgba(15,23,42,0.06);
    --radius-xl:   24px;
    --radius-lg:   18px;
    --radius-md:   14px;
    --radius-sm:   10px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; }
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}

/* ── Layout ─────────────────────────────────────────────── */

.app-shell {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: 100vh;
}

.workbench {
    background: var(--panel);
    border-right: 1px solid rgba(255,255,255,0.35);
    padding: 24px 18px;
    overflow-y: auto;
}

.workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

/* ── Brand ───────────────────────────────────────────────── */

.workbench-brand { margin-bottom: 22px; }

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 5px;
    box-shadow: var(--shadow-soft);
}

.brand-name     { font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; }
.brand-subtitle { font-size: 0.8rem; color: var(--text-soft); }

/* ── Sections ────────────────────────────────────────────── */

.section       { margin-bottom: 22px; }

.section-title {
    margin: 0 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Swarmlet grid & cards ───────────────────────────────── */

.swarmlet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.swarmlet-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-soft);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    min-width: 0;
    cursor: pointer;
}

.swarmlet-card:hover   { transform: translateY(-2px); box-shadow: var(--shadow); }
.swarmlet-card.active  { border-color: #aab8c8; box-shadow: 0 12px 28px rgba(15,23,42,0.12); }
.swarmlet-card.launching { transform: scale(0.985); }

.swarmlet-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swarmlet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swarmlet-name {
    font-size: 0.74rem;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    padding: 0 2px 2px;
    word-break: break-word;
    line-height: 1.3;
}

.empty-note {
    background: rgba(255,255,255,0.55);
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

/* ── Kanban ──────────────────────────────────────────────── */

.kanban-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-column {
    background: rgba(255,255,255,0.48);
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: var(--radius-lg);
    padding: 10px;
}

.kanban-header {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.kanban-body { display: flex; flex-direction: column; gap: 8px; }

.entity-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-soft);
}

.entity-card strong { font-size: 0.84rem; }
.entity-card span   { font-size: 0.74rem; color: var(--text-soft); }

/* ── Dashboard ───────────────────────────────────────────── */

.dashboard-panel {
    background: rgba(255,255,255,0.52);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-xl);
    padding: 14px;
}

.dashboard-title { margin: 0 0 12px; font-size: 0.95rem; font-weight: 700; }

.dashboard-grid { display: flex; flex-direction: column; gap: 10px; }

.widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-label {
    font-size: 0.72rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.widget-value  { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.widget-meta   { font-size: 0.76rem; line-height: 1.4; color: var(--text-soft); }

.alerts-list   { display: flex; flex-direction: column; gap: 6px; }
.alert-item    { font-size: 0.8rem; line-height: 1.35; }

/* ── Workspace ───────────────────────────────────────────── */

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 28px 16px;
    border-bottom: 1px solid rgba(24,32,42,0.06);
}

.workspace-title         { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.workspace-title strong  { font-size: 1.05rem; line-height: 1.2; }
.workspace-title span    { font-size: 0.86rem; color: var(--text-soft); }

.workspace-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--line);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    transition: background 160ms ease, transform 160ms ease;
}

.ghost-btn:hover { background: #fff; transform: translateY(-1px); }

.workspace-frame {
    flex: 1;
    padding: 20px 28px 28px;
    min-height: 0;
    display: flex;
}

.workspace-empty {
    width: 100%;
    min-height: 420px;
    border-radius: 28px;
    border: 1px dashed var(--line);
    background: rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    text-align: center;
    color: var(--text-soft);
}

.workspace-empty strong { font-size: 1rem; color: var(--text); margin-bottom: 8px; }
.workspace-empty p      { margin: 0; max-width: 520px; line-height: 1.5; }

.workspace-host {
    width: 100%;
    min-height: 100%;
    border: none;
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.workspace-host.visible,
.workspace-host.frame-visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1200px) {
    .app-shell { grid-template-columns: 300px minmax(0,1fr); }
}

@media (max-width: 980px) {
    .app-shell  { grid-template-columns: 1fr; }
    .workbench  { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.4); }
    .swarmlet-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

@media (max-width: 640px) {
    .workbench, .workspace-header, .workspace-frame { padding-left: 16px; padding-right: 16px; }
    .swarmlet-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .workspace-header { flex-direction: column; align-items: flex-start; }
    .workspace-empty, .workspace-host { border-radius: 20px; }
}

/* ============================================================
   APPEND these rules to the existing src/main/resources/static/ui/workbench.css
   They introduce no new colours — same palette used by sign_in and info_collate.
   ============================================================ */

.signed-in {
    padding-top: 0;
}

.signed-in-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e2e4e9;
    border-radius: 10px;
    background: #ffffff;
}

.signed-in-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf82;
    box-shadow: 0 0 0 3px rgba(76, 175, 130, 0.15);
    flex: 0 0 auto;
}

.signed-in-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.signed-in-label {
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
}

.signed-in-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.signed-out-note {
    padding-top: 0.5rem;
}

.empty-state {
    padding: 1rem 0.9rem;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #fafbfc;
}

.empty-state-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.empty-state-body {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.45;
}

.alert-empty {
    color: #9ca3af;
    font-style: italic;
}
