/* =====================================================================
   Renewal Clock — dashboard view styling.
   Ported from Renewal-Clock-mockup.html. EVERY selector is scoped under
   #renewalClockView, classes are rc-*, and vars are --rc-* declared on the
   view root (never :root) so nothing leaks into the shared dashboard.
   Colours: internal = orange, external/customer = blue, partner = light blue.
   ===================================================================== */

#renewalClockView {
    /* Blended onto the dashboard's warm light theme tokens (styles.css :root). */
    --rc-ground: var(--bg-base);
    --rc-panel: var(--bg-surface);
    --rc-panel-2: var(--bg-hover);
    --rc-ink: var(--text-primary);
    --rc-ink-2: var(--text-secondary);
    --rc-ink-3: var(--text-muted);
    --rc-rule: var(--border);
    --rc-rule-2: var(--border-strong);
    --rc-ext: #2a6fd0;     /* external / customer */
    --rc-ext-2: #6ba3e8;   /* partner / reseller */
    --rc-ext-soft: #e9f0fc;
    --rc-int: #d0561d;     /* internal / us */
    --rc-int-soft: #fcece3;
    /* our-side owners (the "waiting on us" breakdown) — cohesive w/ Legal Desk palette */
    --rc-i-fionn: #1D4E5F; /* Fionn / AI Renewals (us)  — accent teal */
    --rc-i-renew: #3E7C8C; /* (legacy alias, maps to Fionn) */
    --rc-i-legal: #A05610; /* Central Legal — amber */
    --rc-i-bu:    #7A5CA5; /* Business Unit — muted purple */
    --rc-i-fin:   #2A6E4B; /* Central Finance — green */
    --rc-shadow: none;     /* dashboard design system: no shadows */
    color: var(--rc-ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}

#renewalClockView * { box-sizing: border-box; }

#renewalClockView .rc-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ---------- header ---------- */
#renewalClockView .rc-head { padding: 4px 0 20px; border-bottom: 2px solid var(--rc-ink); margin-bottom: 24px; }
#renewalClockView .rc-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--rc-ink-3); margin: 0 0 8px;
}
#renewalClockView .rc-h1 { font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; margin: 0; }
#renewalClockView .rc-sub { margin: 10px 0 0; max-width: 70ch; color: var(--rc-ink-2); }

/* ---------- KPI strip ---------- */
#renewalClockView .rc-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px; background: var(--rc-rule); border: 1px solid var(--rc-rule);
    border-radius: 8px; overflow: hidden; margin-bottom: 28px;
}
#renewalClockView .rc-stat { background: var(--rc-panel); padding: 18px 20px 20px; }
#renewalClockView .rc-stat .rc-k {
    font-family: var(--font-mono);
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--rc-ink-3); margin: 0 0 10px;
}
#renewalClockView .rc-stat .rc-v {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
    font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -.025em; margin: 0;
}
#renewalClockView .rc-stat .rc-v small { font-size: 13px; font-weight: 500; color: var(--rc-ink-3); margin-left: 5px; letter-spacing: 0; }
#renewalClockView .rc-stat .rc-n { margin: 10px 0 0; font-size: 12px; color: var(--rc-ink-2); line-height: 1.5; max-width: 30ch; }
#renewalClockView .rc-v.rc-int { color: var(--rc-int); }
#renewalClockView .rc-v.rc-ext { color: var(--rc-ext); }

/* ---------- breakdown columns ---------- */
#renewalClockView .rc-bd-h { font-size: 14px; margin: 0 0 4px; font-weight: 600; }
#renewalClockView .rc-bd-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--rc-ink-3); }

