/* ============================================================================
   Adlitea — Back-office opérateur (ops.adlitea.fr)
   ----------------------------------------------------------------------------
   Layer on top of ../shared-styles.css (Prestige tokens). No hex here: every
   colour comes from :root of shared-styles.css.
   Copy of the ops wireframe layer (wireframes/ops/ops-styles.css): keep in sync.

   Distinctive marks so the operator never mistakes ops for the firm app:
   - permanent charcoal "Exploitation" band at the very top (.ops-band) with the
     session reason and its expiry;
   - sidebar seal on charcoal with a gold "OPS" plate under the brand.
   ========================================================================= */

/* ---- Permanent band ------------------------------------------------------- */
.ops-band {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; gap: var(--space-sm);
    padding: 8px var(--margin);
    background: var(--ink-900);
    color: var(--cream);
    font-size: 13px;
}
.ops-band-label {
    font-size: 11px; font-weight: 700;
    letter-spacing: var(--label-caps-tracking); text-transform: uppercase;
    color: var(--gold);
    padding-right: var(--space-sm);
    border-right: 1px solid var(--ink-700);
}
.ops-band-env {
    font-size: 11px; font-weight: 700;
    letter-spacing: var(--label-caps-tracking); text-transform: uppercase;
    padding: 2px 8px;
    border: 1px solid var(--gold);
    color: var(--gold);
}
.ops-band-env.is-staging { border-color: var(--status-info); color: var(--status-info); }
.ops-band-reason { flex: 1; min-width: 0; color: var(--cream); opacity: 0.85;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-band-reason strong { opacity: 1; font-weight: 600; }
.ops-band-expiry { color: var(--cream); opacity: 0.7; white-space: nowrap; }
.ops-band a { color: var(--gold); border-bottom-color: transparent; white-space: nowrap; }
.ops-band a:hover { border-bottom-color: var(--gold); }

/* The page header sits under the band */
.ops .header { top: 37px; }

/* ---- Sidebar variant ------------------------------------------------------ */
.ops .sidebar .logo-text small {
    display: block;
    font-family: var(--font-sans);
    font-size: 10px; font-weight: 700;
    letter-spacing: var(--label-caps-tracking); text-transform: uppercase;
    color: var(--gold-deep-text);
    margin-top: 2px;
}
.ops .sidebar .user-avatar { background: var(--ink-900); color: var(--gold); }

/* ---- Small helpers -------------------------------------------------------- */
.ops-muted { color: var(--ink-500); font-size: 13px; }
.ops-mono { font-variant-numeric: tabular-nums; }
.ops-masked { letter-spacing: 0.02em; color: var(--ink-700); }
.ops-reveal {
    background: none; border: none; padding: 0 0 0 6px;
    color: var(--ink-500); font-size: 12px; text-decoration: underline;
    cursor: pointer;
}
.ops-reveal:hover { color: var(--ink-900); }

.ops-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gutter); align-items: start; }
.ops-grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }
.ops-stack > * + * { margin-top: var(--gutter); }

.ops-note {
    border-left: 3px solid var(--gold);
    background: var(--gold-soft);
    padding: 12px 16px;
    font-size: 13.5px; color: var(--ink-900);
}
.ops-note.is-danger { border-left-color: var(--bordeaux); background: var(--bordeaux-soft); }
.ops-note.is-info { border-left-color: var(--status-info); background: var(--status-info-soft); }

/* Status badges (subscription_status + access_request_status) */
.ops-status { display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; font-size: 11px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    border: 1px solid var(--ink-15); background: var(--white); color: var(--ink-700); white-space: nowrap; }
.ops-status.beta      { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-deep-text); }
.ops-status.active    { background: var(--status-success-soft); border-color: var(--status-success); color: var(--status-success-text); }
.ops-status.read-only { background: var(--status-warn-soft); border-color: var(--status-warn); color: var(--status-warn-text); }
.ops-status.closed    { background: var(--cream-dim); border-color: var(--ink-300); color: var(--ink-500); }
.ops-status.action    { background: var(--bordeaux-soft); border-color: var(--bordeaux); color: var(--bordeaux); }
.ops-status.info      { background: var(--status-info-soft); border-color: var(--status-info); color: var(--expertise-text); }

/* Signals (relance) */
.ops-signal { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--bordeaux); }
.ops-signal::before { content: ''; width: 8px; height: 8px; background: var(--bordeaux); }
.ops-signal.is-warn { color: var(--status-warn-text); }
.ops-signal.is-warn::before { background: var(--status-warn); }

/* Countdown J-n */
.ops-countdown { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.ops-countdown.is-urgent { color: var(--bordeaux); }

/* Toolbar above a table */
.ops-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
    flex-wrap: wrap; margin-bottom: var(--space-sm); }
.ops-toolbar .filters { flex: 1; }
.ops-count { font-size: 13px; color: var(--ink-500); }

