/* AlpsCraft ERP — semantic component classes.
   Shared across admin + customer portal. Depends on tokens.css. */

/* ──────────────────────────────
   App shell
   ────────────────────────────── */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-base);
}

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: var(--layout-pad);
    animation: fade-up var(--dur-slow) var(--ease-out) both;
}

@media (min-width: 768px) {
    .app-main { padding: var(--layout-pad-lg); }
}

.app-main--centered {
    max-width: var(--layout-max);
    margin-inline: auto;
    width: 100%;
}

/* Page load fade-up */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.fade-in { animation: fade-up var(--dur-slow) var(--ease-out) both; }
.fade-in-1 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 40ms; }
.fade-in-2 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 80ms; }
.fade-in-3 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 120ms; }
.fade-in-4 { animation: fade-up var(--dur-slow) var(--ease-out) both; animation-delay: 160ms; }

/* Ambient accent wash for hero sections */
.ambient {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.ambient::before {
    content: '';
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(1000px 400px at 12% -20%, rgba(56, 189, 248, 0.10), transparent 60%),
        radial-gradient(800px 300px at 88% -30%, rgba(245, 181, 68, 0.06), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* ──────────────────────────────
   Topbar
   ────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 var(--layout-pad);
    height: var(--topbar-h);
    background: rgba(17, 19, 24, 0.72);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--color-fg-primary);
}

.logo-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-strong);
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.18), rgba(245, 181, 68, 0.08));
    color: var(--color-fg-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.topbar__wordmark {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
}

.topbar__tag {
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    color: var(--color-fg-tertiary);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    font-weight: 500;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar__nav-link {
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: color var(--dur) var(--ease-out);
}
.topbar__nav-link:hover { color: var(--color-fg-primary); }

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    background: transparent;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    transition: all var(--dur) var(--ease-out);
}
.user-chip:hover {
    background: var(--color-bg-raised);
    border-color: var(--color-border-default);
    color: var(--color-fg-primary);
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent-bg-strong), var(--color-accent-bg));
    border: 1px solid var(--color-border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
    align-items: center;
    justify-content: center;
}
@media (max-width: 767px) {
    .mobile-toggle { display: inline-flex; }
}

/* ──────────────────────────────
   Sidebar
   ────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border-subtle);
    padding: 1rem 0.75rem;
    overflow-y: auto;
    min-height: calc(100vh - var(--topbar-h));
    position: sticky;
    top: var(--topbar-h);
    align-self: flex-start;
}

.sidebar__group { margin-bottom: 1.25rem; }
.sidebar__group-label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-muted);
    padding: 0.5rem 0.75rem 0.375rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: var(--radius-sm);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--dur) var(--ease-out);
    border-left: 2px solid transparent;
    position: relative;
}
.sidebar-link:hover {
    color: var(--color-fg-primary);
    background: var(--color-bg-raised);
}
.sidebar-link__icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    opacity: 0.85;
}
.sidebar-link--active {
    color: var(--color-accent);
    background: var(--color-accent-bg);
    border-left-color: var(--color-accent-strong);
}
.sidebar-link--active .sidebar-link__icon { opacity: 1; color: var(--color-accent); }

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        bottom: 0;
        z-index: var(--z-sidebar);
        transform: translateX(-100%);
        transition: transform var(--dur-slow) var(--ease-out);
        box-shadow: var(--shadow-overlay);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(4px);
        z-index: calc(var(--z-sidebar) - 1);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--dur) var(--ease-out);
    }
    .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
}

/* ──────────────────────────────
   Footer
   ────────────────────────────── */
.footer {
    border-top: 1px solid var(--color-border-subtle);
    padding: 1rem var(--layout-pad);
    text-align: center;
    color: var(--color-fg-muted);
    font-size: var(--fs-xs);
    background: var(--color-bg-base);
}
.footer a { color: var(--color-fg-tertiary); transition: color var(--dur) var(--ease-out); }
.footer a:hover { color: var(--color-fg-primary); text-decoration: underline; }