/* ---------- gantt axis + day-grid + tooltip + table ---------- */
#renewalClockView .rc-scroller { overflow-x: auto; padding-bottom: 8px; }
#renewalClockView .rc-chart { min-width: 720px; --rc-lane-w: 150px; }
#renewalClockView .rc-axis {
    display: flex; position: relative; height: 20px; margin-left: var(--rc-lane-w);
    border-bottom: 1px solid var(--rc-rule-2);
}
#renewalClockView .rc-tick {
    position: absolute; bottom: 0; transform: translateX(-50%);
    font-size: 10.5px; color: var(--rc-ink-3);
    font-family: var(--font-mono); white-space: nowrap;
}
#renewalClockView .rc-tick::after {
    content: ""; position: absolute; left: 50%; bottom: -5px; width: 1px; height: 5px; background: var(--rc-rule-2);
}
#renewalClockView .rc-lanes { margin-top: 10px; }
#renewalClockView .rc-track::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 3px;
    background: repeating-linear-gradient(to right, transparent 0, transparent calc(12.5% - 1px), var(--rc-rule) calc(12.5% - 1px), var(--rc-rule) 12.5%);
}
#renewalClockView .rc-seg { cursor: pointer; padding: 0; transition: filter .12s ease; }
#renewalClockView .rc-seg:hover, #renewalClockView .rc-seg:focus-visible { filter: brightness(1.1); outline: none; }
#renewalClockView .rc-seg:focus-visible { box-shadow: 0 0 0 2px var(--rc-panel), 0 0 0 4px var(--rc-ink); }

.rc-tip {
    position: fixed; z-index: 3000; max-width: 270px; padding: 11px 13px; border-radius: 7px;
    background: var(--bg-surface); border: 1px solid var(--border-strong); box-shadow: none;
    font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); pointer-events: none;
    font-family: var(--font);
}
.rc-tip .rc-tip-t { font-weight: 600; color: var(--text-primary); font-size: 13px; margin-bottom: 3px; }
.rc-tip .rc-tip-d { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 6px; }

#renewalClockView .rc-tblbtn {
    appearance: none; background: transparent; border: 1px solid var(--rc-rule-2); color: var(--rc-ink-2);
    border-radius: 6px; padding: 7px 13px; font: inherit; font-size: 12.5px; cursor: pointer; margin-top: 18px;
}
#renewalClockView .rc-tblbtn:hover { border-color: var(--rc-ink-3); color: var(--rc-ink); }
#renewalClockView .rc-tblwrap { overflow-x: auto; }
#renewalClockView table.rc-tbl { border-collapse: collapse; width: 100%; min-width: 460px; margin-top: 14px; font-size: 13px; }
#renewalClockView table.rc-tbl th, #renewalClockView table.rc-tbl td {
    text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--rc-rule); vertical-align: top;
}
#renewalClockView table.rc-tbl th {
    font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--rc-ink-3); font-weight: 500;
    font-family: var(--font-mono); white-space: nowrap;
}
#renewalClockView table.rc-tbl td.rc-d {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--rc-ink-2); white-space: nowrap;
}

/* ---------- sections ---------- */
#renewalClockView .rc-section { margin-bottom: 36px; }
#renewalClockView .rc-h2 {
    font-size: 11.5px; font-family: var(--font-mono);
    letter-spacing: .13em; text-transform: uppercase; color: var(--rc-ink-3);
    font-weight: 500; margin: 0 0 14px;
}
#renewalClockView .rc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
#renewalClockView .rc-card { background: var(--rc-panel); border: 1px solid var(--rc-rule); border-radius: 8px; padding: 20px; }

/* ---------- breakdown bars ---------- */
#renewalClockView .rc-rows { display: flex; flex-direction: column; gap: 14px; }
#renewalClockView .rc-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; }
#renewalClockView .rc-row .rc-nm { font-size: 13.5px; }
#renewalClockView .rc-row .rc-dy {
    font-family: var(--font-mono); font-size: 12.5px;
    color: var(--rc-ink-2); font-variant-numeric: tabular-nums;
}
#renewalClockView .rc-bar { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--rc-panel-2); overflow: hidden; }
#renewalClockView .rc-bar i { display: block; height: 100%; border-radius: 99px; }
#renewalClockView .rc-bar i.rc-e { background: var(--rc-ext); }
#renewalClockView .rc-bar i.rc-p { background: var(--rc-ext-2); }
#renewalClockView .rc-bar i.rc-i { background: var(--rc-int); }

