/* === CARD STYLING === */

.card {
    border: 1px solid #eadfd9;
    border-radius: 1.15rem;
    box-shadow: 0 16px 34px rgba(99, 25, 37, 0.06);
    background: linear-gradient(180deg, rgba(255, 253, 251, 0.96) 0%, rgba(255, 250, 247, 0.96) 100%);
}

.card-header {
    padding: 0.95rem 1.25rem;
    background: linear-gradient(180deg, rgba(255, 247, 243, 0.95) 0%, rgba(249, 242, 240, 0.92) 100%);
    border-bottom: 1px solid #ecdeda;
    color: var(--fontana-ink-900);
    font-weight: 700;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--fontana-ink-900);
}

.card-subtitle {
    margin-top: -0.375rem;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.custom-card {
    background: linear-gradient(180deg, rgba(255, 250, 247, 0.98) 0%, rgba(250, 244, 241, 0.98) 100%);
    border-color: #ecd9d2;
}

.app-surface-card {
    overflow: hidden;
}

.index-section .index-shell-card {
    border-radius: 1.35rem;
}

.compact-shell-card {
    border-radius: 1.1rem;
    box-shadow: 0 10px 24px rgba(99, 25, 37, 0.05);
}

.compact-shell-card > .card-body {
    padding: 0.95rem;
}

.compact-section-header {
    padding: 0.78rem 1rem;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.stats-pill {
    padding: 0.9rem 1rem;
    border: 1px solid #ebddd7;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 253, 251, 0.94) 0%, rgba(255, 247, 243, 0.88) 100%);
}

.stats-pill-accent {
    position: relative;
    border-color: color-mix(in srgb, var(--stats-pill-accent, #8f1d2c) 18%, #ebddd7);
    background:
        linear-gradient(180deg, rgba(255, 253, 251, 0.96) 0%, rgba(255, 247, 243, 0.88) 100%),
        linear-gradient(135deg, var(--stats-pill-accent-soft, rgba(143, 29, 44, 0.12)) 0%, rgba(255, 255, 255, 0) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.stats-pill-accent::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 0.7rem;
    bottom: 0.7rem;
    width: 0.22rem;
    border-radius: 999px;
    background: var(--stats-pill-accent, #8f1d2c);
}

.stats-strip-compact {
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.stats-strip-compact .stats-pill {
    padding: 0.7rem 0.8rem;
    border-radius: 0.9rem;
}

.stats-pill-label {
    margin: 0 0 0.15rem;
    padding-left: 0.7rem;
    color: var(--fontana-ink-900);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.25;
}

.stats-pill .card-title {
    margin-bottom: 0.3rem;
}

.stats-pill .card-subtitle {
    color: var(--fontana-ink-500) !important;
    padding-left: 0.7rem;
}

.stats-chart-wrap {
    width: min(100%, 28rem);
    margin: 0 auto;
    padding: 0.75rem 0 0.25rem;
    min-height: 14rem;
}

.stats-chart-wrap-compact {
    width: min(100%, 22rem);
    min-height: 12rem;
    padding-top: 0.25rem;
}

.stats-panel {
    display: grid;
    gap: 0.9rem;
}

.stats-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stats-panel-kicker {
    margin: 0 0 0.2rem;
    color: var(--fontana-wine-700);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stats-panel-title {
    margin: 0;
    color: var(--fontana-ink-900);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.stats-panel-total {
    display: grid;
    justify-items: end;
    gap: 0.08rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #eadfd9;
    border-radius: 0.95rem;
    background: linear-gradient(180deg, rgba(255, 253, 251, 0.96) 0%, rgba(255, 247, 243, 0.9) 100%);
}

.stats-panel-total span {
    color: var(--fontana-ink-500);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stats-panel-total strong {
    color: var(--fontana-wine-900);
    font-size: 1.35rem;
    line-height: 1;
}

.stats-panel-body {
    display: grid;
    grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: stretch;
}

.stats-list {
    display: grid;
    gap: 0.5rem;
    max-height: var(--stats-panel-viewport, 20rem);
    overflow-y: auto;
    padding-right: 0.3rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(143, 29, 44, 0.25) transparent;
}

.stats-list::-webkit-scrollbar {
    width: 0.45rem;
}

.stats-list::-webkit-scrollbar-thumb {
    background: rgba(143, 29, 44, 0.2);
    border-radius: 999px;
}

.stats-list::-webkit-scrollbar-track {
    background: transparent;
}

.stats-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.68rem 0.76rem;
    border-radius: 0.95rem;
}

.stats-list-copy {
    min-width: 0;
}

.stats-pill-meta {
    margin: 0.12rem 0 0;
    padding-left: 0.7rem;
    color: var(--fontana-ink-500);
    font-size: 0.74rem;
    line-height: 1.25;
}

.stats-pill-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.15rem;
    height: 2.15rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--stats-pill-accent, #8f1d2c) 14%, white);
    color: var(--fontana-ink-900);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stats-pill-accent, #8f1d2c) 16%, transparent);
}

.stats-chart-panel {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 0.9rem 0.65rem;
    border: 1px solid #eadfd9;
    border-radius: 1rem;
    min-height: var(--stats-panel-viewport, 20rem);
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.26), transparent 38%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.98) 0%, rgba(250, 246, 243, 0.95) 100%);
}

.stats-chart-label {
    margin: 0 0 0.45rem;
    color: var(--fontana-ink-500);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-chart-panel .stats-chart-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    flex: 1 1 auto;
}

.cup-form {
    display: grid;
    gap: 0.85rem;
}

.cup-form-compact {
    gap: 0.65rem;
}

.cup-form-panel {
    gap: 0.8rem;
}

.cup-uid-row {
    margin-bottom: 0.05rem;
}

.cup-live-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.62rem 0.8rem;
    border: 1px solid #eadcd6;
    border-radius: 0.95rem;
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.97) 0%, rgba(252, 246, 242, 0.92) 100%);
}

.cup-live-status + .cup-uid-row {
    margin-top: -0.18rem;
}

.cup-live-status-copy {
    min-width: 0;
}

.cup-live-status-label {
    margin: 0;
    color: var(--fontana-ink-900);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.cup-live-status-meta {
    margin: 0.12rem 0 0;
    color: var(--fontana-ink-500);
    font-size: 0.74rem;
    line-height: 1.25;
}

.cup-live-status-value-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.cup-live-status-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    height: 2.2rem;
    padding: 0 0.78rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--fontana-wine-700) 0%, var(--fontana-wine-600) 100%);
    color: #fffdfb;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(143, 29, 44, 0.16);
}

