/* ---------------------------------------------------------
   detail.css — Machine Detail (Overview-Tab)
--------------------------------------------------------- */

/* Header der Detail-Seite */
.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}
.detail-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.detail-title .icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--text-mute);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-left: 3px solid var(--brand);
    padding-left: 6px;
}
.detail-title .status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ok);
    margin: 0 4px 0 -4px;
}
.detail-title .text h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.2px;
    color: var(--text);
}
.detail-title .text small {
    color: var(--text-mute);
    font-size: 12px;
}

.btn-actions {
    border: 1px solid var(--brand);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-actions:hover { background: #FFFBE6; }

/* Section-Kopf "Overview" mit Refresh/More */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px 12px;
}
.section-head h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.section-head .actions {
    display: flex;
    gap: 6px;
}
.section-head .actions .icon-btn-sq {
    width: 30px; height: 30px;
    border-radius: 6px;
    color: var(--text-mute);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
}
.section-head .actions .icon-btn-sq:hover { color: var(--text); }

/* Grid der Overview-Kacheln */
.overview-grid {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 1.2fr;
    gap: 14px;
    grid-auto-rows: min-content;
}
.overview-grid .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.overview-grid .card.span-machine { grid-row: span 3; }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.card-head .titles {
    display: flex;
    gap: 28px;
}
.card-head .titles .ct {
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 500;
}
.card-head .see-all {
    color: var(--text-soft);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.card-head .see-all:hover { color: var(--text); }

/* Kachel: zwei nebeneinanderliegende Werte (z. B. Communication / Last Heartbeat) */
.dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.dual .item .label {
    color: var(--text-soft);
    font-size: 12px;
    margin-bottom: 8px;
}
.dual .item .value {
    font-size: 22px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dual .item .sub {
    color: var(--text-mute);
    font-size: 11.5px;
    margin-top: 4px;
}
.value.offline { color: var(--danger); }
.value.offline::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
}
.value .pulse-ico { color: var(--ok); }

/* Stock-Karte */
.stock-card .stock-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.stock-card .pct-big {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
}
.stock-card .bag-ico {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: #FFF2E6;
    color: #F97316;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stock-card .progress {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}
.stock-card .progress > div {
    height: 100%;
    background: var(--ok);
    border-radius: 3px;
}
.empty-bins {
    display: flex;
    align-items: center;
    gap: 10px;
}
.empty-bins .arrow-ico {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: #FFE4E6;
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.empty-bins .n { font-size: 22px; font-weight: 700; }
.empty-bins .lbl { color: var(--text-mute); font-size: 11.5px; }

/* Last 24h Karte: $800 / $765 */
.kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}
.kpi .lbl { color: var(--text-soft); font-size: 12px; }
.kpi .val {
    font-size: 24px;
    font-weight: 700;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.kpi .val .delta { font-size: 12px; font-weight: 600; }
.delta.pos { color: var(--ok-deep); }
.delta.neg { color: var(--danger); }
.kpi .desc { color: var(--text-mute); font-size: 11.5px; margin-top: 4px; }

/* Last Transactions */
.last-tx {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.last-tx .tx {
    display: flex;
    align-items: center;
    gap: 10px;
}
.last-tx .tx .ico {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tx-cashless .ico { background: #ECFDF5; color: var(--ok-deep); }
.tx-cash .ico     { background: #EFF6FF; color: var(--info); }
.last-tx .tx .lbl { color: var(--text-mute); font-size: 11.5px; }
.last-tx .tx .val { font-size: 14px; font-weight: 600; }

/* Active Alerts */
.alerts-list .alert-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}
.alerts-list .alert-row:last-child { border-bottom: none; }
.alerts-list .lhs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.alerts-list .lhs .ico {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: #FEF2F2;
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.alerts-list .ttl { font-size: 13px; font-weight: 500; }
.alerts-list .sub { color: var(--text-mute); font-size: 11.5px; }
.alerts-list .amt { color: var(--danger); font-weight: 600; font-size: 13px; }

/* Tube Status */
.tube .row { display: flex; align-items: center; gap: 10px; }
.tube .ico {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: #FFF7E0;
    color: var(--brand-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tube .val { font-size: 18px; font-weight: 700; }
.tube .sub { color: var(--text-mute); font-size: 11.5px; }

/* Machine Info Karte */
.machine-info .image {
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #FFE066 0%, #FFCB05 100%);
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.machine-info .image::before {
    content: '🥤';
    font-size: 80px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.15));
}
.machine-info .image .nav-dot {
    position: absolute;
    top: 50%;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    cursor: pointer;
    transform: translateY(-50%);
}
.machine-info .image .nav-dot.left  { left: 8px; }
.machine-info .image .nav-dot.right { right: 8px; }

.machine-info .props {
    display: grid;
    grid-template-columns: 90px 1fr;
    row-gap: 10px;
    font-size: 12.5px;
}
.machine-info .props dt { color: var(--text-soft); }
.machine-info .props dd { color: var(--text); font-weight: 500; }
