/* Nexi branding and extra components on top of base.css (the Mellon demo design system).
   Shared by both apps. Page-specific styles belong in the page module (ui.addStyle). */
:root {
  --blue:#2D32AA; --blue-dark:#1f2380; --blue-light:#ecedfb;
  --navy:#0b0d29; --text:#14183a;
  --font:'DM Sans','Segoe UI',Roboto,Arial,sans-serif;
  --mono:'DM Mono',Consolas,'Courier New',monospace;
}
html[lang="el"] *:not(.mono):not(.stat-value):not(code) { font-family:'Segoe UI',Roboto,Arial,sans-serif !important; }
.mono { font-family:var(--mono); }
a { color:var(--blue); }
button { font-family:inherit; }
.sb-item.active { background:rgba(96,102,230,.38); }
.sb-item.active::before { background:#8f94ff; }
.sb-tenant { background:rgba(96,102,230,.2); border-color:rgba(96,102,230,.4); }
.login-left::before { background:rgba(96,102,230,.25); }

/* Nexi wordmark (text based, no image needed) */
.nexi-logo { font-weight:700; font-size:26px; letter-spacing:-.04em; color:var(--blue); line-height:1; user-select:none; cursor:pointer; }
.nexi-logo.white { color:#fff; }
.nexi-logo small { font-size:10px; font-weight:500; letter-spacing:.12em; text-transform:uppercase; opacity:.6; margin-left:8px; vertical-align:middle; }

/* ---------- public (guest) layout ---------- */
.pub { display:flex; flex-direction:column; width:100%; height:100vh; overflow:hidden; }
.pub-header { height:var(--th); background:var(--surface); border-bottom:1px solid var(--border); display:flex; align-items:center; gap:18px; padding:0 32px; flex-shrink:0; }
.pub-nav { display:flex; gap:4px; flex:1; margin-left:16px; }
.pub-nav a { font-size:13px; font-weight:500; color:var(--muted); padding:8px 12px; border-radius:8px; text-decoration:none; cursor:pointer; }
.pub-nav a:hover, .pub-nav a.active { background:var(--blue-light); color:var(--blue); }
.pub-content { flex:1; overflow-y:auto; }
.pub-inner { max-width:1240px; margin:0 auto; padding:24px 32px 64px; }

/* ---------- buttons ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; font-size:13px; font-weight:600; padding:9px 16px; border-radius:9px; border:1px solid transparent; cursor:pointer; white-space:nowrap; transition:all .15s; background:var(--blue); color:#fff; }
.btn { text-decoration:none; }
.btn:hover { background:var(--blue-dark); }
.btn.outline { background:var(--surface); color:var(--text); border-color:var(--border); }
.btn.outline:hover { background:var(--bg); }
.btn.ghost { background:none; color:var(--blue); }
.btn.ghost:hover { background:var(--blue-light); }
.btn.danger { background:var(--danger); }
.btn.danger:hover { background:#c53030; }
.btn.success { background:#0d9488; }
.btn.success:hover { background:#0b7c72; }
.btn.sm { font-size:12px; padding:6px 11px; border-radius:7px; }
.btn.lg { font-size:14px; padding:12px 22px; border-radius:10px; }
.btn[disabled] { opacity:.5; cursor:not-allowed; }
.btn svg, .tb-btn svg { width:15px; height:15px; }

/* ---------- layout helpers ---------- */
.row { display:flex; align-items:center; gap:12px; }
.row.wrap { flex-wrap:wrap; }
.row.between { justify-content:space-between; }
.col { display:flex; flex-direction:column; gap:12px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.split { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:20px; align-items:start; }
.grow { flex:1; min-width:0; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.muted { color:var(--muted); } .faint { color:var(--faint); } .small { font-size:12px; } .bold { font-weight:600; }
.right { text-align:right; } .center { text-align:center; }
.page-title { font-size:20px; font-weight:600; margin-bottom:4px; }
.page-sub { font-size:13px; color:var(--muted); margin-bottom:18px; }
.panel-body { padding:16px 18px; }
.clickable { cursor:pointer; }
.hidden { display:none !important; }
.kv { display:grid; grid-template-columns:150px 1fr; gap:6px 12px; font-size:13px; }
.kv dt { color:var(--muted); } .kv dd { font-weight:500; word-break:break-word; }
.field select { height:44px; padding:0 12px; }
.field .hint { font-size:11px; color:var(--muted); margin-top:4px; }
.field .error { font-size:11px; color:var(--danger); margin-top:4px; }
.field input.prefilled, .field select.prefilled { background:#f0fbf9; border-color:#9fe3da; }

/* ---------- extra status pills (classes = status values) ---------- */
.pill.draft, .pill.todo, .pill.offline { background:#eef1f7; color:var(--muted); } .pill.draft::before, .pill.todo::before, .pill.offline::before { background:var(--faint); }
.pill.submitted, .pill.in_verification, .pill.in_progress, .pill.dispatched, .pill.info { background:var(--blue-light); color:var(--blue); } .pill.submitted::before, .pill.in_verification::before, .pill.in_progress::before, .pill.dispatched::before, .pill.info::before { background:var(--blue); }
.pill.under_review, .pill.info_requested, .pill.contract_signing, .pill.due, .pill.flag, .pill.medium, .pill.in_repair, .pill.warn, .pill.escalated, .pill.requested_doc { background:var(--warn-bg); color:#92400e; } .pill.under_review::before, .pill.info_requested::before, .pill.contract_signing::before, .pill.due::before, .pill.flag::before, .pill.medium::before, .pill.in_repair::before, .pill.warn::before, .pill.escalated::before, .pill.requested_doc::before { background:var(--warn); }
.pill.approved, .pill.delivered, .pill.activated, .pill.pass, .pill.low, .pill.validated, .pill.signed, .pill.ok, .pill.online, .pill.answered { background:var(--accent-bg); color:#0d9488; } .pill.approved::before, .pill.delivered::before, .pill.activated::before, .pill.pass::before, .pill.low::before, .pill.validated::before, .pill.signed::before, .pill.ok::before, .pill.online::before, .pill.answered::before { background:var(--accent); }
.pill.declined, .pill.rejected, .pill.fail, .pill.high, .pill.mismatch, .pill.missing, .pill.bad, .pill.breached { background:var(--danger-bg); color:#9b2c2c; } .pill.declined::before, .pill.rejected::before, .pill.fail::before, .pill.high::before, .pill.mismatch::before, .pill.missing::before, .pill.bad::before, .pill.breached::before { background:var(--danger); }

/* ---------- account completion banner ---------- */
.kyc-banner { background:linear-gradient(135deg,#fff8e6,#fef3c7); border-bottom:1px solid var(--warn); padding:11px 28px; display:flex; align-items:center; gap:14px; flex-shrink:0; }
.kyc-banner .kb-ico { font-size:18px; }
.kyc-banner .kb-text { flex:1; font-size:13px; color:#78350f; line-height:1.45; }
.kyc-banner .kb-text b { color:#92400e; }
.kyc-banner.info { background:var(--blue-light); border-bottom-color:#c5c8f3; }
.kyc-banner.info .kb-text, .kyc-banner.info .kb-text b { color:var(--blue-dark); }

/* ---------- generic modal (ui.modal) ---------- */
.modal.wide { width:640px; } .modal.xwide { width:860px; }
.modal { max-width:calc(100vw - 40px); max-height:calc(100vh - 40px); overflow-y:auto; }
.modal-body { font-size:13px; line-height:1.6; margin-bottom:20px; }
.modal-btns { justify-content:flex-end; }
.modal-btns .btn { min-width:110px; }

/* ---------- toast ---------- */
#toasts { position:fixed; right:22px; bottom:22px; display:flex; flex-direction:column; gap:8px; z-index:3000; }
.toast { background:var(--navy); color:#fff; font-size:13px; padding:11px 16px; border-radius:10px; box-shadow:0 8px 28px rgba(0,0,0,.25); max-width:360px; animation:toast-in .2s ease; border-left:4px solid var(--accent); }
.toast.error { border-left-color:var(--danger); } .toast.warn { border-left-color:var(--warn); } .toast.info { border-left-color:#8f94ff; }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ---------- stepper (journey progress) ---------- */
.stepper { display:flex; gap:0; margin-bottom:22px; background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px 10px; }
.stepper .st { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; position:relative; font-size:11px; color:var(--faint); text-align:center; padding:0 4px; }
.stepper .st::before { content:''; position:absolute; top:13px; left:-50%; width:100%; height:2px; background:var(--border); z-index:0; }
.stepper .st:first-child::before { display:none; }
.stepper .st .n { width:28px; height:28px; border-radius:50%; background:var(--bg); border:2px solid var(--border); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:12px; z-index:1; color:var(--muted); }
.stepper .st.done .n { background:var(--accent); border-color:var(--accent); color:#fff; }
.stepper .st.done::before, .stepper .st.current::before { background:var(--accent); }
.stepper .st.current .n { background:var(--blue); border-color:var(--blue); color:#fff; box-shadow:0 0 0 4px rgba(45,50,170,.15); }
.stepper .st.current { color:var(--text); font-weight:600; } .stepper .st.done { color:var(--muted); }

/* ---------- spinner / simulated processing ---------- */
.spinner { width:18px; height:18px; border:2.5px solid var(--border); border-top-color:var(--blue); border-radius:50%; animation:spin .7s linear infinite; display:inline-block; vertical-align:middle; }
.spinner.lg { width:38px; height:38px; border-width:4px; }
@keyframes spin { to { transform:rotate(360deg); } }
.sim-box { border:1.5px dashed var(--border); border-radius:12px; padding:18px; text-align:center; color:var(--muted); font-size:13px; background:#fafbfd; }
.sim-tag { display:inline-block; font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; background:#eef1f7; color:var(--muted); padding:2px 6px; border-radius:4px; vertical-align:middle; }

/* ---------- simple charts ---------- */
.bar-row { display:grid; grid-template-columns:170px 1fr 70px; gap:10px; align-items:center; font-size:12px; margin-bottom:8px; }
.bar-track { height:18px; background:var(--bg); border-radius:5px; overflow:hidden; }
.bar-fill { height:100%; background:var(--blue); border-radius:5px; transition:width .4s; min-width:2px; }
.bar-fill.teal { background:var(--accent); } .bar-fill.warn { background:var(--warn); } .bar-fill.red { background:var(--danger); }
.vbars { display:flex; align-items:flex-end; gap:10px; height:150px; padding-top:8px; }
.vbars .vb { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:5px; height:100%; font-size:10px; color:var(--muted); }
.vbars .vb i { display:block; width:100%; max-width:42px; background:var(--blue); border-radius:5px 5px 0 0; min-height:2px; }
.vbars .vb b { font-family:var(--mono); font-size:11px; color:var(--text); font-weight:500; }

/* ---------- empty state ---------- */
.empty { text-align:center; padding:44px 20px; color:var(--muted); font-size:13px; }
.empty .e-ico { font-size:34px; margin-bottom:10px; }

/* ---------- role switch (backoffice) ---------- */
.role-switch { margin:12px 12px 6px; }
.role-switch label { display:block; font-size:9px; letter-spacing:.12em; text-transform:uppercase; color:rgba(141,164,200,.6); margin-bottom:5px; }
.role-switch select { width:100%; background:rgba(96,102,230,.2); border:1px solid rgba(96,102,230,.45); color:#fff; border-radius:8px; padding:8px 10px; font-size:12px; font-family:inherit; outline:none; }
.role-switch select option { color:#14183a; }

/* ---------- misc ---------- */
.stats-grid.three { grid-template-columns:repeat(3,1fr); }
.stats-grid.five { grid-template-columns:repeat(5,1fr); }
.device-table td .sub { font-size:11px; color:var(--muted); }
.tag { display:inline-block; font-size:10px; font-weight:600; padding:2px 7px; border-radius:5px; background:var(--blue-light); color:var(--blue); }
.tag.grey { background:#eef1f7; color:var(--muted); } .tag.teal { background:var(--accent-bg); color:#0d9488; } .tag.warn { background:var(--warn-bg); color:#92400e; } .tag.red { background:var(--danger-bg); color:#9b2c2c; }
.user-menu { position:absolute; bottom:64px; left:12px; right:12px; background:#fff; border-radius:10px; box-shadow:0 12px 40px rgba(0,0,0,.3); padding:6px; z-index:50; }
.user-menu div { font-size:13px; padding:9px 12px; border-radius:7px; cursor:pointer; color:var(--text); }
.user-menu div:hover { background:var(--bg); }
@media (max-width:1100px) {
  .split, .grid-3, .grid-4 { grid-template-columns:1fr 1fr; } .stats-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:820px) {
  .sidebar { display:none; } .split, .grid-2, .grid-3, .grid-4, .stats-grid, .field-grid, .field-row2 { grid-template-columns:1fr; }
  .content { padding:16px; } .pub-inner { padding:16px; } .pub-nav { display:none; }
}