/* Key/value list (fiche) */
.ops-kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px var(--space-sm); font-size: 14px; }
.ops-kv dt { font-size: 11px; font-weight: 700; letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase; color: var(--ink-500); padding-top: 2px; }
.ops-kv dd { color: var(--ink-900); }

/* Pipeline (status history / funnel) */
.ops-pipeline { display: flex; gap: 0; border: 1px solid var(--ink-15); background: var(--white); }
.ops-pipeline-step { flex: 1; padding: 14px 16px; border-right: 1px solid var(--ink-15); }
.ops-pipeline-step:last-child { border-right: none; }
.ops-pipeline-step .n { font-family: var(--font-serif); font-size: 28px; font-weight: 500; color: var(--ink-900); line-height: 1; }
.ops-pipeline-step .l { font-size: 11px; font-weight: 700; letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase; color: var(--ink-500); margin-top: 8px; }
.ops-pipeline-step.is-current { background: var(--gold-soft); box-shadow: inset 0 -2px 0 var(--gold); }
.ops-pipeline-step.is-done .l { color: var(--status-success-text); }

/* Timeline (history, journal) */
.ops-timeline { list-style: none; border-left: 1px solid var(--ink-15); margin-left: 6px; }
.ops-timeline li { position: relative; padding: 0 0 18px 20px; font-size: 14px; }
.ops-timeline li::before { content: ''; position: absolute; left: -5px; top: 6px;
    width: 9px; height: 9px; background: var(--ink-300); }
.ops-timeline li.is-gold::before { background: var(--gold); }
.ops-timeline li.is-bordeaux::before { background: var(--bordeaux); }
.ops-timeline .when { font-size: 12px; color: var(--ink-500); }
.ops-timeline .what { color: var(--ink-900); margin-top: 2px; }
.ops-timeline .who { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }

/* Calendar strip J0 → J+88 */
.ops-calendar { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--ink-15); background: var(--white); }
.ops-calendar > div { padding: 14px 16px; border-right: 1px solid var(--ink-15); }
.ops-calendar > div:last-child { border-right: none; }
.ops-calendar .d { font-family: var(--font-serif); font-size: 17px; color: var(--ink-900); }
.ops-calendar .k { font-size: 11px; font-weight: 700; letter-spacing: var(--label-caps-tracking);
    text-transform: uppercase; color: var(--ink-500); margin-bottom: 6px; }
.ops-calendar .t { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; }
.ops-calendar > .is-past { background: var(--cream-dim); }
.ops-calendar > .is-next { box-shadow: inset 0 -2px 0 var(--gold); }

/* Usage bar (storage vs quota) */
.ops-bar { height: 6px; background: var(--cream-dim); border: 1px solid var(--ink-15); margin-top: 6px; }
.ops-bar > span { display: block; height: 100%; background: var(--gold); }
.ops-bar.is-high > span { background: var(--bordeaux); }

/* Danger zone */
.ops-danger { border: 1px solid var(--bordeaux); background: var(--white); }
.ops-danger .card-header { border-bottom-color: var(--bordeaux); }
.ops-danger .card-title { color: var(--bordeaux); }
.btn-danger { background: var(--bordeaux); color: var(--cream); border: 1px solid var(--bordeaux); }
.btn-danger:hover { background: var(--bordeaux); color: var(--cream); border-color: var(--ink-900); }
.btn-danger[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Action list (fiche, right column) */
.ops-actions { display: flex; flex-direction: column; }
.ops-action { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm);
    padding: 14px var(--space-md); border-bottom: 1px solid var(--ink-15); }
.ops-action:last-child { border-bottom: none; }
.ops-action > div { min-width: 0; }
.ops-action .btn { flex-shrink: 0; }
.ops-action .t { font-weight: 600; color: var(--ink-900); font-size: 14px; }
.ops-action .d { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }

/* Dialogs: .confirm-* of shared-styles + required reason */
.ops-dialog { max-width: 540px; }
.ops-dialog [hidden] { display: none !important; }
.ops-dialog .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ops-dialog .confirm-icon.is-danger { background: var(--bordeaux-soft); border-color: var(--bordeaux); color: var(--bordeaux); }
.ops-dialog .confirm-message + .form-group { margin-top: var(--space-sm); }
.ops-dialog .confirm-body .form-group:last-child { margin-bottom: 0; }
.ops-dialog .ops-reason-hint { font-size: 12px; color: var(--ink-500); margin-top: 6px; }
.ops-dialog .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }

/* Section spacing inside page-content */
.ops-section { margin-top: var(--space-lg); }
.ops-section:first-child { margin-top: 0; }

/* Table cell helpers */
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr.status-muted td:first-child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--status-success); }
.data-table .row-actions { white-space: nowrap; text-align: right; }

@media (max-width: 1024px) {
    .ops-grid-2, .ops-grid-2-even { grid-template-columns: 1fr; }
    .ops-calendar { grid-template-columns: 1fr 1fr; }
    .ops-band-reason { display: none; }
}