.cup-form-panel .form-control {
    min-height: 3.05rem;
    padding: 0.8rem 1rem;
    font-size: 0.98rem;
}

.cup-form .mb-3 {
    margin-bottom: 0 !important;
}

.cup-form-compact .form-label {
    margin-bottom: 0.4rem;
    font-size: 0.84rem;
}

.cup-form-compact .form-control {
    min-height: 2.65rem;
}

.cup-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cup-controls-stack {
    display: grid;
    gap: 0.7rem;
}

.cup-control-section {
    padding: 0.72rem 0.78rem 0.8rem;
    border: 1px solid #ebddd7;
    border-radius: 1rem;
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.96) 0%, rgba(255, 247, 243, 0.88) 100%);
}

.cup-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cup-section-label {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cup-button-grid {
    display: grid;
    gap: 0.45rem;
}

.cup-button-grid-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cup-button-grid-counts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cup-button-grid-quantities {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cup-empty-state {
    margin: 0;
    color: var(--fontana-ink-500);
    font-size: 0.84rem;
}

.cup-form-actions-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.tap-station-card {
    overflow: hidden;
    position: relative;
}

.tap-station-card-compact {
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
}

.tap-station-card-compact::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.28rem;
    background: linear-gradient(180deg, var(--tap-station-accent, var(--fontana-wine-700)) 0%, color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 72%, white) 100%);
    opacity: 0.8;
}

