/* MinFinanceG — minimal presentation deck */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: #17202a;
  background: #f4f6f8;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
  background: #0b2a4a;
  color: #fff;
  border-bottom: 3px solid #c79a3e;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.brand { font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; letter-spacing: .5px; }
.brand span { color: #c79a3e; }
.topnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav a {
  padding: 6px 10px; border-radius: 6px;
  color: #d5dce5; text-decoration: none; font-size: 13px; white-space: nowrap;
}
.topnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topnav a.active { background: #c79a3e; color: #0b2a4a; font-weight: 600; }
.edit-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.edit-btn:hover { background: rgba(255,255,255,.1); }
body.edit-mode .edit-btn { background: #c79a3e; color: #0b2a4a; border-color: #c79a3e; }

/* Deck */
.deck { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }

/* Cover */
.cover { padding: 60px 0 20px; }
.cover-inner { text-align: center; }
.eyebrow { color: #c79a3e; font-size: 12px; font-weight: 700; letter-spacing: 2px; margin-bottom: 20px; }
.cover h1 { font-size: 56px; line-height: 1.05; margin-bottom: 10px; color: #0b2a4a; }
.cover h2 { font-size: 24px; font-weight: 400; color: #3c5673; margin-bottom: 20px; }
.lead { max-width: 720px; margin: 0 auto 40px; font-size: 17px; color: #4a5a6e; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-top: 30px; text-align: left;
}
.card {
  background: #fff; border: 1px solid #e4e8ed; border-radius: 10px;
  padding: 18px; text-decoration: none; color: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.card:hover { transform: translateY(-2px); border-color: #c79a3e; box-shadow: 0 6px 14px rgba(11,42,74,.08); }
.card .num { color: #c79a3e; font-weight: 700; font-size: 13px; }
.card .t { font-size: 17px; font-weight: 600; color: #0b2a4a; }
.card .sub { font-size: 13px; color: #6b7a8c; }

/* Slide */
.slide { background: #fff; border-radius: 12px; padding: 36px 44px; box-shadow: 0 2px 10px rgba(11,42,74,.05); }
.slide-head { border-bottom: 2px solid #0b2a4a; padding-bottom: 14px; margin-bottom: 22px; position: relative; }
.slide-head .ord {
  position: absolute; right: 0; top: 0;
  font-size: 48px; font-weight: 700; color: #c79a3e; opacity: .35;
}
.slide-head h1 { font-size: 30px; color: #0b2a4a; margin-bottom: 6px; }
.slide-head .sub { font-size: 15px; font-weight: 400; color: #5d6d82; }
.slide-body { margin-bottom: 22px; font-size: 15px; color: #2d3e54; }
.slide-body p { margin-bottom: 10px; }
.slide-body b { color: #0b2a4a; }

/* Stats row */
.stats { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 160px;
  background: linear-gradient(135deg, #0b2a4a 0%, #1d4676 100%);
  color: #fff; border-radius: 10px; padding: 20px; text-align: center;
}
.stat .n { display: block; font-size: 34px; font-weight: 700; color: #c79a3e; }
.stat .l { display: block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #d5dce5; margin-top: 4px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-2 h4 { font-size: 13px; color: #6b7a8c; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 7px 10px; text-align: left; border-bottom: 1px solid #eef1f4; vertical-align: top; }
table.data th { background: #f7f9fb; color: #3c5673; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.data tr.sub th { background: #fafbfc; font-size: 11px; color: #8593a4; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data tbody tr:hover { background: #fafcfd; }

/* Region edit mode */
table.regions.edit-on .cell { background: #fff8e6; cursor: text; outline: 1px dashed #c79a3e; }
table.regions .del, table.regions .del-pos { background: transparent; border: none; color: #b0bcca; font-size: 18px; cursor: pointer; padding: 0 6px; }
table.regions.edit-on .del, table.regions.edit-on .del-pos { color: #d94e4e; }
table.regions .del:hover, table.regions .del-pos:hover { color: #d94e4e; }
table.regions .add, table.regions .add-pos { background: #0b2a4a; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
table.regions .add:hover, table.regions .add-pos:hover { background: #1d4676; }
table.regions .expand { background: transparent; border: 1px solid #c79a3e; color: #8a6b2a; padding: 2px 8px; border-radius: 4px; font-size: 11px; cursor: pointer; margin-left: 8px; }
table.regions .expand:hover { background: #c79a3e; color: #0b2a4a; }

/* Nested pos_schedule table */
tr.pos-wrap > td { background: #f7f9fb; padding: 8px 20px !important; }
table.pos { width: 100%; font-size: 12px; background: #fff; border-radius: 6px; overflow: hidden; }
table.pos thead th { background: #0b2a4a; color: #c79a3e; font-size: 11px; padding: 6px 8px; }
table.pos tbody tr.grouper { background: #f0f3f7; font-weight: 600; color: #0b2a4a; }
table.pos tbody tr.grouper td { border-top: 1px solid #d5dce5; }
table.pos td { padding: 5px 8px; }
.pos-total { margin-left: 14px; color: #5d6d82; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Editable */
.editable { outline: none; }
body.edit-mode .editable {
  background: #fff8e6;
  outline: 1px dashed #c79a3e;
  border-radius: 4px;
  padding: 4px 6px;
}
body.edit-mode .editable[contenteditable="true"] { cursor: text; }

/* Chart embed */
.chart-wrap { margin-top: 10px; background: #f7f9fb; border-radius: 10px; padding: 12px; }
.chart-wrap iframe { width: 100%; height: 640px; border: none; background: #fff; border-radius: 6px; }
.chart-wrap .note { font-size: 12px; color: #6b7a8c; margin-top: 8px; text-align: center; }

/* Charts row */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.chart-box { background: #fff; border: 1px solid #e4e8ed; border-radius: 10px; padding: 16px; }
.chart-box.full { grid-column: 1 / -1; }
.chart-box h4 { font-size: 12px; color: #6b7a8c; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
@media (max-width: 800px) { .charts-row { grid-template-columns: 1fr; } }

/* Org tree */
.org-tree, .org-tree ul { list-style: none; padding: 0; margin: 0; }
.org-tree { display: inline-block; padding: 8px 0; }
.org-tree > li { display: flex; flex-direction: column; align-items: flex-start; }
.org-tree li { position: relative; }
.org-tree ul { padding-left: 32px; margin-top: 8px; }
.org-tree ul > li { padding-top: 8px; }
.org-tree ul > li::before {
  content: ''; position: absolute; left: -18px; top: 0;
  width: 18px; height: 20px;
  border-left: 1.5px solid #c3cdd8; border-bottom: 1.5px solid #c3cdd8;
  border-bottom-left-radius: 4px;
}
.org-tree ul > li:not(:last-child)::after {
  content: ''; position: absolute; left: -18px; top: 20px;
  width: 0; height: calc(100% - 12px);
  border-left: 1.5px solid #c3cdd8;
}
.node {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 1px solid #d5dce5; border-radius: 8px;
  background: #fff; font-size: 13px; color: #17202a; white-space: nowrap;
}
.node.focal {
  background: linear-gradient(135deg, #0b2a4a, #1d4676);
  color: #fff; border-color: #0b2a4a; font-weight: 600; font-size: 15px; border-radius: 10px;
}
.node.role { background: #f0f4fa; border-color: #c3cdd8; font-weight: 600; }
.node.dept { background: #fdf8ee; border-color: #e8d9a0; }
.count {
  font-size: 11px; font-weight: 700; color: #c79a3e;
  background: rgba(199,154,62,.12); border-radius: 10px; padding: 1px 7px;
}
.node.focal .count { color: #f5d98a; background: rgba(255,255,255,.15); }
.org-wrap { background: #fff; border: 1px solid #e4e8ed; border-radius: 10px; padding: 24px 24px 24px 16px; overflow-x: auto; margin-top: 12px; }
.tree-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tree-version-badge { font-size: 12px; background: #e8f0e0; color: #2d6a1c; border-radius: 20px; padding: 3px 10px; font-weight: 600; }
.btn-sm { font-size: 12px; padding: 5px 12px; border-radius: 6px; text-decoration: none; border: 1px solid #d5dce5; background: #fff; color: #17202a; cursor: pointer; }
.btn-sm:hover { background: #f0f4fa; }
.btn-sm.primary { background: #0b2a4a; color: #fff; border-color: #0b2a4a; }
.btn-sm.primary:hover { background: #1d4676; }

/* Pager */
.pager {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: #5d6d82;
}
.pager a { color: #0b2a4a; text-decoration: none; font-weight: 600; padding: 6px 12px; border-radius: 6px; }
.pager a:hover { background: #e4e8ed; }
.pager .ord { font-variant-numeric: tabular-nums; color: #8593a4; }

@media (max-width: 800px) {
  .cover h1 { font-size: 36px; }
  .grid-2 { grid-template-columns: 1fr; }
  .slide { padding: 24px 18px; }
  .slide-head .ord { font-size: 32px; }
}