/* ──────────────────────────────
   Page header
   ────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-header__title {
    font-size: var(--fs-3xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-tight);
    color: var(--color-fg-primary);
}
.page-header__subtitle,
.page-header__sub {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
}
.page-header__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Hero dashboard band */
.hero {
    position: relative;
    padding: 2rem 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-subtle);
    background: linear-gradient(180deg, rgba(56,189,248,0.06), transparent 60%), var(--color-bg-elevated);
    margin-bottom: 1.5rem;
    overflow: hidden;
    isolation: isolate;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 260px at 0% 0%, rgba(56, 189, 248, 0.14), transparent 60%),
        radial-gradient(500px 240px at 100% 100%, rgba(245, 181, 68, 0.06), transparent 60%);
    pointer-events: none;
    z-index: -1;
}
.hero__eyebrow {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-accent);
}
.hero__title {
    font-size: var(--fs-4xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    line-height: var(--lh-tight);
    color: var(--color-fg-primary);
    margin-top: 0.5rem;
}
.hero__subtitle {
    color: var(--color-fg-secondary);
    font-size: var(--fs-md);
    margin-top: 0.5rem;
    max-width: 52ch;
}

/* ──────────────────────────────
   Cards
   ────────────────────────────── */
.card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.card--tight { padding: 1rem 1.25rem; }
.card--flush { padding: 0; overflow: hidden; }
.card--interactive {
    transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
    cursor: pointer;
}
.card--interactive:hover {
    transform: translateY(-1px);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-raised);
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-subtle);
}
.card__head h2, .card__head h3 {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
}
.card__body { padding: 1rem 1.25rem; }
.card__foot {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-bg-inset);
}

