/*
 * Supplier Float Portal — layout, Merit-style tokens, tables, gates, Ops history filters, toasts, notif panel.
 * Numbered section headers below match major UI areas (see comments on each block).
 */
/* --- 1. CORE VARIABLES & RESET (Merit-style enterprise light) --- */
:root {
/* Surfaces — #F9FAFB canvas, #FFFFFF cards, #EAECF0 borders */
--bg-navy: #F9FAFB;
--bg-card: #FFFFFF;
--bg-card-hover: #F2F4F7;
--border-light: #EAECF0;

/* Primary #175CD3; indigo accent #2E3192 */
--teal: #175CD3;
--amber: #F79009;
--green: #12B76A;
--red: #D92D20;
--purple: #2E3192;
--text-main: #101828;
--text-muted: #475467;

--primary-soft: #EFF4FF;
--primary-soft-strong: #D1E9FF;

--font-head: "Inter", system-ui, -apple-system, sans-serif;
--font-mono: "DM Mono", ui-monospace, monospace;
--font-body: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
background-color: var(--bg-navy);
color: var(--text-main);
font-family: var(--font-body);
font-size: 15px;
letter-spacing: 0.01em;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
height: 100vh;
display: flex;
overflow: hidden;
}
/* --- 2. LAYOUT --- */
#app-container {
display: flex;
width: 100%;
height: 100%;
position: relative;
z-index: 0;
isolation: isolate;
}
/* Sidebar */
aside {
width: 260px;
background: var(--bg-card);
border-right: 1px solid var(--border-light);
display: flex;
flex-direction: column;
padding: 20px;
flex-shrink: 0;
}
.logo {
font-family: var(--font-head);
font-size: 1.15rem;
font-weight: 700;
margin-bottom: 40px;
color: var(--teal);
letter-spacing: 0.02em;
display: flex;
align-items: center;
gap: 10px;
}
nav button {
background: transparent;
border: none;
color: var(--text-muted);
width: 100%;
padding: 12px 16px;
text-align: left;
font-family: var(--font-body);
font-size: 0.9375rem;
font-weight: 500;
cursor: pointer;
border-radius: 8px;
margin-bottom: 6px;
transition: background 0.15s, color 0.15s;
display: flex;
align-items: center;
gap: 12px;
}
nav button:hover {
background: var(--primary-soft);
color: var(--text-main);
}
nav button.active {
background: var(--teal);
color: #ffffff;
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
/* Main Area */
main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
z-index: 1;
background: var(--bg-navy);
}
/* Header — keep above #content-area so dropdowns aren’t covered by main content */
header {
height: 70px;
border-bottom: 1px solid var(--border-light);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30px;
background: var(--bg-card);
position: relative;
z-index: 100;
}
header #page-title {
color: var(--text-main);
font-family: var(--font-head);
font-weight: 600;
}
.role-switcher {
display: flex;
align-items: center;
gap: 8px;
background: var(--bg-navy);
padding: 5px;
border-radius: 8px;
border: 1px solid var(--border-light);
}
.role-btn {
background: transparent;
border: none;
color: var(--text-muted);
padding: 6px 12px;
font-size: 0.75rem;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
font-family: var(--font-body);
letter-spacing: 0.01em;
}
.role-btn.active {
background: var(--teal);
color: #ffffff;
}
.header-actions {
display: flex;
align-items: center;
gap: 16px;
position: static;
}
.notif-bell {
position: relative;
background: var(--bg-card);
border: 1px solid var(--border-light);
color: var(--text-muted);
width: 42px;
height: 42px;
border-radius: 8px;
cursor: pointer;
font-size: 1.05rem;
}
.notif-bell:hover {
border-color: var(--primary-soft-strong);
color: var(--teal);
background: var(--primary-soft);
}
.notif-badge {
position: absolute;
top: -4px;
right: -4px;
min-width: 18px;
height: 18px;
padding: 0 4px;
border-radius: 9px;
background: var(--red);
color: white;
font-size: 0.65rem;
font-family: var(--font-mono);
line-height: 18px;
text-align: center;
}
.notif-panel {
display: none;
flex-direction: column;
width: min(360px, calc(100vw - 24px));
max-height: min(460px, calc(100vh - 96px));
background: var(--bg-card);
border: 1px solid var(--border-light);
border-radius: 12px;
box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12), 0 4px 8px rgba(16, 24, 40, 0.04);
pointer-events: auto;
}
/* Root-level panel (outside header) — fixed to viewport, above entire app */
#notif-panel.open {
display: flex;
position: fixed;
z-index: 10040;
}
.notif-panel-head { padding: 12px 14px; border-bottom: 1px solid var(--border-light); }
.notif-list { overflow-y: auto; max-height: 340px; }
.notif-item {
padding: 12px 14px;
border-bottom: 1px solid var(--border-light);
cursor: pointer;
}
.notif-item:hover { background: var(--primary-soft); }
.notif-item.read { opacity: 0.55; }
.notif-item-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.notif-item-body { font-size: 0.8rem; color: var(--text-muted); }
.notif-item-time { font-size: 0.7rem; margin-top: 6px; color: var(--text-muted); }
/* Content Scroll */
#content-area {
flex: 1;
overflow-y: auto;
padding: 30px;
position: relative;
z-index: 0;
}
/* --- 3. UI COMPONENTS --- */
h1, h2, h3 {
font-family: var(--font-head);
color: var(--text-main);
font-weight: 600;
letter-spacing: 0.01em;
}
h2 { font-size: 1.5rem; margin-bottom: 20px; }

