/* SandssFactors - tema ispirato a SAP Fiori Horizon */
:root {
  --bg: #f5f6f7; --shell: #ffffff; --card: #ffffff; --text: #1d2d3e; --text2: #556b82; --muted: #758ca4;
  --brand: #0070f2; --brand-dark: #0057d2; --brand-soft: #ebf8ff; --border: #e5e5e5; --border2: #d9d9d9;
  --positive: #256f3a; --positive-bg: #f5fae5; --negative: #aa0808; --negative-bg: #ffeaf4; --critical: #b44f00; --critical-bg: #fff3b8; --info-bg: #e1f4ff;
  --radius: 12px; --radius-s: 8px;
  --shadow: 0 0 0.125rem rgba(34,53,72,.15), 0 0.125rem 0.5rem rgba(34,53,72,.15);
  --shadow-l: 0 0 0.125rem rgba(34,53,72,.15), 0 0.625rem 1.875rem rgba(34,53,72,.25);
  --font: "72", "72full", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.4; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; } h4 { font-size: .875rem; }
code, pre { font-family: "72Mono", Consolas, "Courier New", monospace; font-size: 12.5px; }
pre { background: #1d2d3e; color: #e6edf3; padding: 12px 14px; border-radius: var(--radius-s); overflow: auto; max-height: 520px; margin: 0; white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--text2); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .right { text-align: right; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .spacer { flex: 1; }

/* Shell bar */
.shell { position: sticky; top: 0; z-index: 50; height: 52px; background: var(--shell); box-shadow: 0 0 .125rem rgba(34,53,72,.2), 0 .125rem .25rem rgba(34,53,72,.15); display: flex; align-items: center; padding: 0 16px; gap: 12px; }
.shell .brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap; }
.shell .brand:hover { text-decoration: none; }
.shell .brand svg { width: 30px; height: 30px; }
.shell .brand .company { color: var(--text2); font-weight: 400; font-size: 13px; padding-left: 8px; border-left: 1px solid var(--border2); }
.menu-btn { background: none; border: 0; font: inherit; font-weight: 700; color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.menu-btn:hover { background: #eaecee; }
.shell .search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.shell .search input { width: 100%; height: 36px; border-radius: 18px; border: 1px solid transparent; background: #eff1f2; padding: 0 16px 0 36px; font: inherit; color: var(--text); }
.shell .search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.shell .search .ico { position: absolute; left: 12px; top: 9px; color: var(--text2); }
.shell .icons { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--text2); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.icon-btn:hover { background: #eaecee; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: #d20a0a; color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }
.dropdown { position: relative; }
.menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-l); padding: 6px 0; z-index: 60; }
.menu.right { left: auto; right: 0; }
.menu.open { display: block; }
.menu a, .menu .item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--text); }
.menu a:hover { background: #eaecee; text-decoration: none; }
.menu a.active { color: var(--brand); font-weight: 700; }
.menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu .hdr { padding: 10px 16px; color: var(--text2); font-size: 12px; }
.results { position: absolute; top: 42px; left: 0; right: 0; background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-l); display: none; max-height: 420px; overflow: auto; }
.results.open { display: block; }
.results a { display: flex; gap: 10px; align-items: center; padding: 8px 14px; color: var(--text); }
.results a:hover, .results a.sel { background: var(--brand-soft); text-decoration: none; }
.results .grp { padding: 8px 14px 4px; font-size: 12px; color: var(--text2); font-weight: 700; }

/* Page */
.page { padding: 20px 32px 48px; max-width: 1440px; margin: 0 auto; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.crumbs a { color: var(--brand); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .page { padding: 16px; } .shell .brand .company, .shell .search { display: none; } }

/* Card */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card-h h3 { font-size: 16px; }
.card-h .sub { color: var(--text2); font-size: 12px; }
.card-b { padding: 4px 16px 16px; }
.card-f { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.card.pad { padding: 16px; }
.section { margin-bottom: 16px; scroll-margin-top: 110px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--brand); background: #fff; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-soft); text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #eaecee; }
.btn-neg { border-color: var(--negative); color: var(--negative); }
.btn-neg:hover { background: var(--negative-bg); }
.btn-pos { border-color: var(--positive); color: var(--positive); }
.btn-pos:hover { background: var(--positive-bg); }
.btn-s { height: 28px; padding: 0 10px; font-size: 13px; }

/* Fields */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 24px; }
.field .l { color: var(--text2); font-size: 12.5px; margin-bottom: 2px; }
.field .v { font-size: 14px; word-break: break-word; }
.field .v:empty::after { content: "—"; color: var(--muted); }

/* Forms */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 20px; }
.form label { display: block; color: var(--text2); font-size: 12.5px; margin-bottom: 4px; }
.form .req label::after { content: " *"; color: var(--negative); }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], input[type=search], select, textarea { width: 100%; height: 36px; border: 1px solid #8396a8; border-radius: 6px; padding: 0 10px; font: inherit; color: var(--text); background: #fff; }
textarea { height: auto; min-height: 90px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.form .full { grid-column: 1 / -1; }

/* Table */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--text2); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--border2); background: #fff; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: #f7f9fb; }
.tbl tr.current td { background: var(--brand-soft); }
.person { display: flex; align-items: center; gap: 10px; }
.person .n { font-weight: 600; color: var(--text); }
.person .t { color: var(--text2); font-size: 12.5px; }