/* Stat card */
.stat-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.stat-card:hover { border-color: var(--color-border-default); transform: translateY(-1px); }
.stat-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.stat-card__label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--color-fg-tertiary);
}
.stat-card__icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-bg);
    color: var(--color-accent);
}
.stat-card__icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.stat-card__value {
    font-family: var(--font-sans);
    font-size: var(--fs-3xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    line-height: 1.1;
    color: var(--color-fg-primary);
}
.stat-card__delta {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
}

/* Tone variants (accent chip color) */
.stat-card--accent .stat-card__icon { background: var(--color-accent-bg); color: var(--color-accent); }
.stat-card--success .stat-card__icon { background: var(--color-success-bg); color: var(--color-success); }
.stat-card--warning .stat-card__icon { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card--danger .stat-card__icon { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-card--neutral .stat-card__icon { background: var(--color-neutral-bg); color: var(--color-fg-secondary); }

/* Quick-action card */
.quick-action {
    display: block;
    padding: 1.125rem 1.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--dur) var(--ease-out);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.quick-action::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(160px 100px at 10% 0%, var(--color-accent-bg), transparent 60%);
    opacity: 0;
    transition: opacity var(--dur) var(--ease-out);
    z-index: -1;
}
.quick-action:hover {
    border-color: var(--color-border-strong);
    transform: translateY(-1px);
}
.quick-action:hover::after { opacity: 1; }
.quick-action__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
}
.quick-action__desc {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
}
.quick-action__arrow {
    color: var(--color-fg-muted);
    transition: color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
    margin-left: auto;
}
.quick-action:hover .quick-action__arrow { color: var(--color-accent); transform: translateX(2px); }

/* ──────────────────────────────
   Buttons
   ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    text-decoration: none;
    user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

.btn--lg { padding: 0.625rem 1.125rem; font-size: var(--fs-base); }
.btn--sm { padding: 0.375rem 0.625rem; font-size: var(--fs-xs); }
.btn--block { display: flex; width: 100%; }

.btn-primary {
    background: var(--color-cta);
    color: var(--color-cta-fg);
    border-color: var(--color-cta);
}
.btn-primary:hover { background: var(--color-cta-hover); border-color: var(--color-cta-hover); }
.btn-primary:focus-visible { box-shadow: var(--shadow-focus-cta); }

.btn-secondary {
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
    border-color: var(--color-border-default);
}
.btn-secondary:hover { background: var(--color-bg-overlay); border-color: var(--color-border-strong); }

.btn-ghost {
    background: transparent;
    color: var(--color-fg-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--color-bg-raised); color: var(--color-fg-primary); }

.btn-outline {
    background: transparent;
    color: var(--color-fg-primary);
    border-color: var(--color-border-default);
}
.btn-outline:hover { border-color: var(--color-border-strong); background: var(--color-bg-raised); }

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: rgba(248, 113, 113, 0.25);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.45); }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border-color: var(--color-border-subtle);
    color: var(--color-fg-secondary);
}
.btn-icon:hover { background: var(--color-bg-raised); color: var(--color-fg-primary); border-color: var(--color-border-default); }

/* Link button (looks like text) */
.btn-link {
    padding: 0;
    background: transparent;
    color: var(--color-accent);
    border: 0;
    font-weight: 500;
}
.btn-link:hover { color: var(--color-accent-strong); text-decoration: underline; }

/* ──────────────────────────────
   Forms
   ────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.375rem; }

.label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--color-fg-secondary);
    letter-spacing: 0.005em;
}
.label .req { color: var(--color-danger); margin-left: 2px; }

.input, .select, .textarea {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    line-height: 1.35;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--color-fg-muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-border-strong); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-accent-strong);
    box-shadow: var(--shadow-focus);
    background: var(--color-bg-overlay);
}
.input--mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.input--error, .select--error, .textarea--error {
    border-color: rgba(248, 113, 113, 0.55);
}
.input--error:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25); }
.textarea { resize: vertical; min-height: 80px; }

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7384' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 12px;
}
.select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2338BDF8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.select option { background: var(--color-bg-overlay); color: var(--color-fg-primary); }

.field-error {
    color: var(--color-danger);
    font-size: var(--fs-xs);
    line-height: 1.4;
}
.field-hint {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-xs);
    line-height: 1.4;
}

/* Input with leading icon (search bars) */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group__icon {
    position: absolute;
    left: 0.75rem;
    width: 14px;
    height: 14px;
    color: var(--color-fg-tertiary);
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}
.input-group .input { padding-left: 2.125rem; }

/* Filter pill bar container */
.filter-bar {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.filter-bar .input, .filter-bar .select { min-width: 160px; }
.filter-bar .input-group { flex: 1 1 240px; }

/* Form section — groups related fields, works as a group inside a .card */
.form-section { margin-bottom: 1.5rem; }
.form-section + .form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-subtle);
}
.form-section__head { margin-bottom: 1rem; }
.form-section__title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
    margin: 0;
}
.form-section__subtitle,
.form-section__sub {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin: 0.25rem 0 0;
}
.form-section__optional {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-fg-muted);
    font-weight: 500;
    margin-left: 0.5rem;
}
.field-label__optional { color: var(--color-fg-muted); font-weight: 400; font-size: var(--fs-xs); }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem 1.25rem; }
@media (min-width: 640px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid--2 { grid-template-columns: 1fr 1fr; }
    .form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
    .form-grid__full,
    .field--full { grid-column: 1 / -1; }
}
.input--upper { text-transform: uppercase; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.release-add-form { margin-top: 1.5rem; }

.form-actions {
    display: flex;
    gap: 0.625rem;
    padding-top: 1rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
    flex-wrap: wrap;
}

/* ──────────────────────────────
   Tables
   ────────────────────────────── */
.table-wrap {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.table-wrap--scroll { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}
.table thead th {
    background: var(--color-bg-inset);
    color: var(--color-fg-tertiary);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
    white-space: nowrap;
}
.table tbody td {
    padding: 0.875rem 1rem;
    color: var(--color-fg-secondary);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--color-bg-raised); }
.table tbody tr.is-muted { opacity: 0.55; }
.table a { color: var(--color-fg-primary); font-weight: 500; }
.table a:hover { color: var(--color-accent); }
.table .num { font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--color-fg-tertiary); }
.table__action-cell { text-align: right; width: 1%; white-space: nowrap; }