.tap-station-card > .card-header.bg-primary {
    background: linear-gradient(135deg, var(--fontana-wine-700) 0%, var(--fontana-wine-600) 100%) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.tap-station-card-header-compact {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
    line-height: 1.2;
}

.tap-station-header-copy {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1 1 auto;
}

.tap-station-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    background: var(--tap-station-accent, var(--fontana-wine-700));
    color: #fffdfb;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 4px 10px color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 28%, transparent);
    font-weight: 700;
}

.tap-station-drink {
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tap-station-wifi-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    margin-left: auto;
    min-height: 1.9rem;
    padding: 0.22rem 0.58rem 0.22rem 0.46rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #fffdfa;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 8px 16px rgba(73, 11, 21, 0.18);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tap-station-wifi-badge::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
    flex: 0 0 auto;
}

.tap-station-wifi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
}

.tap-station-wifi-icon svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

.tap-station-wifi-value {
    min-width: 2.1ch;
    line-height: 1;
    text-align: right;
}

.tap-station-wifi-badge.is-pending {
    color: rgba(255, 255, 255, 0.82);
}

.tap-station-wifi-badge.is-pending::before {
    background: rgba(255, 255, 255, 0.34);
}

.tap-station-wifi-badge.is-strong {
    box-shadow:
        inset 0 0 0 1px rgba(220, 252, 231, 0.18),
        0 0 0 1px rgba(134, 239, 172, 0.14),
        0 8px 16px rgba(73, 11, 21, 0.18);
}

.tap-station-wifi-badge.is-strong::before {
    background: #86efac;
    box-shadow:
        0 0 0 1px rgba(220, 252, 231, 0.24),
        0 0 10px rgba(134, 239, 172, 0.38);
}

.tap-station-wifi-badge.is-medium {
    box-shadow:
        inset 0 0 0 1px rgba(254, 243, 199, 0.16),
        0 0 0 1px rgba(253, 230, 138, 0.14),
        0 8px 16px rgba(73, 11, 21, 0.18);
}

.tap-station-wifi-badge.is-medium::before {
    background: #fcd34d;
    box-shadow:
        0 0 0 1px rgba(254, 243, 199, 0.22),
        0 0 10px rgba(252, 211, 77, 0.32);
}

.tap-station-wifi-badge.is-weak,
.tap-station-wifi-badge.is-poor {
    box-shadow:
        inset 0 0 0 1px rgba(255, 237, 213, 0.16),
        0 0 0 1px rgba(253, 186, 116, 0.14),
        0 8px 16px rgba(73, 11, 21, 0.18);
}

.tap-station-wifi-badge.is-weak::before,
.tap-station-wifi-badge.is-poor::before {
    background: #fdba74;
    box-shadow:
        0 0 0 1px rgba(255, 237, 213, 0.22),
        0 0 10px rgba(253, 186, 116, 0.28);
}

.tap-station-wifi-badge.is-offline {
    box-shadow:
        inset 0 0 0 1px rgba(255, 228, 230, 0.16),
        0 0 0 1px rgba(253, 164, 175, 0.14),
        0 8px 16px rgba(73, 11, 21, 0.18);
}

.tap-station-wifi-badge.is-offline::before {
    background: #fda4af;
    box-shadow:
        0 0 0 1px rgba(255, 228, 230, 0.2),
        0 0 10px rgba(253, 164, 175, 0.28);
}

.tap-station-summary {
    display: grid;
    gap: 0.7rem;
    margin: 0.75rem 0.75rem 0;
    padding: 0.8rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--tap-station-accent, #8f1d2c) 14%, #ead8d2);
    border-radius: 0.95rem;
    background:
        radial-gradient(circle at top right, var(--tap-station-accent-soft, rgba(239, 215, 212, 0.2)), transparent 34%),
        linear-gradient(180deg, rgba(255, 252, 249, 0.96) 0%, rgba(250, 244, 241, 0.98) 100%);
}

