.pdm-app {
    display: none;
    min-height: 100vh;
    background: #f1f5f9;
    color: #0f172a;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.pdm-app.on { display: block; }

.pdm-top {
    background: #0C1248;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.pdm-top h1 { margin: 0; font-size: 1.05rem; color: #fff; letter-spacing: 0.02em; }
.pdm-top .who { font-size: 0.82rem; color: #c7d0e0; }
.pdm-top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pdm-wrap { padding-top: 16px; }

.pdm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: end;
}
.pdm-toolbar h2 { display: none; }
.pdm-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}
.pdm-toolbar input,
.pdm-toolbar select {
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    color: #0f172a;
}
.pdm-toolbar-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.pdm-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pdm-status.draft { background: #e0e7ff; color: #312e81; }
.pdm-status.submitted { background: #dcfce7; color: #166534; }

.pdm-portfolio {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pdm-chip {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    min-width: 140px;
    text-align: left;
}
.pdm-chip:hover { border-color: #94a3b8; }
.pdm-chip.is-active { outline: 2px solid #0C1248; }
.pdm-chip .t { display: block; font-weight: 700; font-size: 0.82rem; color: #0f172a; }
.pdm-chip .m { display: block; font-size: 0.7rem; color: #64748b; margin-top: 2px; }
.pdm-chip.Green { border-left: 5px solid #16a34a; }
.pdm-chip.Amber { border-left: 5px solid #d97706; }
.pdm-chip.Red { border-left: 5px solid #e11d48; }

.pdm-visit-list { display: flex; flex-direction: column; gap: 6px; }
.pdm-visit-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
}
.pdm-visit-row:hover { border-color: #94a3b8; }
.pdm-visit-row.is-active { outline: 2px solid #0C1248; }
.pdm-visit-row .when { font-weight: 700; }
.rag-pill {
    display: inline-block;
    min-width: 52px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}
.rag-pill.Green { background: #dcfce7; color: #166534; }
.rag-pill.Amber { background: #ffedd5; color: #9a3412; }
.rag-pill.Red { background: #ffe4e6; color: #9f1239; }
.rag-pill.empty { background: #e2e8f0; color: #475569; }

#pdmActionsTable { table-layout: auto; }
#pdmActionsTable th:nth-child(1),
#pdmActionsTable td:nth-child(1) { width: 46%; }
#pdmActionsTable input,
#pdmActionsTable select { width: 100%; }

@media print {
    #loginShell, .pdm-top-actions, .pdm-toolbar-btns, #pdmVisitsCard,
    #pdmAddAction, #opsMsg, .pdm-portfolio { display: none !important; }
    .pdm-app { display: block !important; background: #fff; }
    .ops-card { break-inside: avoid; box-shadow: none; }
    .pdm-top { background: #fff !important; color: #0C1248 !important; border-bottom: 2px solid #F9583A; }
    .pdm-top h1, .pdm-top .who { color: #0C1248 !important; }
}