/* ──────────────────────────────
   Badges & pills
   ────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}
.badge--dotless::before { display: none; }
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--info    { background: var(--color-info-bg);    color: var(--color-info); }
.badge--accent  { background: var(--color-accent-bg);  color: var(--color-accent); }
.badge--neutral { background: var(--color-neutral-bg); color: var(--color-fg-secondary); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
    font-size: var(--fs-xs);
    font-weight: 500;
}
.pill--accent { background: var(--color-accent-bg); color: var(--color-accent); border-color: rgba(56, 189, 248, 0.24); }

/* ──────────────────────────────
   Alerts / banners
   ────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-bg-elevated);
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    position: relative;
    overflow: hidden;
}
.alert::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--color-accent-strong);
}
.alert__icon {
    flex-shrink: 0;
    width: 16px; height: 16px;
    color: inherit;
    stroke: currentColor;
    fill: none;
    margin-top: 1px;
}
.alert--error { background: rgba(248, 113, 113, 0.06); color: var(--color-danger); border-color: rgba(248, 113, 113, 0.2); }
.alert--error::before { background: var(--color-danger); }
.alert--info { background: var(--color-info-bg); color: var(--color-info); border-color: rgba(96, 165, 250, 0.24); }
.alert--info::before { background: var(--color-info); }
.alert--success { background: var(--color-success-bg); color: var(--color-success); border-color: rgba(74, 222, 128, 0.24); }
.alert--success::before { background: var(--color-success); }
.alert--warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: rgba(251, 191, 36, 0.22); }
.alert--warning::before { background: var(--color-warning); }

/* ──────────────────────────────
   Empty state
   ────────────────────────────── */
.empty-state {
    background: var(--color-bg-elevated);
    border: 1px dashed var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.empty-state__icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    align-items: center;
    justify-content: center;
    color: var(--color-fg-tertiary);
    margin-bottom: 1rem;
}
.empty-state__icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.empty-state__title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-fg-primary);
    letter-spacing: var(--ls-tight);
}
.empty-state__body {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-top: 0.25rem;
    max-width: 48ch;
    margin-inline: auto;
}
.empty-state .btn { margin-top: 1rem; }

/* ──────────────────────────────
   Breadcrumb
   ────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-fg-tertiary);
    font-size: var(--fs-xs);
    margin-bottom: 1rem;
}
.breadcrumb a { color: var(--color-fg-tertiary); transition: color var(--dur) var(--ease-out); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb__sep { color: var(--color-fg-muted); }
.breadcrumb__current { color: var(--color-fg-secondary); }

/* ──────────────────────────────
   Auth card
   ────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--color-bg-base);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.auth-shell::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(600px 360px at 18% 22%, rgba(56, 189, 248, 0.14), transparent 55%),
        radial-gradient(500px 300px at 82% 80%, rgba(245, 181, 68, 0.10), transparent 55%),
        radial-gradient(800px 500px at 50% 110%, rgba(56, 189, 248, 0.05), transparent 60%);
    pointer-events: none;
    z-index: -1;
}
.auth-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(800px 600px at 50% 50%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(800px 600px at 50% 50%, #000, transparent 70%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.7;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-raised);
    animation: fade-up var(--dur-slow) var(--ease-out) both;
}
.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}
.auth-card__brand-mark { /* uses .logo-mark */ }
.auth-card__brand-text {
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    font-size: var(--fs-md);
}
.auth-card h1 {
    font-size: var(--fs-2xl);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    margin-bottom: 0.25rem;
}
.auth-card__lede {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin-bottom: 1.5rem;
}
.auth-card__divider {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin-top: 1.25rem;
}
.auth-card__divider a { color: var(--color-accent); font-weight: 500; }
.auth-card__divider a:hover { text-decoration: underline; }