.grid-dashboard {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
}
.card {
background: var(--bg-card);
border: 1px solid var(--border-light);
border-radius: 12px;
padding: 20px;
position: relative;
overflow: hidden;
box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}
.card::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, var(--primary-soft-strong), transparent);
opacity: 0.85;
}
.card .card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.card .card-title {
font-family: var(--font-body);
font-size: 0.8125rem;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.06em;
}
.big-number {
font-family: var(--font-head);
font-size: 2rem;
font-weight: 700;
color: var(--text-main);
letter-spacing: -0.02em;
}
.status-badge {
display: inline-block;
padding: 4px 10px;
border-radius: 6px;
font-size: 0.6875rem;
font-family: var(--font-body);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.status-critical {
background: rgba(217, 45, 32, 0.1);
color: var(--red);
border: 1px solid rgba(217, 45, 32, 0.35);
}
.status-warning {
background: rgba(247, 144, 9, 0.12);
color: #b54708;
border: 1px solid rgba(247, 144, 9, 0.4);
}
.status-ok {
background: rgba(18, 183, 106, 0.12);
color: #027a48;
border: 1px solid rgba(18, 183, 106, 0.35);
}
.status-info {
background: var(--primary-soft);
color: var(--teal);
border: 1px solid rgba(23, 92, 211, 0.25);
}
/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table-scroll {
overflow-x: auto;
margin-top: 10px;
-webkit-overflow-scrolling: touch;
border-radius: 8px;
}
.table-scroll table { min-width: 1520px; margin-top: 0; }
.prediction-table thead {
background: var(--primary-soft);
}
.prediction-table th {
white-space: nowrap;
font-size: 0.6875rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-muted);
font-weight: 600;
font-family: var(--font-body);
padding: 12px 10px;
text-align: left;
border-bottom: 1px solid var(--border-light);
}
.prediction-table td {
font-size: 0.8125rem;
padding: 12px 10px;
border-bottom: 1px solid var(--border-light);
vertical-align: middle;
color: var(--text-main);
}
.prediction-table tbody tr:nth-child(even) { background: var(--bg-navy); }
.prediction-table tbody tr:hover { background: var(--primary-soft); }
.prediction-table tr:last-child td { border-bottom: none; }
.prediction-table .mono-text { font-size: 0.78rem; color: var(--text-main); }
th {
text-align: left;
padding: 12px;
border-bottom: 1px solid var(--border-light);
color: var(--text-muted);
font-size: 0.8125rem;
font-weight: 600;
font-family: var(--font-body);
background: var(--primary-soft);
}
td {
padding: 16px 12px;
border-bottom: 1px solid var(--border-light);
font-size: 0.9rem;
color: var(--text-main);
}
tr:last-child td { border-bottom: none; }

