/* ================================================================
   EAPRO GLOBAL ENERGY PVT LTD — Dynamics 365 Business Central UI System
   Replicated exactly from Design Reference / index.html
   ================================================================ */
:root {
  --topbar: #282828;
  --page: #FFFFFF;
  --surface: #F6F7F8;
  --flyout: #FAF9F8;
  --backdrop: #B3B3B4;

  --accent: #008489;
  --accent-dark: #007E87;
  --accent-deep: #00686F;
  --tile: #00838F;
  --tile-hover: #00626B;
  --tile-grey: #E5E7E9;
  --banner: #E5F5F6;
  --badge: #75D8FF;
  --avatar: #498205;
  --back-btn: #D9F0F2;
  --row-sel: #B2E9ED;

  --ink: #212121;
  --ink-dark: #0F172A;
  --ink-muted: #505C6D;
  --ink-disabled: #A7ADB6;

  --rule: #D8D8D8;
  --surface-border: #D8DEE4;
  --grid-rule: #C1C6CB;
  --field-border: #8D95A0;
  --field-readonly: #EBEDEF;
  --leader: #B1B1B2;
  --scroll: #8B8B8B;

  --font: "Segoe UI", "Segoe UI Web (West European)", -apple-system,
          BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 11px;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
::selection { background: #3367D1; color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #FCFCFC; }
::-webkit-scrollbar-thumb { background: var(--scroll); border: 2px solid #FCFCFC; border-radius: 5px; }

/* =========================  APP BAR  ========================= */
.appbar {
  background: var(--topbar);
  height: 45px;
  display: flex;
  align-items: center;
  padding: 0 14.5px 0 19px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.appbar__brand {
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.appbar__brand:hover { opacity: 0.95; }
.appbar__spacer { flex: 1; }
.appbar__tools { display: flex; align-items: center; gap: 4px; }
.company-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--badge);
  color: var(--topbar);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  margin-right: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
}
.company-badge:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.iconbtn {
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 13px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.iconbtn:hover { background: rgba(255,255,255,.15); }
.avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--avatar);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  border: none;
}

/* =================  AVAILABLE COMPANIES FLYOUT  ================= */
.flyout {
  position: fixed;
  top: 45px;
  right: 0;
  width: 320px;
  background: var(--flyout);
  box-shadow: -2px 3px 12px rgba(0,0,0,.2);
  z-index: 1050;
  display: none;
  padding-bottom: 12px;
}
.flyout.is-open { display: block; }
.flyout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 19px 10px;
}
.flyout__head h2 { font-size: 16px; font-weight: 600; color: #323130; margin: 0; }
.flyout__close {
  width: 28px;
  height: 28px;
  color: #605E5C;
  font-size: 13px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flyout__close:hover { background: #F0EFEE; }
.co-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 19px;
  min-height: 46px;
  border: none;
  background: transparent;
}
.co-row:hover { background: #F0EFEE; }
.co-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--ink);
  font-size: 8.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.co-name { font-size: 12.5px; color: var(--ink); flex: 1; }

/* =====================  MODULE NAV + DROPDOWN  ===================== */
.navbar {
  background: var(--page);
  position: relative;
  z-index: 900;
  border-bottom: 1px solid var(--rule);
}
.navbar__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 8px 18px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.company-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .12px;
  color: var(--ink);
  padding-bottom: 6px;
}
.vrule {
  width: 1px;
  height: 18px;
  background: var(--rule);
  flex-shrink: 0;
  margin-bottom: 6px;
}
.modules {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.mod-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
  padding: 4px 6px 8px;
  border-bottom: 2px solid transparent;
  transition: all .12s;
}
.mod-link i { font-size: 7px; opacity: .85; }
.mod-link:hover { color: var(--ink); }
.mod-link.is-active, .mod-link.is-open {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.dropdown-mega {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.dropdown-mega.is-open { display: block; }
.dropdown-mega__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 18px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.dd-group__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dd-group__title i { color: var(--accent); }
.dd-group__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dd-sublink {
  color: var(--accent-dark);
  font-size: 11.5px;
  text-decoration: none;
}
.dd-sublink:hover { text-decoration: underline; color: var(--accent-deep); }

/* =====================  PAGE WRAPPER  ===================== */
.main-content {
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px 18px 24px;
  min-height: calc(100vh - 100px);
}
.bc-page-header {
  padding: 2px 0 8px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 8px;
}
.bc-breadcrumb {
  font-size: 11px;
  color: var(--ink-muted);
}
.bc-breadcrumb a {
  color: var(--accent);
}
.bc-breadcrumb a:hover {
  text-decoration: underline;
}
.bc-container {
  padding: 4px 0 !important;
}

/* =====================  CUES & TILES  ===================== */
.activities { margin-top: 20px; }
.activities__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}
.activities__rule { height: 1px; background: var(--rule); margin-bottom: 16px; }
.cuegroups { display: flex; gap: 28px; flex-wrap: wrap; }
.cuegroup__title { font-size: 11px; font-weight: 600; margin: 0 0 8px; color: var(--ink-muted); }
.tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.tile {
  width: 130px;
  height: 98px;
  flex-shrink: 0;
  background: var(--tile);
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  transition: all .15s;
  border-radius: 2px;
  text-decoration: none;
}
.tile:hover { background: var(--tile-hover); transform: translateY(-1px); }
.tile--accent { background: #007E87; }
.tile--purple { background: #5C2D91; }
.tile--amber  { background: #D83B01; }
.tile--green  { background: #107C41; }
.tile__label { font-size: 11px; line-height: 1.25; font-weight: 400; }
.tile__value { margin-top: auto; font-size: 26px; font-weight: 300; line-height: 1; }

/* =====================  KPI CARDS & SUMMARY  ===================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kpi-card__title { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.kpi-card__val { font-size: 22px; font-weight: 600; color: var(--ink); margin: 6px 0 2px; }
.kpi-card__sub { font-size: 10.5px; color: var(--accent); }

/* =========================  COMMAND BAR  ========================= */
.cmdbar {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  flex-wrap: wrap;
}
.cmdbar__title { font-size: 13px; font-weight: 600; margin-right: 12px; }
.cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.cmd-btn:hover { background: #EBEDEF; border-color: var(--field-border); }
.cmd-btn--primary { background: var(--accent); color: #fff; border-color: var(--accent-dark); }
.cmd-btn--primary:hover { background: var(--accent-dark); color: #fff; }
.cmdbar__spacer { flex: 1; }

/* =========================  DATA GRID  ========================= */
.grid-container {
  background: #fff;
  border: 1px solid var(--rule);
  border-top: none;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
table.bc-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 11.5px;
}
table.bc-grid thead th {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: left;
  vertical-align: bottom;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grid-rule);
  background: #F3F4F6;
  white-space: nowrap;
}
table.bc-grid tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #EAEAEA;
  white-space: nowrap;
  color: var(--ink);
}
table.bc-grid tbody tr { background: #fff; transition: background .08s; }
table.bc-grid tbody tr:hover { background: #F4F7F9; }
table.bc-grid tbody tr.is-selected { background: var(--row-sel); }
.num-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* =========================  FILTER BAR  ========================= */
.filter-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.filter-input, .filter-select {
  height: 28px;
  border: 1px solid var(--field-border);
  background: #fff;
  padding: 0 8px;
  font-family: inherit;
  font-size: 11.5px;
  border-radius: 2px;
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--accent); }

/* =========================  COMPACT REPORT DESIGN SYSTEM (.rpt-*)  ========================= */
.rpt-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 6px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 8px;
}
.rpt-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.rpt-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rpt-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
}
.rpt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rpt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 3px;
  border: 1px solid #CBD5E1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.rpt-btn:hover { background: #F1F5F9; border-color: #94A3B8; }
.rpt-btn--primary { background: #008489; color: #fff; border-color: #008489; }
.rpt-btn--primary:hover { background: #006E73; color: #fff; border-color: #006E73; }
.rpt-btn--excel { background: #107C41; color: #fff; border-color: #107C41; }
.rpt-btn--excel:hover { background: #0C5E31; color: #fff; border-color: #0C5E31; }
.rpt-btn--dark { background: #0F172A; color: #fff; border-color: #0F172A; }
.rpt-btn--dark:hover { background: #1E293B; color: #fff; }

.rpt-compact-strip {
  display: none;
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-left: 4px solid #008489;
  border-radius: 4px;
  padding: 5px 12px;
  margin-bottom: 8px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
}
.rpt-filter-bar {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.rpt-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.rpt-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 115px;
}
.rpt-field label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.rpt-input, .rpt-select {
  height: 27px;
  padding: 2px 8px;
  font-size: 11.5px;
  border: 1px solid #CBD5E1;
  border-radius: 3px;
  background: #fff;
  color: #0F172A;
  font-family: inherit;
}
.rpt-input:focus, .rpt-select:focus {
  outline: none;
  border-color: #008489;
  box-shadow: 0 0 0 2px rgba(0,132,137,0.12);
}

.rpt-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.rpt-kpi {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #008489;
  border-radius: 4px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.rpt-kpi__label {
  font-size: 9.5px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.rpt-kpi__val {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  margin-top: 2px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.rpt-kpi__sub {
  font-size: 10px;
  color: #64748B;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpt-grid-card {
  background: #fff;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.rpt-grid-toolbar {
  padding: 6px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rpt-grid-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 285px);
}
table.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.rpt-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0F172A;
  color: #fff;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-right: 1px solid rgba(255,255,255,0.12);
}
table.rpt-table tbody td {
  padding: 4.5px 8px;
  border-bottom: 1px solid #E2E8F0;
  color: #1E293B;
  vertical-align: middle;
}
table.rpt-table tbody tr {
  transition: background-color 0.08s ease;
}
table.rpt-table tbody tr:hover {
  background-color: #F0FDF4 !important;
}
table.rpt-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 9;
  background: #F1F5F9;
  font-weight: 800;
  padding: 6px 8px;
  border-top: 2px solid #008489;
  color: #0F172A;
}

/* =========================  LOGIN PAGE  ========================= */
.login-body {
  background: #F2F4F7;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: #fff;
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 4px;
}
.login-logo {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-sub { font-size: 12px; color: var(--ink-muted); margin-bottom: 24px; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 4px; }
.form-input {
  width: 100%;
  height: 34px;
  border: 1px solid #B0B5BC;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  border-radius: 2px;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.btn-login {
  width: 100%;
  height: 36px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background .12s;
}
.btn-login:hover { background: var(--accent-dark); }
.login-error {
  background: #FDE7E9;
  border: 1px solid #F8B4B8;
  color: #A80000;
  padding: 8px 12px;
  font-size: 11.5px;
  border-radius: 2px;
  margin-bottom: 16px;
}