/* ---------- charts ---------- */
#renewalClockView .rc-chart-wrap { position: relative; height: 240px; }

/* ---------- gantt timeline ---------- */
#renewalClockView .rc-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-bottom: 18px; }
#renewalClockView .rc-lg { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rc-ink-2); }
#renewalClockView .rc-sw { width: 22px; height: 10px; border-radius: 2px; flex: none; }
#renewalClockView .rc-sw.rc-e { background: var(--rc-ext); }
#renewalClockView .rc-sw.rc-p { background: var(--rc-ext-2); }
#renewalClockView .rc-sw.rc-i { background: var(--rc-int); }
#renewalClockView .rc-sw.rc-i-fionn { background: var(--rc-i-fionn); }
#renewalClockView .rc-sw.rc-i-renew { background: var(--rc-i-renew); }
#renewalClockView .rc-sw.rc-i-legal { background: var(--rc-i-legal); }
#renewalClockView .rc-sw.rc-i-bu    { background: var(--rc-i-bu); }
#renewalClockView .rc-sw.rc-i-fin   { background: var(--rc-i-fin); }

#renewalClockView .rc-lanes { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
#renewalClockView .rc-lane { display: flex; align-items: center; }
#renewalClockView .rc-lane-label {
    width: 150px; flex: none; padding-right: 16px; text-align: right;
    font-size: 12.5px; font-weight: 500; line-height: 1.3;
}
#renewalClockView .rc-lane-label span {
    display: block; font-size: 10.5px; color: var(--rc-ink-3); font-weight: 400;
    font-family: var(--font-mono); letter-spacing: .04em;
}
#renewalClockView .rc-track { position: relative; flex: 1; height: 30px; border-radius: 3px; background: var(--rc-panel-2); }
#renewalClockView .rc-seg {
    position: absolute; top: 3px; bottom: 3px; border-radius: 4px; border: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px var(--rc-panel);
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    color: #fff; overflow: hidden;
}
#renewalClockView .rc-seg.rc-e { background: var(--rc-ext); }
#renewalClockView .rc-seg.rc-p { background: var(--rc-ext-2); }
#renewalClockView .rc-seg.rc-i { background: var(--rc-int); }
#renewalClockView .rc-seg.rc-i-fionn { background: var(--rc-i-fionn); }
#renewalClockView .rc-seg.rc-i-renew { background: var(--rc-i-renew); }
#renewalClockView .rc-seg.rc-i-legal { background: var(--rc-i-legal); }
#renewalClockView .rc-seg.rc-i-bu    { background: var(--rc-i-bu); }
#renewalClockView .rc-seg.rc-i-fin   { background: var(--rc-i-fin); }
#renewalClockView .rc-seg.rc-open { opacity: .78; outline: 2px dashed rgba(255, 255, 255, .6); outline-offset: -4px; }

/* "waiting on us" rollup bars — reuse the horizontal .rc-bar i fill pattern */
#renewalClockView .rc-bar i.rc-i-fionn { background: var(--rc-i-fionn); }
#renewalClockView .rc-bar i.rc-i-renew { background: var(--rc-i-renew); }
#renewalClockView .rc-bar i.rc-i-legal { background: var(--rc-i-legal); }
#renewalClockView .rc-bar i.rc-i-bu    { background: var(--rc-i-bu); }
#renewalClockView .rc-bar i.rc-i-fin   { background: var(--rc-i-fin); }
#renewalClockView .rc-usnow { gap: 10px; }
#renewalClockView .rc-row.rc-row-who { font-weight: 600; margin-top: 4px; }
#renewalClockView .rc-row.rc-sub { margin-left: 18px; font-size: 12.5px; color: var(--rc-ink-2); }
#renewalClockView .rc-row-who .rc-nm { display: inline-flex; align-items: center; gap: 7px; }
#renewalClockView .rc-ct { color: var(--rc-ink-3); font-weight: 400; font-size: 11.5px; font-family: var(--font-mono); }