.tap-station-summary-grid {
    display: grid;
    gap: 0.45rem;
}

.tap-station-summary-line {
    margin: 0;
    color: var(--fontana-ink-700);
    font-size: 0.84rem;
    line-height: 1.3;
}

.tap-station-summary-line.sod-v-uporabi,
.tap-station-summary-line.uid-value {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.tap-station-summary-line strong {
    display: block;
    margin-bottom: 0.08rem;
    color: var(--fontana-ink-500);
    font-size: 0.69rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tap-station-summary-line.sod-v-uporabi strong,
.tap-station-summary-line.uid-value strong {
    display: inline;
    margin-bottom: 0;
}

.sod-v-uporabi-value {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.52rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 14%, white);
    color: var(--tap-station-accent, var(--fontana-wine-700));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 18%, transparent);
    font-weight: 700;
}

.tap-station-status-card {
    border: 1px solid #ead8d2;
    box-shadow: none;
}

.tap-station-status-card-compact {
    margin: 0.75rem 0.75rem 0;
    border-radius: 0.9rem;
}

.tap-station-status-card-compact .card-body {
    padding: 0.8rem;
}

.tap-station-status-meta {
    display: grid;
    gap: 0.18rem;
    margin-bottom: 0.65rem;
}

.tap-station-status-meta .card-text {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.35;
}

.tap-station-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.tap-station-actions-inline .btn {
    min-height: 2.45rem;
}

.tap-station-kegs-body {
    display: grid;
    gap: 0.6rem;
    padding-top: 0.7rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 0.75rem;
    margin-top: auto;
}

.tap-station-kegs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tap-station-kegs-label {
    color: color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 48%, var(--fontana-ink-500));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sod-grid.sod-grid-single > .col {
    flex: 0 0 100%;
    width: 100%;
}

.sod-grid .col > .card,
.sod-option-card {
    height: 100%;
    border-color: rgba(143, 29, 44, 0.16);
    box-shadow: 0 10px 18px rgba(99, 25, 37, 0.06);
}

.sod-option-card {
    border-radius: 0.9rem;
}

@keyframes kegAlertPulse {
    0%, 100% {
        border-color: rgba(220, 38, 38, 0.92);
        box-shadow:
            0 0 0 1px rgba(220, 38, 38, 0.14),
            0 14px 26px rgba(185, 28, 28, 0.16);
        background:
            linear-gradient(180deg, rgba(255, 240, 240, 0.98) 0%, rgba(255, 227, 227, 0.94) 100%);
    }

    50% {
        border-color: rgba(248, 113, 113, 0.48);
        box-shadow:
            0 0 0 6px rgba(248, 113, 113, 0.14),
            0 18px 34px rgba(185, 28, 28, 0.26);
        background:
            linear-gradient(180deg, rgba(255, 251, 249, 0.98) 0%, rgba(255, 238, 235, 0.94) 100%);
    }
}

.sod-grid .col > .card.flashing-red,
.sod-option-card.flashing-red {
    animation: kegAlertPulse 1.2s ease-in-out infinite;
}

.sod-grid .col > .card.flashing-red .sod-status-badge-active,
.sod-option-card.flashing-red .sod-status-badge-active {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.18);
}

.sod-grid .col > .card.selected-sod {
    border: 2px solid var(--tap-station-accent, var(--fontana-wine-700));
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--tap-station-accent-soft, rgba(239, 215, 212, 0.2)) 92%, white) 0%, transparent 42%),
        linear-gradient(180deg, rgba(255, 251, 249, 0.98) 0%, color-mix(in srgb, var(--tap-station-accent-soft, rgba(239, 215, 212, 0.2)) 56%, rgba(250, 240, 236, 0.9)) 100%);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 20%, transparent),
        0 12px 24px rgba(99, 25, 37, 0.12);
}

.sod-grid .col > .card.selected-sod.flashing-red,
.sod-option-card.selected-sod.flashing-red {
    animation: kegAlertPulse 1.2s ease-in-out infinite;
    border-width: 3px;
}

