/* Façade de machine : afficheur, pads, sérigraphie.

   La référence est un rack de studio, pas un tableau de bord d'analyse. D'où les partis pris :
   un seul grand nombre, des chiffres à chasse fixe qui ne dansent pas, du relief obtenu par des
   arêtes de lumière plutôt que par des bordures franches, et aucune couleur décorative — chaque
   teinte porte un état. */

.daw {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* ---- Bandeau transport ---------------------------------------------------- */

.daw-transport {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.1rem 1.35rem;
    border-radius: var(--sh-radius-aero);
    border: 1px solid var(--sh-glass-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
        rgba(8, 10, 14, 0.72);
    box-shadow:
        var(--sh-glass-specular),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        var(--sh-glass-depth);
}

/* ---- Diode d'état --------------------------------------------------------- */

.daw-led-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: none;
    min-width: 3.4rem;
}

.daw-led {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    /* Le creux sous la diode : c'est lui qui la fait lire comme sertie dans une façade. */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.daw-led-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.35);
}

.is-running .daw-led,
.is-overrun .daw-led {
    background: #ff4747;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 71, 71, 0.75);
    animation: daw-blink 2.4s ease-out infinite;
}

.is-running .daw-led-label,
.is-overrun .daw-led-label { color: #ff8b8b; }

.is-armed .daw-led {
    background: var(--sh-aqua);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 10px var(--sh-aqua-glow);
}

.is-armed .daw-led-label { color: var(--sh-aqua); }

@keyframes daw-blink {
    0%, 62% { opacity: 1; }
    80% { opacity: 0.35; }
    100% { opacity: 1; }
}

/* ---- Afficheur ------------------------------------------------------------ */

.daw-readout {
    display: flex;
    flex-direction: column;
    flex: none;
    /* Réserve la largeur du plus long affichage pour que la mise en page ne bouge pas
       quand le compteur passe de « 1h 04m » à « 59m 07s ». */
    min-width: 7.5rem;
}

.daw-readout-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    /* Chasse fixe : sans elle, chaque changement de chiffre décale la ligne entière. */
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.92);
}

.daw-readout-unit {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
}

.is-overrun .daw-readout-value { color: #ff8b8b; }
.is-idle .daw-readout-value { color: rgba(255, 255, 255, 0.28); }

/* ---- Identité de la session ----------------------------------------------- */

.daw-transport-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
    /* Séparateur gravé plutôt que bordure : une ligne sombre doublée d'une ligne claire. */
    padding-left: 1.25rem;
    border-left: 1px solid rgba(0, 0, 0, 0.55);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.daw-transport-title {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.daw-transport-sub {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Boutons -------------------------------------------------------------- */

.daw-btn {
    flex: none;
    padding: 0.55rem 1.15rem;
    border-radius: var(--sh-radius-aero-sm);
    border: 1px solid var(--sh-glass-border);
    background: var(--sh-glass-bg-raised);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--sh-glass-specular);
    transition: transform var(--sh-duration-aero) var(--sh-ease-liquid), background var(--sh-duration-aero);
}

/* L'action principale prend l'accent de l'espace : c'est le geste qu'on vient faire ici, et
   il doit être de la couleur du « ici ». */
.daw-btn--primary {
    border-color: var(--sh-accent-edge);
    background: var(--sh-accent-soft);
    color: var(--sh-accent);
}

.daw-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* L'enfoncement au clic : le seul geste qui rappelle vraiment une façade physique. */
.daw-btn:active { transform: translateY(1px); }

/* ---- Rangée de pads -------------------------------------------------------- */

.daw-rack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.7rem;
}

.daw-pad {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
    border-radius: var(--sh-radius-aero-sm);
    border: 1px solid var(--sh-glass-border);
    background: var(--sh-glass-bg);
    color: rgba(255, 255, 255, 0.75);
    text-align: left;
    box-shadow: var(--sh-glass-specular), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    transition: transform var(--sh-duration-aero) var(--sh-ease-liquid), background var(--sh-duration-aero);
}

.daw-pad:hover { background: var(--sh-glass-bg-raised); }
.daw-pad:active { transform: translateY(1px); }

.daw-pad-count {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.92);
}

.daw-pad-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

/* Deux pads seulement se colorent, et seulement quand ils portent quelque chose à faire. */
.daw-pad--call {
    border-color: var(--sh-aqua-glow);
    background: var(--sh-aqua-soft);
}

.daw-pad--call .daw-pad-count { color: var(--sh-aqua); }

.daw-pad--cash {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.09);
}

.daw-pad--cash .daw-pad-count { color: var(--sh-green); }

/* ---- Sérigraphie ----------------------------------------------------------- */

.daw-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0 0.25rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.38);
}

.daw-tip i { margin-top: 0.15rem; flex: none; }

@media (max-width: 640px) {
    .daw-transport {
        flex-wrap: wrap;
        gap: 0.9rem;
    }

    .daw-transport-meta {
        order: 3;
        width: 100%;
        padding-left: 0;
        border-left: 0;
        box-shadow: none;
    }

    .daw-btn { order: 2; margin-left: auto; }
}

/* ---- Ce qui traîne (espace artiste) ---------------------------------------
   Une ligne par chose à régler, la plus coûteuse en premier. Le liseré de gauche
   porte l'urgence : c'est la seule couleur qui varie d'une ligne à l'autre, pour
   qu'un coup d'œil suffise à voir s'il y a du rouge. */

/* La liste des attentes a quitté les cockpits pour la file « À traiter » partagée
   (ActionQueue / ActionRow) : ses styles n'ont plus de balisage. */


@media (max-width: 560px) {
    .daw-pending-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .daw-pending-row .daw-btn,
    .daw-pending-wait { margin-left: auto; }
}