#renewalClockView .rc-note { margin: 18px 0 0; font-size: 13px; color: var(--rc-ink-3); max-width: 72ch; line-height: 1.55; }

/* ---------- current-step banner ---------- */
#renewalClockView .rc-current {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 14px 18px; border: 1px solid var(--rc-rule); border-radius: 8px;
    background: var(--rc-panel); margin-bottom: 22px;
}
#renewalClockView .rc-current .rc-txt { font-weight: 600; }
#renewalClockView .rc-current .rc-meta { color: var(--rc-ink-3); font-size: 12.5px; }

/* ---------- pills (also used in the main table cell) ---------- */
.rc-pill {
    display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600;
    font-family: var(--font-mono); letter-spacing: .02em; vertical-align: 1px;
    white-space: nowrap;
}
.rc-pill.rc-i { background: #fcece3; color: #d0561d; }
.rc-pill.rc-e { background: #e9f0fc; color: #2a6fd0; }
.rc-pill.rc-p { background: #eef4fc; color: #3f78c2; }
.rc-pill.rc-i-fionn { background: #e4edef; color: #1D4E5F; }
.rc-pill.rc-i-renew { background: #e7f0f2; color: #35707f; }
.rc-pill.rc-i-legal { background: #f6ebdd; color: #8a4a0e; }
.rc-pill.rc-i-bu    { background: #efe9f5; color: #6a4d93; }
.rc-pill.rc-i-fin   { background: #e3efe8; color: #236041; }
.rc-pill.rc-cat { background: var(--rc-panel-2); color: var(--rc-ink-2); }
.rc-pill.rc-overdue { background: var(--danger-bg); color: var(--danger); }
.rc-pill.rc-alert { background: var(--warning-bg); color: var(--warning); }

/* ---------- picker ---------- */
#renewalClockView .rc-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
#renewalClockView .rc-picker select, #renewalClockView .rc-picker input {
    padding: 6px 10px; font-size: 13px; border: 1px solid var(--rc-rule-2); border-radius: 6px; background: var(--rc-panel);
}
#renewalClockView .rc-empty { color: var(--rc-ink-3); padding: 24px; text-align: center; }

/* ---------- main-table Next-step cell (namespaced by class, not view) ---------- */
.next-step-cell { min-width: 150px; max-width: 280px; font-size: 12px; line-height: 1.35; }
.next-step-cell .rc-cell-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-primary, #14140f); }
.next-step-cell .rc-cell-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
.next-step-cell .rc-age { font-size: 10px; color: var(--text-muted, #8a8780); font-family: var(--font-mono); }
.next-step-cell .rc-edit-btn {
    background: transparent; border: none; color: var(--rc-ext, #2a6fd0); cursor: pointer;
    font-size: 11px; padding: 0; text-decoration: underline;
}
.next-step-editor { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.next-step-editor .rc-ed-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.next-step-editor select, .next-step-editor input {
    font-size: 11px; padding: 2px 4px; border: 1px solid var(--border, #cdc9bf); border-radius: 3px;
}
.next-step-editor input.rc-ed-text { flex: 1 1 100%; }
.next-step-editor .rc-ed-save {
    padding: 2px 8px; font-size: 11px; background: var(--accent); color: #fff; border: none; border-radius: 3px; cursor: pointer;
}
.next-step-editor .rc-ed-cancel { padding: 2px 8px; font-size: 11px; background: transparent; border: 1px solid var(--border, #cdc9bf); border-radius: 3px; cursor: pointer; }

/* ---------- "Where we are" status column (main dashboard table) ---------- */
.status-cell { vertical-align: top; max-width: 260px; }
.status-cell .status-bullets { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.status-cell .status-bullet { display: flex; align-items: baseline; gap: 5px; font-size: 11.5px; color: var(--text-primary); white-space: normal; }
.status-cell .status-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; }
.status-cell .status-changed { display: inline-block; margin-top: 2px; font-size: 10px; color: var(--text-muted); cursor: default; }
