/* tema SAP Horizon (light) */
@font-face {
  font-family: '72';
  src: url('https://cdn.jsdelivr.net/npm/@sap-theming/theming-base-content@11.14.0/content/Base/baseLib/baseTheme/fonts/72-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: '72';
  src: url('https://cdn.jsdelivr.net/npm/@sap-theming/theming-base-content@11.14.0/content/Base/baseLib/baseTheme/fonts/72-Semibold.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: '72';
  src: url('https://cdn.jsdelivr.net/npm/@sap-theming/theming-base-content@11.14.0/content/Base/baseLib/baseTheme/fonts/72-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}

:root {
  --ps6Blue: #012169; /* albastrul stemei PS6 */
  --sapBrandColor: #0070F2;
  --sapBrandDark: #0057D2;
  --sapBrandDarker: #0040B0;
  --sapShellColor: #FFFFFF;
  --sapBaseColor: #FFFFFF;
  --sapBackgroundColor: #F5F6F7;
  --sapTextColor: #1D2D3E;
  --sapContentLabel: #556B82;
  --sapNeutralBg: #EFF1F2;
  --sapPositiveColor: #256F3A;
  --sapPositiveBg: #F5FAE5;
  --sapNegativeColor: #AA0808;
  --sapNegativeBg: #FFEAF4;
  --sapNegBgSolid: #FFD6E9;
  --sapCriticalColor: #C35500;
  --sapCriticalBg: #FFF3B8;
  --sapInfoColor: #0057D2;
  --sapInfoBg: #D1EFFF;
  --sapBorder: #D9D9D9;
  --sapBorderLight: #EAECEE;
  --sapHover: #EAF3FC;
  --sapActiveBg: #D1E8FF;
  --sapShadowLvl0: 0 0 0.125rem 0 rgba(34,54,73,.16), 0 0.125rem 0.25rem 0 rgba(34,54,73,.16);
  --sapShadowLvl1: 0 0 0.125rem 0 rgba(34,54,73,.16), 0 0.5rem 1rem 0 rgba(34,54,73,.16);
  --sapShadowLvl2: 0 0 0.25rem 0 rgba(34,54,73,.16), 0 1rem 2rem 0 rgba(34,54,73,.16);
  --sapRadiusS: .5rem;
  --sapRadiusM: .75rem;
  --sapRadiusL: 1rem;
  --sapFont: '72', '72full', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sidebarW: 16rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sapFont);
  font-size: .875rem;
  color: var(--sapTextColor);
  background: var(--sapBackgroundColor);
  -webkit-font-smoothing: antialiased;
}

/* shell bar */
.shellbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 3.25rem;
  background: var(--sapShellColor);
  border-bottom: 1px solid var(--sapBorderLight);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1rem;
  box-shadow: 0 .125rem .5rem rgba(34,54,73,.08);
}
.shellbar .menu-btn {
  width: 2.25rem; height: 2.25rem; border: none; background: transparent;
  border-radius: var(--sapRadiusS); cursor: pointer; color: var(--sapTextColor);
  font-size: 1rem; display: none; align-items: center; justify-content: center;
}
.shellbar .menu-btn:hover { background: var(--sapHover); }
.shell-logo {
  width: 2rem; height: 2rem; border-radius: .5rem;
  background: linear-gradient(135deg, #0070F2, #0040B0);
  color: #fff; font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shell-crest { height: 2.4rem; width: auto; flex-shrink: 0; }
.shell-title { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.shell-subtitle { color: var(--sapContentLabel); font-size: .75rem; white-space: nowrap; }
.shell-spacer { flex: 1; }
.shell-search {
  display: flex; align-items: center; gap: .5rem;
  background: var(--sapNeutralBg); border: 1px solid transparent;
  border-radius: 1.25rem; padding: .4rem .9rem; width: 20rem; max-width: 30vw;
  transition: all .15s;
}
.shell-search:focus-within { background: #fff; border-color: var(--sapBrandColor); box-shadow: 0 0 0 2px rgba(0,112,242,.15); }
.shell-search input { border: none; background: transparent; outline: none; font-family: var(--sapFont); font-size: .85rem; width: 100%; color: var(--sapTextColor); }
.shell-search i { color: var(--sapContentLabel); font-size: .8rem; }
.shell-avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--sapActiveBg); color: var(--sapBrandDark);
  font-weight: 600; font-size: .8rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.shell-icon-btn {
  width: 2.25rem; height: 2.25rem; border: none; background: transparent; border-radius: 50%;
  color: #475E75; cursor: pointer; font-size: .95rem; position: relative;
}
.shell-icon-btn:hover { background: var(--sapHover); }
.shell-badge {
  position: absolute; top: .1rem; right: .1rem; min-width: .9rem; height: .9rem;
  background: var(--sapNegativeColor); color: #fff; border-radius: .45rem;
  font-size: .6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 .2rem;
}

/* sidebar */
.sidebar {
  position: fixed; top: 3.25rem; left: 0; bottom: 0; z-index: 90;
  width: var(--sidebarW);
  background: var(--sapShellColor);
  border-right: 1px solid var(--sapBorderLight);
  padding: .75rem .5rem;
  overflow-y: auto;
  transition: transform .2s ease;
}
.side-group { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sapContentLabel); padding: 1rem .75rem .35rem; }
.side-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .75rem; margin: .1rem 0;
  border-radius: var(--sapRadiusS);
  color: var(--sapTextColor); cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--sapFont); font-size: .85rem;
  transition: background .12s;
}
.side-item i { width: 1.1rem; text-align: center; color: #475E75; font-size: .9rem; }
.side-item:hover { background: var(--sapHover); }
.side-item.active { background: var(--sapActiveBg); color: var(--sapBrandDark); font-weight: 600; }
.side-item.active i { color: var(--sapBrandDark); }
.side-footer { margin-top: 1.5rem; padding: 1rem .75rem; border-top: 1px solid var(--sapBorderLight); text-align: center; }
.side-footer img { max-width: 11rem; width: 100%; height: auto; opacity: .92; }
.side-footer .side-foot-note { font-size: .65rem; color: var(--sapContentLabel); margin-top: .5rem; line-height: 1.4; }

/* main */
.main { margin-left: var(--sidebarW); margin-top: 3.25rem; padding: 1.5rem 2rem 3rem; min-height: calc(100vh - 3.25rem); }
.page-header { margin-bottom: 1.25rem; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.page-desc { color: var(--sapContentLabel); margin-top: .25rem; font-size: .85rem; }
.breadcrumb { font-size: .75rem; color: var(--sapContentLabel); margin-bottom: .35rem; }
.breadcrumb a { color: var(--sapBrandColor); text-decoration: none; }

/* cards */
.card {
  background: var(--sapBaseColor);
  border-radius: var(--sapRadiusM);
  box-shadow: var(--sapShadowLvl0);
  border: 1px solid var(--sapBorderLight);
}
.card-pad { padding: 1.25rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--sapBorderLight); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-title { font-weight: 600; font-size: .95rem; }
.card-sub { font-size: .75rem; color: var(--sapContentLabel); margin-top: .15rem; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi {
  background: var(--sapBaseColor); border-radius: var(--sapRadiusM);
  border: 1px solid var(--sapBorderLight); box-shadow: var(--sapShadowLvl0);
  padding: 1.1rem 1.25rem; cursor: pointer; transition: box-shadow .15s, transform .15s;
  position: relative; overflow: hidden;
}
.kpi:hover { box-shadow: var(--sapShadowLvl1); transform: translateY(-1px); }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: .25rem; background: var(--kpi-accent, var(--sapBrandColor)); }
.kpi-label { font-size: .75rem; color: var(--sapContentLabel); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.kpi-value { font-size: 1.75rem; font-weight: 700; margin-top: .4rem; letter-spacing: -.02em; }
.kpi-value small { font-size: .95rem; font-weight: 600; color: var(--sapContentLabel); }
.kpi-foot { font-size: .72rem; color: var(--sapContentLabel); margin-top: .3rem; }
.kpi.positive { --kpi-accent: var(--sapPositiveColor); } .kpi.positive .kpi-value { color: var(--sapPositiveColor); }
.kpi.negative { --kpi-accent: var(--sapNegativeColor); } .kpi.negative .kpi-value { color: var(--sapNegativeColor); }
.kpi.critical { --kpi-accent: #E76500; } .kpi.critical .kpi-value { color: var(--sapCriticalColor); }
.kpi.neutral { --kpi-accent: #788FA6; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.sap { width: 100%; border-collapse: collapse; font-size: .83rem; }
table.sap th {
  text-align: left; padding: .65rem 1rem; font-size: .72rem; font-weight: 600;
  color: var(--sapContentLabel); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--sapBorder); background: #FAFBFC;
  white-space: nowrap; position: sticky; top: 0;
}
table.sap td { padding: .6rem 1rem; border-bottom: 1px solid var(--sapBorderLight); vertical-align: middle; }
table.sap tr:hover td { background: var(--sapHover); }
table.sap td.num, table.sap th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-empty { text-align: center; padding: 2.5rem; color: var(--sapContentLabel); }

/* Object status (SAP semantic tags) */
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: .5rem; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.status.pozitiv { background: var(--sapPositiveBg); color: var(--sapPositiveColor); }
.status.negativ { background: var(--sapNegBgSolid); color: var(--sapNegativeColor); }
.status.critic  { background: var(--sapCriticalBg); color: var(--sapCriticalColor); }
.status.info    { background: var(--sapInfoBg); color: var(--sapInfoColor); }
.status.neutru  { background: var(--sapNeutralBg); color: #475E75; }

/* buttons */
.btn {
  font-family: var(--sapFont); font-size: .82rem; font-weight: 600;
  padding: .5rem 1rem; border-radius: var(--sapRadiusS);
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: all .12s; white-space: nowrap;
}
.btn-primary { background: var(--sapBrandColor); color: #fff; }
.btn-primary:hover { background: var(--sapBrandDark); }
.btn-ghost { background: transparent; color: var(--sapBrandColor); border-color: var(--sapBrandColor); }
.btn-ghost:hover { background: var(--sapHover); }
.btn-plain { background: transparent; color: var(--sapBrandColor); }
.btn-plain:hover { background: var(--sapHover); }
.btn-sm { padding: .3rem .7rem; font-size: .75rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* forms / filter bar */
.filterbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--sapBorderLight); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-size: .72rem; font-weight: 600; color: var(--sapContentLabel); }
.field input, .field select {
  font-family: var(--sapFont); font-size: .83rem; color: var(--sapTextColor);
  padding: .45rem .7rem; border: 1px solid var(--sapBorder); border-radius: var(--sapRadiusS);
  background: #fff; outline: none; min-width: 10rem;
}
.field input:focus, .field select:focus { border-color: var(--sapBrandColor); box-shadow: 0 0 0 2px rgba(0,112,242,.15); }

/* grid layout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 1100px) { .grid-2, .grid-3-1 { grid-template-columns: 1fr; } }

/* dialog */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(29,45,62,.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(2px); }
.dialog { background: #fff; border-radius: var(--sapRadiusL); box-shadow: var(--sapShadowLvl2); width: 100%; max-width: 28rem; max-height: 90vh; overflow-y: auto; animation: dlgIn .18s ease; }
@keyframes dlgIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.dialog-head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--sapBorderLight); font-weight: 700; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; }
.dialog-body { padding: 1.25rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; }
.dialog-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--sapBorderLight); display: flex; justify-content: flex-end; gap: .6rem; }
.dialog .field input, .dialog .field select { width: 100%; }

/* toast */
#toast-zone { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast { background: #1D2D3E; color: #fff; padding: .7rem 1.3rem; border-radius: .6rem; font-size: .83rem; box-shadow: var(--sapShadowLvl2); animation: dlgIn .2s ease; display: flex; gap: .5rem; align-items: center; }
.toast.success { background: var(--sapPositiveColor); }
.toast.error { background: var(--sapNegativeColor); }

/* portal (chirias) */
.portal-hero {
  background: linear-gradient(120deg, var(--ps6Blue) 0%, #0057D2 55%, #2E8BF7 100%);
  border-radius: var(--sapRadiusL); color: #fff; padding: 1.75rem 2rem;
  margin-bottom: 1.25rem; position: relative; overflow: hidden;
}
.portal-hero::after { content: ''; position: absolute; right: -4rem; top: -4rem; width: 14rem; height: 14rem; border-radius: 50%; background: rgba(255,255,255,.08); }
.portal-hero h2 { font-size: 1.35rem; font-weight: 700; }
.portal-hero .sold { font-size: 2.2rem; font-weight: 700; margin-top: .5rem; letter-spacing: -.02em; }
.portal-hero .meta { opacity: .85; font-size: .8rem; margin-top: .35rem; }

.login-wrap { min-height: calc(100vh - 3.25rem); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { width: 100%; max-width: 24rem; }

/* progress bar (colectare) */
.progress { height: .5rem; border-radius: .25rem; background: var(--sapNeutralBg); overflow: hidden; }
.progress > div { height: 100%; border-radius: .25rem; background: var(--sapBrandColor); transition: width .4s ease; }

.chart-box { position: relative; height: 16rem; padding: 1rem 1.25rem 1.25rem; }

/* skeleton */
.skeleton { background: linear-gradient(90deg, #EFF1F2 25%, #E3E7EA 50%, #EFF1F2 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--sapRadiusS); height: 1rem; }
@keyframes sk { to { background-position: -200% 0; } }

/* footer institutional */
.inst-footer {
  margin-top: 2.5rem; padding: 1.5rem;
  background: var(--ps6Blue); color: #fff;
  border-radius: var(--sapRadiusM);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.inst-footer img { height: 2.4rem; }
.inst-footer .inst-info { font-size: .75rem; line-height: 1.6; opacity: .9; }
.inst-footer .inst-info strong { font-size: .85rem; display: block; opacity: 1; }
.inst-footer a { color: #9CC4FF; text-decoration: none; }
.inst-footer a:hover { text-decoration: underline; }

/* responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--sapShadowLvl2); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; padding: 1rem; }
  .shellbar .menu-btn { display: flex; }
  .shell-search { display: none; }
  .shell-subtitle { display: none; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C6CDD4; border-radius: 5px; border: 2px solid #F5F6F7; }