/* Avatar */
.av { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex: none; letter-spacing: .5px; }
.av-s { width: 32px; height: 32px; font-size: 12px; } .av-m { width: 44px; height: 44px; font-size: 15px; } .av-l { width: 96px; height: 96px; font-size: 32px; border: 3px solid #fff; box-shadow: var(--shadow); }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.b-pos { background: var(--positive-bg); color: var(--positive); border-color: #b5d99c; }
.b-neg { background: var(--negative-bg); color: var(--negative); border-color: #ffb5d0; }
.b-crit { background: var(--critical-bg); color: var(--critical); border-color: #f5d45d; }
.b-info { background: var(--info-bg); color: var(--brand-dark); border-color: #a6e0ff; }
.b-neu { background: #eff1f2; color: var(--text2); border-color: #d9d9d9; }

/* Profile header */
.objhdr { background: linear-gradient(120deg, #0a3a6b 0%, #0070f2 60%, #4db1ff 100%); border-radius: var(--radius); color: #fff; padding: 24px; display: flex; gap: 22px; align-items: center; box-shadow: var(--shadow); flex-wrap: wrap; }
.objhdr h1 { color: #fff; font-size: 26px; }
.objhdr .meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 13.5px; opacity: .95; }
.objhdr .meta a { color: #fff; text-decoration: underline; }
.objhdr .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.6); }
.objhdr .btn:hover { background: rgba(255,255,255,.28); }
.anchorbar { position: sticky; top: 52px; z-index: 40; background: var(--bg); display: flex; gap: 4px; padding: 10px 0; margin: 8px 0 12px; border-bottom: 1px solid var(--border2); overflow-x: auto; }
.anchorbar a { padding: 8px 14px; color: var(--text); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.anchorbar a:hover { text-decoration: none; color: var(--brand); }
.anchorbar a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Home */
.hero { display: flex; align-items: flex-end; justify-content: space-between; margin: 10px 0 22px; gap: 12px; flex-wrap: wrap; }
.hero h1 { font-size: 28px; font-weight: 400; }
.hero h1 b { font-weight: 700; }
.qa { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.qa a { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; color: var(--text); display: flex; flex-direction: column; gap: 10px; min-height: 104px; transition: box-shadow .15s; }
.qa a:hover { box-shadow: var(--shadow-l); text-decoration: none; }
.qa .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.qa .tx { font-weight: 600; }
.list-i { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-i:last-child { border-bottom: 0; }
.kpi { font-size: 34px; font-weight: 300; color: var(--brand); line-height: 1.1; }
.kpi small { font-size: 14px; color: var(--text2); }
.team { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 8px; }
.team a { flex: none; width: 128px; text-align: center; color: var(--text); padding: 12px 6px; border-radius: 10px; }
.team a:hover { background: #f2f4f6; text-decoration: none; }
.team .nm { font-weight: 600; margin-top: 8px; font-size: 13px; }
.team .tt { color: var(--text2); font-size: 12px; }
.progress { height: 8px; border-radius: 4px; background: #e5e9ed; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }

/* Admin tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.tile h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
.tile a { display: block; padding: 5px 0; }

/* Org chart */
.org { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 12px 0 40px; overflow-x: auto; }
.org .lvl { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; position: relative; padding: 18px 0; }
.org .line { width: 2px; height: 18px; background: #a9b4be; }
.onode { width: 220px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 12px; display: flex; gap: 10px; align-items: center; color: var(--text); border-top: 4px solid #a9b4be; position: relative; }
.onode:hover { text-decoration: none; box-shadow: var(--shadow-l); }
.onode.focus { border-top-color: var(--brand); width: 260px; transform: scale(1.03); }
.onode.mgr { border-top-color: #5d36ff; }
.onode .n { font-weight: 700; font-size: 13.5px; }
.onode .t { font-size: 12px; color: var(--text2); }
.onode .c { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--text2); }

/* Login */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, #1b90ff 0%, #0a3a6b 55%, #08233f 100%); padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 34px 34px 26px; }
.login-card .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card .logo svg { width: 42px; height: 42px; }
.login-card .logo b { font-size: 22px; }
.login-card .form { grid-template-columns: 1fr; }
.login-card .btn { width: 100%; justify-content: center; height: 40px; margin-top: 8px; }
.demo-users { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; font-size: 12.5px; }
.demo-users table { width: 100%; border-collapse: collapse; }
.demo-users td { padding: 3px 4px; }
.demo-users a { cursor: pointer; }

/* Messages */
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.msg-err { background: var(--negative-bg); color: var(--negative); border-color: #ffb5d0; }
.msg-ok { background: var(--positive-bg); color: var(--positive); border-color: #b5d99c; }
.msg-info { background: var(--info-bg); color: var(--brand-dark); border-color: #a6e0ff; }

dialog { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 0; width: min(760px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog .dh { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
dialog .db { padding: 18px 20px; max-height: 70vh; overflow: auto; }
dialog .df { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border2); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--brand); }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 12px; }
.sandbox-ribbon { background: #fff3b8; color: #6b4a00; font-size: 12px; text-align: center; padding: 3px; border-bottom: 1px solid #f5d45d; }