.sod-grid .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding: 0.68rem;
    position: relative;
}

.sod-grid .card-text {
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.3;
}

.sod-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.sod-card-title {
    margin: 0;
    color: var(--fontana-ink-900);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sod-option-card .card-text:first-of-type {
    display: none;
}

.sod-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    position: static;
}

.sod-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sod-status-badge-active {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 14%, white) 0%,
        color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 10%, white) 100%);
    color: var(--tap-station-accent, var(--fontana-wine-700));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tap-station-accent, var(--fontana-wine-700)) 18%, transparent);
}

.sod-status-badge-placeholder {
    visibility: hidden;
}

.sod-grid .btn-custom {
    margin-bottom: 0;
    min-width: 0;
    padding: 0.44rem 0.52rem;
    font-size: 0.79rem;
    border-radius: 0.72rem;
    box-shadow: none;
}

.sod-meta {
    display: grid;
    gap: 0.18rem;
}

.sod-meta-line {
    margin: 0;
    color: var(--fontana-ink-700);
    font-size: 0.8rem;
    line-height: 1.3;
}

.sod-meta-line strong {
    color: var(--fontana-ink-900);
}

.sod-actions {
    display: grid;
    gap: 0.32rem;
    margin-top: 0.12rem;
}

.sod-action-wide {
    grid-column: 1 / -1;
}


.page-table-card {
    margin-top: 1.5rem;
    overflow: hidden;
    border: 1px solid #e8ddd8;
    border-radius: 1rem;
    box-shadow: 0 14px 32px rgba(99, 25, 37, 0.06);
    background: linear-gradient(180deg, rgba(255, 253, 251, 0.97) 0%, rgba(251, 248, 245, 0.96) 100%);
}

.page-header + .page-table-card,
.page-toolbar + .page-table-card {
    margin-top: 0;
}

.page-empty-card .card-body {
    padding: 1.6rem;
}

.page-empty-copy {
    display: grid;
    gap: 0.35rem;
    max-width: 34rem;
}

.page-empty-title {
    margin: 0;
    color: var(--fontana-ink-900);
    font-size: 1rem;
    font-weight: 700;
}

.page-empty-text {
    margin: 0;
    color: var(--fontana-ink-500);
    line-height: 1.5;
}

.page-table-card .table {
    margin-bottom: 0;
}

.page-table-card .table thead th {
    padding: 1rem 0.85rem;
    border-bottom-width: 1px;
    border-color: #eadfd9;
    background: #fff7f3;
    color: var(--fontana-ink-900);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.page-table-card .table thead th a {
    color: inherit;
    text-decoration: none;
}

.page-table-card .table thead th a:hover {
    color: var(--fontana-wine-700);
}

.page-table-card .table tbody td,
.page-table-card .table tfoot td {
    padding: 1rem 0.85rem;
    vertical-align: middle;
    border-color: #efe5df;
}

.page-table-card .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255, 251, 248, 0.75);
}

.page-table-card .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: rgba(248, 236, 232, 0.55);
}

.led-automation-shell {
    display: grid;
    gap: 1.2rem;
}

.led-automation-form {
    width: 100%;
    max-width: none;
}

.led-automation-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 0.1rem;
    padding: 1.1rem;
    border: 1px solid #ead8d2;
    border-radius: 1.1rem;
    background:
        radial-gradient(circle at top right, rgba(143, 29, 44, 0.12), transparent 38%),
        linear-gradient(180deg, rgba(255, 252, 249, 0.98) 0%, rgba(250, 244, 240, 0.96) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.led-automation-hero-copy {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.led-automation-kicker {
    margin: 0;
    color: var(--fontana-wine-700);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.led-automation-title {
    margin: 0;
    color: var(--fontana-ink-900);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.12;
}

.led-automation-meta {
    margin: 0;
    color: var(--fontana-ink-500);
    line-height: 1.5;
    max-width: 44rem;
}

.led-automation-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.85rem;
}

.led-hero-stat {
    display: grid;
    gap: 0.4rem;
    align-content: start;
    min-height: 10.25rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(143, 29, 44, 0.12);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 247, 243, 0.94) 100%);
    box-shadow: 0 12px 24px rgba(99, 25, 37, 0.08);
}

