/* Operations Directors Weekly Report */
:root {
    --q-blue: #0C1248;
    --q-orange: #F9583A;
    --q-red: #C00000;
    --q-amber: #F4B183;
    --q-green: #70AD47;
    --q-bg: #eef1f6;
    --q-card: #ffffff;
    --q-border: #d5dbe7;
    --q-muted: #5b6478;
}

.odr-app { display: none; min-height: 100vh; background: var(--q-bg); }
.odr-app.on { display: block; }

.odr-top {
    background: var(--q-blue);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.odr-top h1 { margin: 0; font-size: 1.1rem; color: #fff; letter-spacing: 0.02em; }
.odr-top .who { font-size: 0.82rem; color: #c7d0e0; }
.odr-top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.odr-wrap { max-width: 1180px; margin: 18px auto; padding: 0 14px 48px; }

.odr-toolbar {
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: end;
    margin-bottom: 14px;
}
.odr-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--q-muted);
}
.odr-toolbar input,
.odr-toolbar select {
    min-width: 150px;
    padding: 7px 9px;
    border: 1px solid var(--q-border);
    border-radius: 6px;
    font-size: 0.92rem;
    color: var(--q-blue);
    background: #fff;
}
.odr-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #e8edf7;
    color: var(--q-blue);
}
.odr-status.submitted { background: #dcfce7; color: #166534; }
.odr-status.draft { background: #fff7ed; color: #9a3412; }

.odr-btn {
    border: 1px solid var(--q-border);
    background: #fff;
    color: var(--q-blue);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 650;
    cursor: pointer;
}
.odr-btn:hover { border-color: #9aa6bf; }
.odr-btn-primary { background: var(--q-orange); border-color: var(--q-orange); color: #fff; }
.odr-btn-primary:hover { filter: brightness(1.05); }
.odr-btn-ghost { background: transparent; border-color: #64748b; color: #e2e8f0; }
.odr-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.odr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.odr-tab {
    border: 1px solid var(--q-border);
    background: #fff;
    color: var(--q-blue);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.odr-tab.active {
    background: var(--q-blue);
    border-color: var(--q-blue);
    color: #fff;
}

.odr-panel {
    display: none;
    background: var(--q-card);
    border: 1px solid var(--q-border);
    border-radius: 10px;
    padding: 16px;
}
.odr-panel.active { display: block; }

.odr-panel h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--q-blue);
}
.odr-panel .sub {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--q-muted);
}

.odr-tiles {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
@media (max-width: 900px) {
    .odr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.odr-tile {
    border-radius: 8px;
    padding: 12px 10px;
    color: #fff;
    background: var(--q-blue);
    min-height: 72px;
}
.odr-tile.red { background: var(--q-red); }
.odr-tile.amber { background: #d97706; }
.odr-tile.green { background: #3f7d1f; }
.odr-tile.orange { background: var(--q-orange); }
.odr-tile .n { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.odr-tile .l { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; opacity: 0.92; margin-top: 4px; }

.odr-kpi-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
@media (max-width: 800px) {
    .odr-kpi-tiles { grid-template-columns: 1fr; }
}
.odr-kpi-tile {
    border: 1px solid var(--q-border);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}
.odr-kpi-tile .v { font-size: 1.35rem; font-weight: 800; color: var(--q-orange); }
.odr-kpi-tile .l { font-size: 0.72rem; font-weight: 700; color: var(--q-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.03em; }

.odr-section-title {
    margin: 18px 0 8px;
    padding: 8px 10px;
    background: var(--q-blue);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.03em;
}

.odr-table-wrap { overflow-x: auto; }
table.odr {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
table.odr th {
    text-align: left;
    background: #f1f5f9;
    color: var(--q-blue);
    padding: 8px 7px;
    border-bottom: 1px solid var(--q-border);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
table.odr td {
    padding: 6px 5px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
    color: var(--q-blue);
}
table.odr input,
table.odr select,
table.odr textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d9e0ec;
    border-radius: 5px;
    padding: 5px 6px;
    font: inherit;
    color: var(--q-blue);
    background: #fff7f4;
}
table.odr textarea { min-height: 56px; resize: vertical; }
table.odr .num { width: 72px; }
table.odr tr.rag-Red { box-shadow: inset 3px 0 0 var(--q-red); }
table.odr tr.rag-Amber { box-shadow: inset 3px 0 0 #d97706; }
table.odr tr.rag-Green { box-shadow: inset 3px 0 0 var(--q-green); }

/* Project Health — full-width key issue cards (readable + printable) */
.odr-health-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.odr-health-card {
    background: #fff;
    border: 1px solid var(--q-border);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: inset 4px 0 0 #94a3b8;
}
.odr-health-card.rag-Red { box-shadow: inset 4px 0 0 var(--q-red); }
.odr-health-card.rag-Amber { box-shadow: inset 4px 0 0 #d97706; }
.odr-health-card.rag-Green { box-shadow: inset 4px 0 0 var(--q-green); }
.odr-health-metrics {
    display: grid;
    grid-template-columns: minmax(160px, 2fr) 90px repeat(2, 88px) 72px repeat(2, 96px);
    gap: 8px 10px;
    align-items: end;
}
.odr-health-metrics label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--q-muted);
}
.odr-health-metrics input,
.odr-health-metrics select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d9e0ec;
    border-radius: 5px;
    padding: 6px 7px;
    font-size: 0.9rem;
    color: var(--q-blue);
    background: #fff7f4;
}
.odr-health-metrics .num { max-width: 100%; }
.odr-health-var {
    display: block;
    min-height: 34px;
    padding: 7px 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--q-blue);
}
.odr-health-issue {
    display: block;
    margin-top: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--q-muted);
}
.odr-health-issue textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    min-height: 88px;
    box-sizing: border-box;
    border: 1px solid #d9e0ec;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--q-blue);
    background: #fff7f4;
    resize: vertical;
    overflow: hidden;
}
@media (max-width: 960px) {
    .odr-health-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.odr-textarea {
    width: 100%;
    min-height: 78px;
    border: 1px solid #d9e0ec;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    color: var(--q-blue);
    background: #fff7f4;
    box-sizing: border-box;
    resize: vertical;
}

.odr-exception-grid {
    display: grid;
    gap: 10px;
}
.odr-exception {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    align-items: start;
}
.odr-exception .tag {
    padding: 8px;
    border-radius: 6px;
    color: #fff;
    font-weight: 800;
    text-align: center;
    font-size: 0.78rem;
}
.odr-exception .tag.red { background: var(--q-red); }
.odr-exception .tag.amber { background: #d97706; }
.odr-exception .tag.green { background: #3f7d1f; }

.odr-msg {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: none;
}
.odr-msg.on { display: block; }
.odr-msg.ok { background: #dcfce7; color: #166534; }
.odr-msg.err { background: #ffe4e6; color: #9f1239; }
.odr-msg.info { background: #e0f2fe; color: #075985; }

.odr-footnote {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--q-muted);
}

@media print {
    .odr-top-actions .odr-btn,
    .hub-shell,
    .odr-tabs,
    #loginShell,
    #odrRefreshBtn,
    #odrSaveBtn,
    #odrSubmitBtn,
    #odrReopenBtn,
    #odrPrintBtn,
    #odrAddRiskBtn,
    .risk-del { display: none !important; }
    .odr-app { display: block !important; background: #fff; }
    .odr-wrap { max-width: none; margin: 0; padding: 0; }
    .odr-panel {
        display: block !important;
        border: none;
        padding: 0;
        margin-bottom: 16px;
        break-inside: auto;
        box-shadow: none;
    }
    .odr-toolbar { border: none; box-shadow: none; }
    .odr-health-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: inset 3px 0 0 #94a3b8;
        border: 1px solid #cbd5e1;
        margin: 0 0 10px;
        padding: 8px 10px;
    }
    .odr-health-card.rag-Red { box-shadow: inset 3px 0 0 var(--q-red); }
    .odr-health-card.rag-Amber { box-shadow: inset 3px 0 0 #d97706; }
    .odr-health-card.rag-Green { box-shadow: inset 3px 0 0 var(--q-green); }
    .odr-health-metrics {
        grid-template-columns: minmax(140px, 2fr) 70px repeat(2, 70px) 60px repeat(2, 80px);
        gap: 4px 8px;
    }
    .odr-health-issue textarea,
    table.odr textarea,
    .odr-textarea {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        overflow: visible !important;
        resize: none !important;
        white-space: pre-wrap !important;
        word-break: break-word;
        color: #0C1248 !important;
        font-size: 10pt !important;
        line-height: 1.35 !important;
        min-height: 0 !important;
    }
    table.odr { font-size: 9.5pt; }
    table.odr th { font-size: 8pt; }
    table.odr input,
    table.odr select,
    .odr-health-metrics input,
    .odr-health-metrics select {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        color: #0C1248 !important;
        -webkit-appearance: none;
        appearance: none;
    }
}