.mono-text { font-family: var(--font-mono); }
.attachment-list { list-style: none; padding: 0; margin: 8px 0 0; }
.attachment-item { margin-bottom: 8px; }
.attachment-item:last-child { margin-bottom: 0; }
.ops-history-filters {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 16px;
padding: 4px 0 0;
}
.ops-history-filters select,
.ops-history-filters input[type="date"],
.ops-history-filters input[type="search"] {
margin-bottom: 0;
}
/* Buttons */
.btn {
padding: 10px 18px;
border-radius: 8px;
border: none;
cursor: pointer;
font-size: 0.85rem;
font-weight: 600;
display: inline-flex;
align-items: center;
gap: 8px;
transition: all 0.2s;
}
.btn-teal { background: var(--teal); color: #ffffff; }
.btn-teal:hover { background: #1447b0; }

.btn-amber {
background: rgba(247, 144, 9, 0.12);
color: #b54708;
border: 1px solid rgba(247, 144, 9, 0.45);
}
.btn-amber:hover { background: var(--amber); color: #ffffff; border-color: var(--amber); }

.btn-purple { background: var(--purple); color: #ffffff; }
.btn-purple:hover { background: #252878; }
.btn-red {
background: rgba(217, 45, 32, 0.08);
color: var(--red);
border: 1px solid rgba(217, 45, 32, 0.35);
}
.btn-red:hover { background: var(--red); color: #ffffff; }
.btn-outline {
background: var(--bg-card);
border: 1px solid var(--border-light);
color: var(--text-main);
}
.btn-outline:hover {
border-color: var(--text-muted);
background: var(--bg-navy);
color: var(--text-main);
}
/* Form Elements */
input, select, textarea {
background: var(--bg-card);
border: 1px solid var(--border-light);
color: var(--text-main);
padding: 10px 12px;
border-radius: 8px;
width: 100%;
font-family: var(--font-body);
font-size: 0.875rem;
margin-bottom: 10px;
}
input:focus, select:focus, textarea:focus {
outline: 2px solid rgba(23, 92, 211, 0.35);
outline-offset: 0;
border-color: var(--teal);
}
/* Notification Toast */
#toast-container {
position: fixed;
bottom: 20px;
right: 20px;
display: flex;
flex-direction: column;
gap: 10px;
z-index: 10100;
}
.toast {
background: var(--bg-card);
border: 1px solid var(--border-light);
border-left: 4px solid var(--teal);
padding: 15px 20px;
border-radius: 8px;
box-shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
min-width: 300px;
animation: slideIn 0.3s ease-out;
font-size: 0.875rem;
color: var(--text-main);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
/* Dashboard — low-balance Acknowledge becomes a clear “done” state after click */
.ack-acknowledged-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(18, 183, 106, 0.12);
  color: var(--green);
  border: 1px solid rgba(18, 183, 106, 0.42);
  cursor: default;
  user-select: none;
}
button.ack-btn:active:not(:disabled) {
  transform: scale(0.97);
  opacity: 0.92;
}
/* Utility */
.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 20px; }
.gap { gap: 10px; }
.text-muted { color: var(--text-muted); }
.text-amber { color: #b54708; }
.text-teal { color: var(--teal); }
.text-red { color: var(--red); }
.text-purple { color: var(--purple); }
.hr-soft { border: 0; border-top: 1px solid var(--border-light); margin: 20px 0; }
.gate3-hero {
padding: 28px;
border-color: rgba(46, 49, 146, 0.35);
background: linear-gradient(180deg, var(--bg-card) 0%, var(--primary-soft) 100%);
}
/* Finance partial approval — requested line vs approved payable */
.partial-finance-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(181, 71, 8, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.45;
}
.partial-finance-banner strong {
  color: #b54708;
  display: block;
  margin-bottom: 6px;
}
.finance-payable-editor .card-title {
  margin-bottom: 0;
}
.finance-review-payable-section {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated, rgba(16, 24, 40, 0.04));
}
.finance-review-payable-section .partial-finance-banner {
  margin-top: 4px;
}
