polypharmacy-env / frontend /src /styles.css
TheJackBright's picture
Fix inference action sanitization and improve mobile responsiveness
0aa6a46
:root {
--bg: #0d1117;
--bg-layer: #0d1117;
--panel: #161b22;
--panel-solid: #1c2333;
--text: #e6edf3;
--muted: #8b949e;
--primary: #58a6ff;
--primary-2: #79c0ff;
--accent: #58a6ff;
--success: #3fb950;
--danger: #f85149;
--warning: #d29922;
--border: rgba(48, 54, 61, 0.7);
--line: rgba(48, 54, 61, 0.5);
--shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
--shadow-strong: 0 4px 16px rgba(0, 0, 0, 0.2);
--radius: 12px;
--radius-sm: 8px;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
color: var(--text);
font-family: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
background: var(--bg);
line-height: 1.55;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: transparent;
-webkit-text-size-adjust: 100%;
}
.shell {
min-height: 100vh;
position: relative;
overflow: hidden;
padding: 20px 24px 40px;
}
.container {
width: min(1400px, 100%);
margin: 0 auto;
position: relative;
z-index: 2;
}
/* Background orbs - subtle and muted for a professional look */
.bg-orb {
position: absolute;
border-radius: 50%;
pointer-events: none;
opacity: 0.3;
filter: blur(80px);
}
.orb-a {
width: min(42vw, 500px);
aspect-ratio: 1 / 1;
right: -8%;
top: -8%;
background: radial-gradient(circle, rgba(88, 166, 255, 0.12), transparent 70%);
}
.orb-b {
width: min(36vw, 420px);
aspect-ratio: 1 / 1;
left: -8%;
bottom: -12%;
background: radial-gradient(circle, rgba(88, 166, 255, 0.08), transparent 72%);
}
/* ── Panels ──────────────────────────────────────────────────── */
.glass {
background: var(--panel);
border: 1px solid var(--border);
box-shadow: var(--shadow);
}
/* ── Top Bar ─────────────────────────────────────────────────── */
.topbar {
border-radius: var(--radius);
padding: 14px 24px;
display: flex;
align-items: center;
gap: 16px;
flex-wrap: wrap;
}
.title-wrap {
flex: 1;
min-width: 200px;
}
.title-wrap h1 {
margin: 0;
font-size: clamp(1rem, 1.8vw, 1.35rem);
font-weight: 700;
letter-spacing: -0.01em;
color: var(--text);
background: none;
-webkit-background-clip: unset;
-webkit-text-fill-color: unset;
background-clip: unset;
}
.title-wrap p {
margin: 2px 0 0;
font-size: 0.8rem;
color: var(--muted);
letter-spacing: 0.01em;
}
.topbar-right {
display: flex;
align-items: center;
gap: 10px;
}
.status-chip {
padding: 5px 14px;
border-radius: 999px;
font-size: 0.72rem;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
border: 1px solid transparent;
white-space: nowrap;
}
.status-chip.live {
color: #ffffff;
background: var(--success);
box-shadow: none;
}
.status-chip.idle {
color: var(--muted);
border-color: var(--border);
background: rgba(48, 54, 61, 0.3);
}
.guide-trigger {
width: 34px !important;
height: 34px;
min-height: 34px;
padding: 0;
border-radius: 50% !important;
font-size: 0.95rem;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
background: rgba(88, 166, 255, 0.1);
border: 1px solid rgba(88, 166, 255, 0.25);
color: var(--primary);
box-shadow: none;
}
.guide-trigger:hover {
background: rgba(88, 166, 255, 0.2);
box-shadow: none;
}
.actions {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10px;
}
/* ── Form Controls ───────────────────────────────────────────── */
button,
select,
input {
width: 100%;
min-height: 42px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
font-size: 0.9rem;
padding: 10px 14px;
color: var(--text);
background: #0d1117;
font-family: inherit;
transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
select:hover,
input:hover {
border-color: rgba(139, 148, 158, 0.5);
}
select:focus,
input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
background: #0d1117;
}
select {
cursor: pointer;
appearance: auto;
}
button {
cursor: pointer;
border: 0;
width: auto;
font-weight: 600;
letter-spacing: 0.01em;
white-space: nowrap;
background: var(--primary);
color: #ffffff;
box-shadow: none;
transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease;
}
button:hover {
background: #79c0ff;
transform: translateY(-1px);
filter: none;
box-shadow: 0 2px 8px rgba(88, 166, 255, 0.25);
}
button:active {
transform: translateY(0);
background: #4090e0;
}
button.secondary {
background: rgba(88, 166, 255, 0.15);
color: var(--primary);
border: 1px solid rgba(88, 166, 255, 0.3);
}
button.secondary:hover {
background: rgba(88, 166, 255, 0.25);
}
button:disabled {
opacity: 0.4;
cursor: not-allowed;
filter: none;
box-shadow: none;
transform: none;
}
.submit-btn {
width: 100%;
margin-top: 10px;
min-height: 44px;
font-size: 0.92rem;
}
/* ── Layout ──────────────────────────────────────────────────── */
.layout {
margin-top: 20px;
display: grid;
gap: 20px;
grid-template-columns: 1.1fr 0.9fr;
align-items: start;
}
.panel {
border-radius: var(--radius);
padding: 24px;
position: relative;
overflow: hidden;
}
.panel::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
border: 1px solid var(--line);
pointer-events: none;
}
.panel-wide {
grid-column: 1 / -1;
}
.panel h2 {
margin: 0 0 16px;
font-size: 0.82rem;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
color: var(--muted);
}
.panel h3 {
margin: 0 0 12px;
font-size: 0.8rem;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--muted);
}
/* ── KPI Grid ────────────────────────────────────────────────── */
.kpi-grid {
display: grid;
gap: 12px;
grid-template-columns: repeat(3, 1fr);
}
.kpi-grid div {
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: var(--panel-solid);
padding: 16px 18px;
overflow: hidden;
}
.kpi-grid span {
display: block;
margin-bottom: 6px;
font-size: 0.72rem;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.06em;
}
.kpi-grid strong {
font-size: 1.05rem;
font-weight: 600;
line-height: 1.3;
word-break: break-word;
overflow-wrap: break-word;
color: var(--text);
}
/* ── Risk Bar ────────────────────────────────────────────────── */
.risk-bar-wrap {
margin-top: 16px;
}
.risk-labels {
display: flex;
justify-content: space-between;
font-size: 0.8rem;
color: var(--muted);
margin-bottom: 8px;
}
.risk-labels strong {
font-size: 0.85rem;
color: var(--text);
}
.risk-down {
color: var(--success) !important;
}
.risk-same {
color: var(--warning) !important;
}
.risk-bar {
height: 6px;
background: rgba(48, 54, 61, 0.5);
border-radius: 3px;
overflow: hidden;
}
.risk-fill {
height: 100%;
background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
border-radius: 3px;
transition: width 300ms ease;
}
/* ── Conditions ──────────────────────────────────────────────── */
.conditions-row {
margin-top: 14px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.conditions-label {
font-size: 0.78rem;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.04em;
margin-right: 4px;
}
.condition-tag {
font-size: 0.75rem;
padding: 4px 12px;
border-radius: 999px;
background: rgba(88, 166, 255, 0.1);
border: 1px solid rgba(88, 166, 255, 0.2);
color: var(--primary);
text-transform: capitalize;
white-space: nowrap;
}
/* ── Action Console ──────────────────────────────────────────── */
.action-row,
.stack {
display: grid;
gap: 12px;
margin-bottom: 14px;
}
.action-row label,
.field-group label {
display: block;
color: var(--muted);
font-size: 0.78rem;
letter-spacing: 0.04em;
text-transform: uppercase;
margin-bottom: 6px;
}
.field-group {
display: flex;
flex-direction: column;
}
.stack-two {
grid-template-columns: 1fr 1fr;
}
/* ── Medication Cards ────────────────────────────────────────── */
.med-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
gap: 12px;
max-height: 480px;
overflow-y: auto;
padding-right: 4px;
}
.med-card {
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: var(--panel-solid);
padding: 16px 18px;
transition: border-color 150ms ease, background 150ms ease;
overflow: hidden;
}
.med-card:hover {
border-color: rgba(88, 166, 255, 0.4);
background: #1f2937;
}
.med-card.high-risk {
border-color: rgba(248, 81, 73, 0.35);
}
.med-card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.med-card-header strong {
font-size: 0.92rem;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text);
}
.risk-badge {
font-size: 0.65rem;
padding: 3px 9px;
border-radius: 999px;
background: rgba(248, 81, 73, 0.12);
border: 1px solid rgba(248, 81, 73, 0.3);
color: var(--danger);
text-transform: uppercase;
letter-spacing: 0.04em;
font-weight: 600;
white-space: nowrap;
flex-shrink: 0;
}
.med-generic {
margin: 6px 0;
color: var(--muted);
font-size: 0.84rem;
text-transform: capitalize;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.med-details {
display: flex;
gap: 10px;
font-size: 0.8rem;
color: #8b949e;
}
.med-atc {
color: var(--primary);
font-weight: 600;
}
.beers-flags {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 5px;
}
.beers-tag {
font-size: 0.68rem;
padding: 3px 9px;
border-radius: 999px;
background: rgba(210, 153, 34, 0.1);
border: 1px solid rgba(210, 153, 34, 0.25);
color: var(--warning);
text-transform: capitalize;
}
/* ── History Grid ────────────────────────────────────────────── */
.history-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 24px;
}
.history-list {
display: flex;
flex-direction: column;
gap: 10px;
max-height: 300px;
overflow-y: auto;
}
.history-item {
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: var(--panel-solid);
padding: 14px 16px;
}
.history-item strong {
font-size: 0.88rem;
font-weight: 600;
display: block;
margin-bottom: 6px;
color: var(--text);
}
.history-detail {
margin: 6px 0 0;
font-size: 0.82rem;
color: var(--muted);
text-transform: capitalize;
}
.severity-tag, .intervention-tag {
display: inline-block;
font-size: 0.7rem;
padding: 3px 10px;
border-radius: 999px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.severity-tag.severe {
background: rgba(248, 81, 73, 0.12);
border: 1px solid rgba(248, 81, 73, 0.3);
color: var(--danger);
}
.severity-tag.moderate {
background: rgba(210, 153, 34, 0.12);
border: 1px solid rgba(210, 153, 34, 0.3);
color: var(--warning);
}
.severity-tag.mild {
background: rgba(63, 185, 80, 0.12);
border: 1px solid rgba(63, 185, 80, 0.3);
color: var(--success);
}
.severity-tag.none {
background: rgba(48, 54, 61, 0.3);
border: 1px solid var(--border);
color: var(--muted);
}
.intervention-tag {
background: rgba(88, 166, 255, 0.1);
border: 1px solid rgba(88, 166, 255, 0.25);
color: var(--primary);
}
.severity-severe .history-item {
border-color: rgba(248, 81, 73, 0.2);
}
.severity-moderate .history-item {
border-color: rgba(210, 153, 34, 0.2);
}
/* ── Event Log ───────────────────────────────────────────────── */
.logs {
max-height: 280px;
overflow-y: auto;
padding-right: 4px;
display: flex;
flex-direction: column;
gap: 8px;
font-size: 0.84rem;
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}
.logs div {
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: #0d1117;
padding: 12px 16px;
color: var(--text);
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
line-height: 1.5;
}
.log-empty {
color: var(--muted);
font-family: inherit;
font-style: italic;
}
/* ── Helper Text ─────────────────────────────────────────────── */
.muted {
margin: 0;
color: var(--muted);
font-size: 0.88rem;
}
.budget-note {
margin-top: 14px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 14px 18px;
background: var(--panel-solid);
font-size: 0.88rem;
color: var(--muted);
}
.done-note {
border-color: rgba(63, 185, 80, 0.3);
color: var(--success);
}
/* ── Footer ──────────────────────────────────────────────────── */
.app-footer {
margin-top: 28px;
text-align: center;
}
.app-footer p {
font-size: 0.8rem;
color: var(--muted);
opacity: 0.6;
}
.app-footer a {
color: var(--primary);
text-decoration: none;
}
.app-footer a:hover {
text-decoration: underline;
}
/* ── Spotlight Guide ─────────────────────────────────────────── */
.spotlight-overlay {
position: fixed;
inset: 0;
z-index: 100;
pointer-events: none;
}
.spotlight-svg {
position: fixed;
inset: 0;
z-index: 100;
pointer-events: auto;
}
.spotlight-ring {
position: fixed;
z-index: 101;
border: 2px solid var(--primary);
border-radius: var(--radius);
box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.1);
pointer-events: none;
transition: top 350ms ease, left 350ms ease, width 350ms ease, height 350ms ease;
}
.spotlight-tooltip {
position: fixed;
z-index: 102;
border-radius: var(--radius);
padding: 24px;
pointer-events: auto;
animation: tooltipIn 250ms ease;
}
@keyframes tooltipIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.spotlight-tooltip-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.spotlight-tooltip-header h3 {
margin: 0;
font-size: 1.05rem;
font-weight: 600;
color: var(--text);
text-transform: none;
letter-spacing: 0;
line-height: 1.3;
}
.guide-counter {
font-size: 0.72rem;
color: var(--muted);
padding: 4px 10px;
border-radius: 999px;
background: rgba(48, 54, 61, 0.4);
border: 1px solid var(--border);
white-space: nowrap;
flex-shrink: 0;
}
.spotlight-tooltip-body {
margin-bottom: 18px;
font-size: 0.88rem;
line-height: 1.65;
color: var(--muted);
}
.spotlight-tooltip-body p {
margin: 0 0 5px;
}
.spotlight-tooltip-body p:empty {
height: 4px;
}
.spotlight-tooltip-footer {
display: flex;
gap: 8px;
justify-content: flex-end;
}
.guide-btn {
padding: 8px 18px !important;
font-size: 0.84rem !important;
border-radius: var(--radius-sm) !important;
}
.guide-dots {
display: flex;
justify-content: center;
gap: 6px;
margin-top: 14px;
}
.dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: rgba(48, 54, 61, 0.6);
transition: background 150ms ease;
}
.dot.active {
background: var(--primary);
box-shadow: none;
}
/* ── Global mobile overflow prevention ───────────────────────── */
html, body {
overflow-x: hidden;
width: 100%;
}
/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1180px) {
.layout {
grid-template-columns: 1fr;
}
.topbar {
flex-direction: column;
align-items: flex-start;
}
.topbar-right {
align-self: flex-start;
}
.actions {
width: 100%;
justify-content: flex-start;
}
.history-grid {
grid-template-columns: 1fr;
}
}
@media (max-width: 760px) {
.shell {
padding: 10px 10px 24px;
}
.container {
width: 100%;
}
.topbar,
.panel {
border-radius: var(--radius-sm);
padding: 14px 14px;
}
.topbar {
gap: 12px;
}
.topbar-right {
width: 100%;
justify-content: space-between;
}
.actions {
flex-direction: column;
}
.actions button,
.actions select {
width: 100%;
min-height: 46px;
}
.layout {
gap: 14px;
margin-top: 14px;
}
.kpi-grid {
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.med-grid {
grid-template-columns: 1fr;
max-height: none;
}
.stack-two {
grid-template-columns: 1fr;
}
.guide-modal {
padding: 20px;
}
.spotlight-tooltip {
left: 10px !important;
right: 10px !important;
max-width: calc(100vw - 20px) !important;
top: auto !important;
bottom: 20px !important;
width: calc(100vw - 20px) !important;
}
.spotlight-ring {
display: none;
}
.guide-footer,
.spotlight-tooltip-footer {
flex-direction: column;
}
.spotlight-tooltip-footer button {
width: 100%;
}
.app-footer p {
font-size: 0.72rem;
}
.logs {
max-height: 200px;
}
.logs div {
overflow-x: auto;
white-space: normal;
word-break: break-all;
}
.risk-labels {
flex-direction: column;
gap: 4px;
}
.conditions-row {
gap: 6px;
}
.condition-tag {
font-size: 0.7rem;
padding: 3px 10px;
}
.budget-note {
font-size: 0.82rem;
padding: 12px 14px;
}
.history-list {
max-height: 240px;
}
.history-item strong {
word-break: break-word;
}
.med-card-header {
flex-wrap: wrap;
}
.med-details {
flex-wrap: wrap;
}
.beers-flags {
gap: 4px;
}
.beers-tag {
font-size: 0.65rem;
padding: 2px 8px;
}
}
/* ── Small phones (≀ 420px) ─────────────────────────────────── */
@media (max-width: 420px) {
.shell {
padding: 6px 6px 20px;
}
.topbar,
.panel {
padding: 12px 10px;
border-radius: 8px;
}
.title-wrap {
min-width: 0;
}
.title-wrap h1 {
font-size: 0.95rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.title-wrap p {
font-size: 0.72rem;
}
.layout {
gap: 10px;
margin-top: 10px;
}
.kpi-grid {
grid-template-columns: 1fr;
gap: 6px;
}
.kpi-grid div {
padding: 10px 12px;
}
.kpi-grid span {
font-size: 0.68rem;
margin-bottom: 4px;
}
.kpi-grid strong {
font-size: 0.88rem;
}
.med-card {
padding: 12px 12px;
}
.med-card-header strong {
font-size: 0.84rem;
}
.spotlight-tooltip {
padding: 14px;
bottom: 10px !important;
}
.spotlight-tooltip-header h3 {
font-size: 0.9rem;
}
.spotlight-tooltip-body {
font-size: 0.8rem;
margin-bottom: 14px;
line-height: 1.55;
}
.panel h2 {
font-size: 0.75rem;
margin-bottom: 10px;
}
.panel h3 {
font-size: 0.72rem;
}
.submit-btn {
min-height: 48px;
font-size: 0.88rem;
}
.logs {
max-height: 160px;
font-size: 0.75rem;
gap: 6px;
}
.logs div {
padding: 8px 10px;
line-height: 1.4;
}
.history-item {
padding: 10px 12px;
}
.history-item strong {
font-size: 0.82rem;
}
.history-detail {
font-size: 0.78rem;
}
.severity-tag, .intervention-tag {
font-size: 0.65rem;
padding: 2px 8px;
}
button, select, input {
font-size: 0.85rem;
min-height: 46px;
padding: 10px 12px;
}
.action-row label,
.field-group label {
font-size: 0.72rem;
}
.status-chip {
font-size: 0.65rem;
padding: 4px 10px;
}
.guide-trigger {
width: 30px !important;
height: 30px;
min-height: 30px;
font-size: 0.85rem;
}
.guide-counter {
font-size: 0.68rem;
padding: 3px 8px;
}
.app-footer {
margin-top: 16px;
}
.app-footer p {
font-size: 0.68rem;
line-height: 1.4;
}
}
/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: rgba(48, 54, 61, 0.6);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: rgba(139, 148, 158, 0.4);
}