/* ──────────────────────────────
   Release card (product detail)
   ────────────────────────────── */
.release-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.release-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: block;
    transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.release-card:hover { border-color: var(--color-border-default); background: var(--color-bg-raised); }
.release-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.release-card__title-block { display: flex; flex-direction: column; gap: 0.125rem; }
.release-card__version {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-accent);
    letter-spacing: 0;
}
.release-card__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.release-card__date {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
}
.release-card__notes {
    font-family: var(--font-sans);
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
    white-space: pre-wrap;
    margin-top: 0.75rem;
}
.release-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.875rem;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    font-size: var(--fs-2xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
    letter-spacing: 0;
}
.meta-chip strong { color: var(--color-fg-secondary); font-weight: 500; margin-right: 0.25rem; text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--font-sans); font-size: 10px; }

/* ──────────────────────────────
   Toast
   ────────────────────────────── */
.toast {
    background: var(--color-bg-overlay);
    border: 1px solid var(--color-border-default);
    border-left: 3px solid var(--color-accent-strong);
    color: var(--color-fg-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-overlay);
    font-size: var(--fs-sm);
    animation: slide-in var(--dur-slow) var(--ease-out) both;
    max-width: 380px;
}
.toast--success { border-left-color: var(--color-success); }
.toast--error { border-left-color: var(--color-danger); }
@keyframes slide-in {
    from { opacity: 0; transform: translateY(-6px) translateX(6px); }
    to { opacity: 1; transform: none; }
}

/* HTMX indicator inline next to search input */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-flex; color: var(--color-accent); align-items: center; gap: 0.375rem; font-size: var(--fs-xs); }
.htmx-request.htmx-indicator { display: inline-flex; }

/* Spinning glyph */
.spinner {
    width: 12px; height: 12px;
    border: 1.5px solid var(--color-border-default);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Giant error page */
.error-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}
.error-hero__code {
    font-family: var(--font-sans);
    font-size: clamp(4rem, 18vw, 10rem);
    font-weight: 600;
    letter-spacing: var(--ls-tighter);
    line-height: 0.95;
    background: linear-gradient(180deg, var(--color-accent), var(--color-fg-muted));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-hero__title {
    font-size: var(--fs-2xl);
    font-weight: 600;
    color: var(--color-fg-primary);
    margin-top: 0.75rem;
    letter-spacing: var(--ls-tight);
}
.error-hero__body {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-md);
    margin-top: 0.5rem;
    max-width: 48ch;
    margin-inline: auto;
}
.error-hero__actions {
    margin-top: 1.75rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ──────────────────────────────
   Dashboard hero band
   ────────────────────────────── */
.hero {
    position: relative;
    margin-bottom: 2rem;
    padding: 2.25rem 1.75rem 2rem;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(900px 340px at 12% -10%, rgba(125,211,252,0.12), transparent 60%),
        radial-gradient(600px 260px at 100% 120%, rgba(245,181,68,0.08), transparent 70%),
        linear-gradient(180deg, var(--color-bg-elevated), var(--color-bg-base));
    border: 1px solid var(--color-border-subtle);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 20% 0%, rgba(0,0,0,0.9), transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 20% 0%, rgba(0,0,0,0.9), transparent 75%);
    pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    margin: 0.5rem 0 0.5rem;
}
.hero__subtitle {
    color: var(--color-fg-secondary);
    font-size: var(--fs-md);
    max-width: 68ch;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0;
}

/* Section header shared */
.section-header { margin-bottom: 1rem; }
.section-title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-fg-primary);
    margin: 0;
    letter-spacing: var(--ls-tight);
}
.section-sub {
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
    margin: 0.25rem 0 0;
}

