/*
 * Discount workflow — shared by the approval queue, billing activation, discount sales analysis
 * and the store's own request page.
 *
 * Colours are explicit rather than tokens: the shared layout emits its own :root after page
 * styles, so a page-level token override loses. Keeping this file token-free makes the same
 * rules render identically on every page that includes it.
 */

/* Pending-count badge on a navbar link */
.nav-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #F58220;
    color: #fff;
    font-size: .64rem;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    vertical-align: middle;
}

/* ── Five-step progress indicator ───────────────────────────────────────── */

.dw-steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
}

.dw-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .2px;
}

.dw-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #334155;
    font-size: .72rem;
    font-weight: 800;
}

.dw-step.done { background: #ecfdf5; color: #065f46; }
.dw-step.done .dw-step-num { background: #059669; color: #fff; }

.dw-step.current { background: #fff7ed; color: #9a3412; box-shadow: inset 0 0 0 1px #F58220; }
.dw-step.current .dw-step-num { background: #F58220; color: #fff; }

.dw-step.rejected { background: #fef2f2; color: #991b1b; }
.dw-step.rejected .dw-step-num { background: #dc2626; color: #fff; }

/* ── Cross-links between the workflow's pages ───────────────────────────── */

.dw-workflow-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}

.dw-workflow-label {
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #64748b;
}

.dw-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(11, 47, 94, .18);
    border-radius: 999px;
    background: #fff;
    color: #0B2F5E;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
}
.dw-link:hover { background: #eef2f7; }

/* ── Request cards, tables and badges (store page + hand-off panels) ────── */

.dw-card {
    margin-bottom: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(11, 47, 94, .14);
    border-radius: 14px;
}

.dw-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(11, 47, 94, .1);
}

.dw-card-title { font-weight: 700; color: #0B2F5E; font-size: .95rem; }
.dw-card-sub { font-size: .75rem; color: #64748b; }
.dw-card-body { padding: 16px 18px; }

.dw-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.dw-table thead th {
    padding: 8px 10px;
    background: #0B2F5E;
    color: #fff;
    font-size: .68rem;
    letter-spacing: .5px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.dw-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(11, 47, 94, .08);
    vertical-align: top;
}
.dw-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dw-table a { color: #0B2F5E; font-weight: 700; text-decoration: none; }
.dw-table a:hover { text-decoration: underline; }

.dw-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
}
.dw-badge.pend { background: #fef3c7; color: #92400e; }
.dw-badge.ok { background: #d1fae5; color: #065f46; }
.dw-badge.rej { background: #fee2e2; color: #991b1b; }
.dw-badge.info { background: #dbeafe; color: #1e40af; }
.dw-badge.ghost { background: #eef2f7; color: #475569; }

.dw-alert {
    margin-bottom: 16px;
    padding: 11px 15px;
    border-radius: 10px;
    font-size: .84rem;
}
.dw-alert.ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.dw-alert.warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.dw-alert.err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.dw-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dw-kv .k { font-size: .68rem; font-weight: 700; letter-spacing: .5px; color: #64748b; text-transform: uppercase; }
.dw-kv .v { font-size: .9rem; font-weight: 600; color: #0B2F5E; }

.dw-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.dw-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border: none;
    border-radius: 9px;
    background: #0B2F5E;
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.dw-btn.orange { background: #F58220; }
.dw-btn.ghost { background: transparent; border: 1px solid rgba(11, 47, 94, .2); color: #0B2F5E; }
.dw-btn:hover { opacity: .92; }

.dw-empty { padding: 30px 18px; text-align: center; color: #64748b; font-size: .88rem; }
.dw-note { font-size: .78rem; line-height: 1.5; color: #475569; }
.dw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dw-attach { font-size: .8rem; padding: 3px 0; }

/* ── Verification call overlay ──────────────────────────────────────────── */

.dc-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 22, 41, .72);
}

.dc-call {
    width: min(1100px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.dc-call-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(11, 47, 94, .1);
}

.dc-call-title { font-weight: 800; color: #0B2F5E; font-size: .95rem; }

.dc-call-body {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 2fr;
    gap: 12px;
    padding: 14px 18px;
}

.dc-local-wrap, .dc-remote-wrap {
    position: relative;
    background: #0B2F5E;
    border-radius: 12px;
    overflow: hidden;
}

.dc-local-video, .dc-remote-video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}

.dc-local-video { transform: scaleX(-1); }   /* self-view mirror; remote feeds are not mirrored */
.dc-local-video.dc-local-rear { transform: none; }   /* back camera: mirroring would flip the room */

.dc-remote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.dc-remote-label {
    position: absolute;
    left: 8px;
    bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: .72rem;
}

.dc-call-foot { display: flex; align-items: center; gap: 10px; padding: 0 18px 14px; flex-wrap: wrap; }

/* In-person capture: no remote participants, so the local camera takes the call area. */
.dc-overlay.dc-capture-mode #dcRemoteGrid { display: none; }
.dc-overlay.dc-capture-mode .dc-call-body { grid-template-columns: 1fr; }
.dc-overlay.dc-capture-mode .dc-local-wrap { max-width: 680px; width: 100%; margin: 0 auto; }

/* The overlay renders on pages that do not carry the approval page's local .btn/.note rules
   (the store's own request page), so give its controls a self-contained baseline. */
.dc-call .note { font-size: .78rem; color: #475569; }
.dc-call .btn-ghost {
    background: transparent;
    border: 1px solid rgba(11, 47, 94, .2);
    color: #0B2F5E;
}
.dc-call .btn { border-radius: 9px; font-weight: 600; }

@media (max-width: 768px) {
    .dc-call-body { grid-template-columns: 1fr; }
    .dw-step { font-size: .68rem; }
}