.led-hero-stat-accent {
    border-color: color-mix(in srgb, var(--fontana-wine-700) 20%, #ead8d2);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--fontana-wine-700) 14%, transparent) 0.25rem, transparent 0.25rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 246, 241, 0.96) 100%);
}

.led-hero-stat-label {
    margin: 0;
    color: var(--fontana-ink-500);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.led-hero-stat-value {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    width: fit-content;
    min-width: 4.3rem;
    min-height: 2.7rem;
    padding: 0.42rem 0.85rem 0.48rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fontana-wine-700) 12%, white);
    color: var(--fontana-ink-900);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fontana-wine-700) 14%, transparent);
    font-size: 1.05rem;
    font-weight: 800;
}

.led-hero-stat-meta {
    margin: 0;
    color: var(--fontana-ink-500);
    font-size: 0.82rem;
    line-height: 1.45;
}

.led-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.led-settings-panel {
    display: grid;
    gap: 0.85rem;
    height: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid #eadfd9;
    border-radius: 1rem;
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.14), transparent 36%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.98) 0%, rgba(250, 246, 243, 0.94) 100%);
}

.led-settings-switch {
    min-height: 2.6rem;
    padding-top: 0.15rem;
}

.led-settings-panel .control-label {
    margin-bottom: 0.2rem;
}

.led-settings-panel-text {
    margin: 0;
    color: var(--fontana-ink-500);
    line-height: 1.55;
}

.led-input-with-unit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
}

.led-input-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    min-height: 3.15rem;
    padding: 0 0.95rem;
    border: 1px solid #ead8d2;
    border-radius: 0.95rem;
    background: linear-gradient(180deg, rgba(255, 252, 249, 0.98) 0%, rgba(250, 244, 240, 0.96) 100%);
    color: var(--fontana-ink-900);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.led-cr-input-wrap {
    display: grid;
    gap: 0.4rem;
}

.led-cycle-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(15rem, 0.75fr);
    gap: 1rem;
    align-items: start;
}

.led-cycle-aside {
    display: grid;
    gap: 0.7rem;
    padding: 0.95rem 1rem;
    border: 1px solid #eadfd9;
    border-radius: 1rem;
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.98) 0%, rgba(250, 246, 243, 0.94) 100%);
}

.led-cycle-aside-title {
    margin: 0;
    color: var(--fontana-ink-900);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.led-cycle-aside-swatch,
.led-cycle-aside-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 800;
}

.led-cycle-aside-swatch {
    background: var(--led-chip-bg, #f3f4f6);
    color: var(--led-chip-fg, #1f2937);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.25),
        0 12px 22px rgba(99, 25, 37, 0.12);
}

.led-cycle-aside-empty {
    border: 1px dashed #d8c8c1;
    background: rgba(255, 255, 255, 0.65);
    color: var(--fontana-ink-500);
}

.led-cycle-aside-text {
    margin: 0;
    color: var(--fontana-ink-500);
    line-height: 1.5;
}

.led-section-divider {
    height: 1px;
    margin: 1rem 0;
    background: linear-gradient(90deg, rgba(234, 223, 217, 0.15) 0%, rgba(234, 223, 217, 0.9) 18%, rgba(234, 223, 217, 0.9) 82%, rgba(234, 223, 217, 0.15) 100%);
}

.led-section-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.led-section-title {
    color: var(--fontana-ink-900);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.led-section-caption {
    color: var(--fontana-ink-500);
    font-size: 0.76rem;
}

.led-color-picker-tools {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #eadfd9;
    border-radius: 0.95rem;
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.96) 0%, rgba(250, 246, 243, 0.94) 100%);
}

.led-color-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.led-color-picker-title {
    color: var(--fontana-ink-900);
    font-size: 0.82rem;
    font-weight: 700;
}

.led-color-picker-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fontana-wine-700) 12%, white);
    color: var(--fontana-wine-800);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fontana-wine-700) 16%, transparent);
    font-size: 0.8rem;
    font-weight: 700;
}