/* ──────────────────────────────
   Stat card grid + variants
   ────────────────────────────── */
.stat-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }

.stat-card {
    position: relative;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.125rem 1.125rem 1.25rem;
    overflow: hidden;
    transition: transform var(--dur-mid) var(--ease-out),
                border-color var(--dur-mid) var(--ease-out),
                background var(--dur-mid) var(--ease-out);
}
.stat-card:hover {
    transform: translateY(-1px);
    border-color: var(--color-border-default);
    background: var(--color-bg-raised);
}
.stat-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.stat-card__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    color: var(--color-fg-tertiary);
}
.stat-card__icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-secondary);
}
.stat-card__icon svg { width: 16px; height: 16px; }
.stat-card__value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: var(--ls-tight);
    color: var(--color-fg-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.stat-card--accent .stat-card__icon { color: var(--color-accent); background: var(--color-accent-bg); border-color: rgba(56,189,248,0.2); }
.stat-card--success .stat-card__icon { color: var(--color-success); background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.2); }
.stat-card--warning .stat-card__icon { color: var(--color-warning); background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.2); }
.stat-card--danger .stat-card__icon  { color: var(--color-danger);  background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }

/* ──────────────────────────────
   Quick actions grid
   ────────────────────────────── */
.quick-action-grid {
    display: grid;
    gap: 0.875rem;
    grid-template-columns: repeat(1, minmax(0,1fr));
}
@media (min-width: 640px) { .quick-action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .quick-action-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    color: var(--color-fg-primary);
    text-decoration: none;
    transition: all var(--dur-mid) var(--ease-out);
}
.quick-action:hover {
    transform: translateY(-1px);
    border-color: rgba(56,189,248,0.28);
    background: var(--color-bg-raised);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.12), 0 10px 30px rgba(0,0,0,0.3);
}
.quick-action__icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-accent-bg);
    color: var(--color-accent);
    border: 1px solid rgba(56,189,248,0.22);
    flex-shrink: 0;
}
.quick-action__icon svg { width: 18px; height: 18px; }
.quick-action__body { flex: 1; min-width: 0; }
.quick-action__label {
    display: block;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
}
.quick-action__sub {
    display: block;
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin-top: 2px;
}
.quick-action__arrow {
    color: var(--color-fg-muted);
    transition: color var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
}
.quick-action__arrow svg { width: 16px; height: 16px; }
.quick-action:hover .quick-action__arrow {
    color: var(--color-accent);
    transform: translateX(2px);
}

/* Card header + table-empty */
.card--pad-0 { padding: 0 !important; }
.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--color-border-subtle);
}
.card__title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-fg-primary);
    margin: 0;
}
.card__sub {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    margin: 0.2rem 0 0;
}
.table-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-fg-tertiary);
    font-size: var(--fs-sm);
}

/* Inline monospace code chip */
.mono, code.mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-fg-primary);
}

/* xl breakpoint helper for 2-column tables on dashboard */
@media (min-width: 1280px) {
    .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Helpers for data styling */
.link-accent {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--dur-mid) var(--ease-out);
}
.link-accent:hover { color: var(--color-accent-strong); text-decoration: underline; text-underline-offset: 3px; }

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--color-fg-muted);
    margin-right: 0.375rem;
    vertical-align: middle;
}
.status-dot--success { background: var(--color-success); box-shadow: 0 0 0 3px rgba(74,222,128,0.14); }
.status-dot--danger { background: var(--color-danger); box-shadow: 0 0 0 3px rgba(248,113,113,0.14); }
.status-dot--warning { background: var(--color-warning); box-shadow: 0 0 0 3px rgba(251,191,36,0.14); }

tr.is-inactive { opacity: 0.55; }
.font-mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

