:root {
    --astral-ink: #09142F;
    --astral-primary: #E87002;
    --astral-accent: #D75310;
    --astral-peach: #FEC998;
    --astral-purple: #7575E7;
    --astral-blue: #4E95D9;
    --astral-teal: #2EA19E;
    --astral-magenta: #A02B93;

    --color-bg: #F7F7F8;
    --color-surface: #FFFFFF;
    --color-sidebar: #FAFAFA;
    --color-border: #E2E3E7;
    --color-border-hover: #CDD0D6;
    --color-text: #09142F;
    --color-text-secondary: #7A7F8F;
    --color-text-muted: #9CA0AD;
    --color-input-bg: #F7F7F8;

    --status-running: #4E95D9;
    --status-completed: #2EA19E;
    --status-errored: #E24B4A;
    --status-attention: #E87002;
    --status-queued: #7575E7;
    --status-paused: #A02B93;
    --status-cancelled: #9CA0AD;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--astral-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--astral-accent), var(--astral-primary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 12px rgba(232, 112, 2, 0.28);
    filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-primary.btn-danger {
    background: linear-gradient(90deg, #E24B4A, #C43A39);
    color: white;
}

.btn-primary.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(226, 75, 74, 0.3);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--astral-primary);
    color: var(--astral-accent);
    background: rgba(232, 112, 2, 0.04);
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-secondary.btn-danger {
    color: var(--status-errored);
}

.btn-secondary.btn-danger:hover:not(:disabled) {
    border-color: var(--status-errored);
    background: rgba(226, 75, 74, 0.06);
    color: var(--status-errored);
    box-shadow: 0 3px 10px rgba(226, 75, 74, 0.12);
}

/* Shared interaction feel for small controls and clickable rows */
.filter-chip, .filter-tab, .status-btn, .btn-action, .tab, .toast-open, .breadcrumb-link {
    transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.filter-chip:hover, .filter-tab:hover, .status-btn:hover:not(:disabled), .btn-action:hover, .toast-open:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-chip:active, .filter-tab:active, .status-btn:active:not(:disabled), .btn-action:active {
    transform: scale(0.97);
    box-shadow: none;
}

.order-row, .device-card, .lab-card, .step-row, .detail-child-row, .tree-node-row {
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.order-row:hover, .device-card:hover, .lab-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.input-field {
    background: var(--color-input-bg);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--color-text);
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}

.input-field:focus {
    border-color: var(--astral-primary);
}

.input-field::placeholder {
    color: var(--color-text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.running { background: rgba(78,149,217,0.08); color: #185FA5; }
.status-badge.completed { background: rgba(46,161,158,0.08); color: #0F6E56; }
.status-badge.errored { background: rgba(226,75,74,0.08); color: #E24B4A; }
.status-badge.awaiting-input,
.status-badge.awaiting-decision,
.status-badge.needs-attention { background: rgba(232,112,2,0.08); color: var(--astral-accent); }
.status-badge.queued,
.status-badge.pending,
.status-badge.not-started { background: rgba(117,117,231,0.08); color: #534AB7; }
.status-badge.paused { background: rgba(160,43,147,0.08); color: var(--astral-magenta); }
.status-badge.cancelled,
.status-badge.aborted,
.status-badge.pruned { background: rgba(156,160,173,0.08); color: var(--color-text-muted); }

.progress-bar {
    width: 80px;
    height: 4px;
    background: #F0F0F2;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

#blazor-error-ui {
    background: var(--status-errored);
    color: white;
    padding: 0.75rem 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
}

#blazor-error-ui[style] {
    display: block;
}

.blazor-error-boundary {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    padding: 1rem;
    border-radius: var(--radius-md);
    color: var(--status-errored);
}