.led-color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.led-color-picker-input {
    width: 4.5rem;
    min-width: 4.5rem;
    height: 3rem;
    padding: 0.3rem;
    border-radius: 0.9rem;
    cursor: pointer;
}

.led-color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.led-color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 0.7rem;
}

.led-cycle-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.led-cycle-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 3rem;
    padding: 0.65rem 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: var(--led-chip-bg, #f3f4f6);
    color: var(--led-chip-fg, #1f2937);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.08),
        0 10px 18px rgba(99, 25, 37, 0.08);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.led-cycle-chip.active {
    border-color: color-mix(in srgb, var(--fontana-wine-700) 55%, white);
    box-shadow:
        0 0 0 0.22rem color-mix(in srgb, var(--fontana-wine-700) 14%, transparent),
        inset 0 0 0 1px rgba(255, 255, 255, 0.28),
        0 14px 26px rgba(99, 25, 37, 0.14);
    transform: translateY(-1px);
}

.led-cycle-chip-label {
    line-height: 1;
}

.led-cycle-chip-state {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.led-target-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.led-target-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.led-target-grid {
    margin-top: 0;
}

.led-target-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    height: 100%;
    padding: 0.82rem 0.95rem;
    border: 1px solid #eadfd9;
    border-radius: 0.95rem;
    background:
        radial-gradient(circle at top right, rgba(239, 215, 212, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 253, 251, 0.97) 0%, rgba(250, 246, 243, 0.95) 100%);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.led-target-option:hover {
    border-color: color-mix(in srgb, var(--fontana-wine-700) 20%, #eadfd9);
    box-shadow: 0 10px 18px rgba(99, 25, 37, 0.05);
    transform: translateY(-1px);
}

.led-target-checkbox {
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

.led-target-option-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.led-target-option-title {
    color: var(--fontana-ink-900);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.led-target-option-meta {
    color: var(--fontana-ink-500);
    font-size: 0.8rem;
    line-height: 1.25;
}

.led-target-option:has(.led-target-checkbox:checked) {
    border-color: color-mix(in srgb, var(--fontana-wine-700) 28%, #eadfd9);
    background:
        radial-gradient(circle at top right, rgba(143, 29, 44, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 251, 249, 0.98) 0%, rgba(250, 242, 239, 0.96) 100%);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--fontana-wine-700) 12%, transparent),
        0 12px 22px rgba(99, 25, 37, 0.08);
}

@media (max-width: 768px) {
    .stats-panel-header,
    .stats-panel-body {
        grid-template-columns: 1fr;
    }

    .stats-panel-total {
        justify-items: start;
    }

    .cup-form-actions {
        flex-direction: column;
    }

    .cup-live-status {
        align-items: flex-start;
    }

    .cup-live-status-value {
        min-width: 3rem;
        height: 2.2rem;
        padding: 0 0.75rem;
        font-size: 1rem;
    }

    .cup-button-grid-groups,
    .cup-button-grid-quantities {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cup-button-grid-counts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cup-form-actions-compact {
        grid-template-columns: 1fr;
    }

    .tap-station-actions,
    .sod-actions {
        grid-template-columns: 1fr;
    }

    .stats-chart-wrap {
        width: 100%;
    }

    .led-automation-hero-stats,
    .led-settings-grid,
    .led-cycle-layout {
        grid-template-columns: 1fr;
    }

    .led-color-picker-header,
    .led-color-picker-row {
        align-items: stretch;
        flex-direction: column;
    }

    .led-target-toolbar,
    .led-section-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .led-input-with-unit {
        grid-template-columns: 1fr;
    }

    .led-color-picker-value,
    .led-color-picker-input,
    .led-input-unit {
        width: 100%;
        min-width: 0;
    }
}