/* Avatar + user cell */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(125,211,252,0.14), rgba(125,211,252,0.04));
    color: var(--color-accent);
    border: 1px solid rgba(125,211,252,0.22);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.avatar--sm { width: 28px; height: 28px; font-size: 0.65rem; }
.avatar--lg { width: 44px; height: 44px; font-size: 0.9rem; }
.user-cell { display: inline-flex; align-items: center; gap: 0.625rem; }

/* Checkbox inline pattern */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    user-select: none;
    cursor: pointer;
    padding: 0.4rem 0;
}
.checkbox input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xs, 4px);
    cursor: pointer;
}

.text-muted { color: var(--color-fg-muted); }
.inline { display: inline; }

/* Meta list — definition-list used on detail pages */
.meta-list { display: flex; flex-direction: column; gap: 0.625rem; margin: 0; }
.meta-list__row { display: grid; grid-template-columns: 120px 1fr; gap: 0.75rem; align-items: baseline; }
.meta-list__row dt {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-fg-tertiary);
    font-weight: 600;
}
.meta-list__row dd { color: var(--color-fg-primary); font-size: var(--fs-sm); margin: 0; }

/* Title with badges on same line */
.title-with-badges { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }

/* Prose block for long-form text */
.prose {
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
    white-space: pre-wrap;
    margin: 0;
}

/* File input + upload form inline */
.input-file {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    max-width: 200px;
}
.input-file::file-selector-button {
    margin-right: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-default);
    background: var(--color-bg-raised);
    color: var(--color-fg-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background var(--dur) var(--ease-out);
}
.input-file::file-selector-button:hover { background: var(--color-bg-overlay); }
.upload-form { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Meta chip muted variant */
.meta-chip--muted { color: var(--color-fg-muted); font-family: var(--font-sans); }
.meta-chip--mono { font-family: var(--font-mono); cursor: pointer; }
.meta-chip--mono:hover { border-color: var(--color-accent); color: var(--color-fg-secondary); }

/* Utility spacing */
.ml-2 { margin-left: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* User head — avatar + name+email block on detail pages */
.user-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Address card */
.address-card {
    padding: 1rem;
    background: var(--color-bg-raised);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.address {
    font-style: normal;
    color: var(--color-fg-secondary);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.address > div + div { margin-top: 0.125rem; }

/* lg: prefix support for detail page */
@media (min-width: 1024px) {
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Extra small button */
.btn--xs {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    height: 28px;
    border-radius: var(--radius-sm);
}
.btn--danger-text { color: var(--color-danger); }
.btn--danger-text:hover { color: var(--color-danger); background: rgba(248,113,113,0.08); }
.btn--success-text { color: var(--color-success); }
.btn--success-text:hover { color: var(--color-success); background: rgba(74,222,128,0.08); }

/* ──────────────────────────────
   Product grid (portal dashboard)
   ────────────────────────────── */
.product-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0,1fr));
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }

.product-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    color: var(--color-fg-primary);
    text-decoration: none;
    transition: transform var(--dur-mid) var(--ease-out),
                border-color var(--dur-mid) var(--ease-out),
                box-shadow var(--dur-mid) var(--ease-out),
                background var(--dur-mid) var(--ease-out);
}
.product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56,189,248,0.3);
    background: var(--color-bg-raised);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.14), 0 20px 40px rgba(0,0,0,0.35);
}
.product-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.product-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-fg-primary);
    margin: 0;
    letter-spacing: var(--ls-tight);
}
.product-card__body {
    font-size: var(--fs-sm);
    color: var(--color-fg-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    flex: 1;
}
.product-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-accent);
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-top: auto;
    transition: gap var(--dur-mid) var(--ease-out);
}
.product-card__cta svg { width: 14px; height: 14px; }
.product-card:hover .product-card__cta { gap: 0.6rem; }
.error-hero__actions { margin-top: 1.5rem; display: inline-flex; gap: 0.5rem; }

/* ──────────────────────────────
   Release-artifact uploader
   ────────────────────────────── */
.uploader {
    width: 100%;
    min-width: 280px;
    max-width: 520px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.uploader:focus-within { border-color: var(--color-border-focus); box-shadow: var(--shadow-focus); }

/* All state slots hidden by default; current state's slot is shown via [data-state] selector. */
.uploader__zone,
.uploader__preview,
.uploader__progress,
.uploader__success,
.uploader__error { display: none; }

.uploader[data-state="idle"]      .uploader__zone     { display: flex; }
.uploader[data-state="selected"]  .uploader__preview  { display: flex; }
.uploader[data-state="uploading"] .uploader__progress { display: flex; }
.uploader[data-state="success"]   .uploader__success  { display: flex; }
.uploader[data-state="error"]     .uploader__error    { display: flex; }

/* IDLE */
.uploader__zone {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 1.5px dashed var(--color-border-default);
    border-radius: var(--radius-sm);
    background: var(--color-bg-inset);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.uploader__zone:hover { border-color: var(--color-border-strong); background: var(--color-bg-raised); }
.uploader__zone--dragover { border-style: solid; border-color: var(--color-accent); background: var(--color-accent-bg); }
.uploader__zone-icon { color: var(--color-fg-tertiary); }
.uploader__zone--dragover .uploader__zone-icon { color: var(--color-accent); }
.uploader__zone-label { margin: 0; font-size: var(--fs-sm); color: var(--color-fg-secondary); }
.uploader__zone-or { color: var(--color-fg-tertiary); margin-left: 0.25rem; }
.uploader__zone-hint { margin: 0; font-size: var(--fs-xs); color: var(--color-fg-muted); font-family: var(--font-mono); }
.uploader__browse {
    background: none;
    border: 0;
    padding: 0;
    color: var(--color-accent);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
.uploader__browse:hover { text-decoration: underline; }

/* SELECTED */
.uploader__preview { align-items: center; gap: 0.75rem; }
.uploader__file-icon { color: var(--color-fg-tertiary); flex: none; }
.uploader__file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.uploader__file-name {
    font-size: var(--fs-sm);
    color: var(--color-fg-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uploader__file-size { font-size: var(--fs-xs); color: var(--color-fg-tertiary); font-family: var(--font-mono); }
.uploader__preview-actions { display: inline-flex; gap: 0.375rem; flex: none; }

/* UPLOADING */
.uploader__progress { flex-direction: column; gap: 0.5rem; }
.uploader__progress-head, .uploader__progress-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.uploader__progress-pct {
    font-size: var(--fs-xs);
    font-family: var(--font-mono);
    color: var(--color-accent);
    flex: none;
}
.uploader__bar {
    height: 6px;
    background: var(--color-bg-raised);
    border-radius: var(--radius-pill);
    overflow: hidden;
    width: 100%;
}
.uploader__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
    border-radius: var(--radius-pill);
    transition: width 120ms linear;
}
.uploader__stats {
    font-size: var(--fs-xs);
    color: var(--color-fg-tertiary);
    font-family: var(--font-mono);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SUCCESS */
.uploader__success {
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    color: var(--color-success);
    font-size: var(--fs-sm);
    font-weight: 500;
    animation: uploader-pop var(--dur-slow) var(--ease-out) both;
}
.uploader__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--color-success-bg);
}
@keyframes uploader-pop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: none; }
}

/* ERROR */
.uploader__error {
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.5rem;
    border: 1px solid var(--color-danger-bg);
    background: var(--color-danger-bg);
    border-radius: var(--radius-sm);
}
.uploader__error-icon {
    color: var(--color-danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    flex: none;
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.15);
}
.uploader__error-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.uploader__error-title { font-size: var(--fs-sm); color: var(--color-fg-primary); font-weight: 500; }
.uploader__error-message { font-size: var(--fs-xs); color: var(--color-fg-secondary); }
