:root {
  --bg: #eef4fb;
  --panel: rgba(255, 255, 255, .96);
  --ink: #0a1f44;
  --muted: #64748b;
  --line: #d8e4f1;
  --primary: #0066ff;
  --primary-dark: #0048b8;
  --accent: #00c853;
  --nav: #06152f;
  --danger: #b42318;
  --ok: #00a845;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(242, 247, 252, .92), rgba(232, 241, 249, .94)),
    url("admin-login-bg.png?v=20260728-dashboard-v13");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--ink);
  font-family: Montserrat, Tahoma, Arial, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: 260px;
  background:
    linear-gradient(180deg, rgba(0, 102, 255, .16), transparent 30%),
    var(--nav);
  color: #eef6ff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-left: 1px solid rgba(255, 255, 255, .08);
}
.brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding-bottom: 10px;
}
.brand img {
  width: 94px;
  height: 94px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .22);
}
.brand strong { display: block; font-size: 19px; font-weight: 800; color: #fff; }
.brand small { color: #8fb7ff; letter-spacing: 0; }
nav { display: grid; gap: 8px; }
nav a {
  padding: 13px 14px;
  border-radius: 10px;
  color: #dbeaff;
}
nav a.active, nav a:hover {
  background: rgba(0, 102, 255, .20);
  color: #fff;
  box-shadow: inset -3px 0 0 var(--accent);
}
.userbox {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 16px;
  color: #dbeaff;
}
.userbox a { display: block; margin-top: 8px; color: #73ff9a; }
.main {
  min-height: 100vh;
  padding: 30px;
  margin-right: 260px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(216, 228, 241, .8);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(10, 31, 68, .05);
  backdrop-filter: blur(10px);
}
h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.card, .table-wrap, .form-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(10, 31, 68, .07);
}
.stat {
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.stat strong { display: block; font-size: 26px; margin-top: 4px; }
.stat small { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: right; vertical-align: top; }
th { color: #49627e; font-weight: 800; background: #f5f9ff; }
tbody tr:hover td { background: #fbfdff; }
tr:last-child td { border-bottom: 0; }
.button, button {
  border: 0;
  background: linear-gradient(135deg, var(--primary), #1297ff);
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.button:hover, button:hover { background: linear-gradient(135deg, var(--primary-dark), #006ee6); }
.button.secondary { background: #eaf2ff; color: var(--ink); }
.button.danger { background: var(--danger); }
.full { width: 100%; }
.form { display: grid; gap: 12px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 6px; font-weight: 700; color: #26342f; }
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-line input {
  width: auto;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(0, 102, 255, .52);
  box-shadow: 0 0 0 4px rgba(0, 102, 255, .10);
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eaf2ff;
  color: var(--primary-dark);
  font-size: 13px;
}
.error, .notice {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.error { background: #fff1f0; color: var(--danger); }
.notice { background: #edfced; color: var(--ok); }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  position: relative;
  background:
    linear-gradient(135deg, rgba(3, 16, 38, .14), rgba(0, 102, 255, .08)),
    url("admin-login-bg.png?v=20260728-dashboard-v13") center / cover no-repeat,
    #ffffff;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, .05), rgba(255, 255, 255, .42) 52%, rgba(10, 31, 68, .16)),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(10, 31, 68, .12));
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, .90);
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 18px;
  padding: 34px;
  box-shadow:
    0 32px 90px rgba(10, 31, 68, .28),
    0 0 0 1px rgba(0, 102, 255, .08),
    0 0 0 10px rgba(255, 255, 255, .20);
  backdrop-filter: blur(18px);
  text-align: center;
}
.login-card::before {
  content: "";
  display: block;
  height: 4px;
  margin: -34px -34px 24px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, var(--primary), #19c8ff, var(--accent));
}
.login-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(0, 102, 255, .10);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}
.login-logo {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.login-logo img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 12px 30px rgba(10, 31, 68, .10);
}
.login-card h1 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 25px;
}
.login-card .muted {
  margin: 0 0 22px;
  color: #52657c;
}
.login-card form { text-align: right; }
.login-foot {
  margin-top: 20px;
  color: #6b7f99;
  font-size: 12px;
  font-weight: 700;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title {
  margin: 18px 0 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 30px rgba(10, 31, 68, .05);
}
.section-title h2 { margin-bottom: 4px; }
.eye-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 30px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}
.actions-cell {
  min-width: 190px;
}
.inline-delete {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-inline-start: 6px;
}
.delete-pass {
  width: 120px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}
.split { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; align-items: start; }
.positive { color: var(--ok); font-weight: 800; }
.negative { color: var(--danger); font-weight: 800; }
.share-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.share-summary > div {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}
.share-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.share-summary strong {
  color: var(--ink);
  font-size: 16px;
}
.project-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(10, 31, 68, .07);
}
.project-card h2 { margin-bottom: 4px; }
.project-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
}
.project-card dt {
  color: var(--muted);
  font-weight: 800;
}
.project-card dd {
  margin: 0;
  text-align: left;
  font-weight: 900;
}
.project-picker {
  max-width: 920px;
  margin: 0 auto;
}
.project-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.project-list-item {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}
.project-list-item:hover {
  border-color: rgba(0, 102, 255, .35);
  box-shadow: 0 12px 26px rgba(10, 31, 68, .06);
}
.project-list-item strong {
  font-size: 18px;
}
.project-list-item span {
  color: var(--muted);
}
.project-list-item em {
  font-style: normal;
  color: var(--primary-dark);
  font-weight: 900;
}
.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 138px;
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(170, 196, 220, .82);
  border-radius: 10px;
  background: rgba(255, 255, 255, .90);
  box-shadow: 0 18px 44px rgba(10, 31, 68, .08);
  backdrop-filter: blur(12px);
}
.dashboard-welcome h1 {
  margin-bottom: 7px;
  font-size: 30px;
}
.dashboard-welcome p {
  margin: 0;
  color: var(--muted);
}
.dashboard-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.dashboard-count {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 116px;
  padding: 17px;
  border: 1px solid rgba(190, 208, 225, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 30px rgba(10, 31, 68, .06);
}
.dashboard-count:hover {
  border-color: rgba(0, 102, 255, .42);
  transform: translateY(-1px);
}
.dashboard-count-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 8px;
  background: #e8f1ff;
  color: #075cc8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dashboard-count-icon.green {
  background: #e8f8ee;
  color: #087c3d;
}
.dashboard-count-icon.cyan {
  background: #e7f7f8;
  color: #0d7180;
}
.dashboard-count-icon.amber {
  background: #fff5df;
  color: #9a6400;
}
.dashboard-count-icon .ui-icon {
  width: 24px;
  height: 24px;
}
.dashboard-count div {
  display: grid;
  min-width: 0;
}
.dashboard-count small {
  color: var(--muted);
  font-weight: 800;
}
.dashboard-count strong {
  color: var(--ink);
  font-size: 27px;
  line-height: 1.25;
}
.dashboard-count em {
  overflow: hidden;
  color: #738399;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-finance {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid rgba(169, 195, 218, .75);
  border-radius: 10px;
  background: rgba(7, 27, 56, .94);
  box-shadow: 0 18px 44px rgba(7, 27, 56, .16);
}
.dashboard-finance article {
  min-width: 0;
  min-height: 104px;
  padding: 14px;
  border-left: 1px solid rgba(255, 255, 255, .12);
}
.dashboard-finance article:last-child {
  border-left: 0;
}
.dashboard-finance small,
.dashboard-finance span {
  display: block;
  color: #a9bfd7;
}
.dashboard-finance strong {
  display: block;
  margin: 3px 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 17px;
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}
.dashboard-finance strong.positive {
  color: #74e69d;
}
.dashboard-finance strong.negative {
  color: #ffaaa3;
}
.dashboard-finance span {
  font-size: 11px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.dashboard-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(185, 205, 224, .88);
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 34px rgba(10, 31, 68, .07);
}
.dashboard-panel.activity-panel {
  grid-column: 1 / -1;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin: 0;
}
.panel-head > a {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}
.finance-progress {
  display: grid;
  gap: 17px;
}
.progress-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-weight: 800;
}
.progress-row > div:first-child strong {
  color: #405b76;
}
.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5edf5;
}
.progress-track span {
  display: block;
  height: 100%;
  background: #1473e6;
}
.progress-track span.green {
  background: #16a05d;
}
.progress-track span.amber {
  background: #d49625;
}
.progress-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.dashboard-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.dashboard-mini-grid div {
  display: grid;
  gap: 2px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafc;
}
.dashboard-mini-grid span {
  color: var(--muted);
  font-size: 12px;
}
.dashboard-mini-grid strong {
  font-size: 19px;
}
.recent-projects,
.dashboard-activity {
  display: grid;
  gap: 8px;
}
.recent-projects > a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 57px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.recent-projects > a:last-child {
  border-bottom: 0;
}
.project-mark {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: #edf4ff;
  color: #075cc8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.recent-projects div {
  display: grid;
  min-width: 0;
}
.recent-projects small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-projects b {
  font-size: 13px;
}
.recent-projects em {
  min-width: 58px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf8f1;
  color: #087c3d;
  text-align: center;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.dashboard-activity {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-activity > div {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.dashboard-activity > div > div {
  display: grid;
  min-width: 0;
}
.dashboard-activity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-activity small {
  color: var(--muted);
}
.activity-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  margin-top: 8px;
  border-radius: 50%;
  background: #17a45b;
  box-shadow: 0 0 0 4px #e7f7ee;
}
.project-editor {
  margin-bottom: 18px;
}
.project-editor-head,
.project-editor-actions,
.directory-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.project-editor-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.project-editor-head h2,
.directory-title h2 {
  margin: 0;
}
.project-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.project-notes {
  grid-column: span 2;
}
.project-notes textarea {
  min-height: 46px;
}
.project-editor-actions {
  justify-content: flex-start;
  margin-top: 15px;
}
.projects-directory {
  margin-top: 14px;
}
.directory-title {
  margin-bottom: 12px;
}
.directory-title p {
  margin: 4px 0 0;
}
.projects-table .button.compact {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 12px;
}
.projects-table .actions-cell {
  min-width: 260px;
}
.report-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.report-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}
.report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  padding: 18px 20px;
  border: 1px solid rgba(180, 203, 223, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 28px rgba(10, 31, 68, .06);
}
.report-heading h2,
.report-heading p {
  margin: 0;
}
.report-heading > span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf3f8;
  color: #49627e;
  font-size: 13px;
  font-weight: 900;
}
.report-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.report-kpis > div {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(187, 207, 225, .92);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
}
.report-kpis small {
  display: block;
  color: var(--muted);
}
.report-kpis strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 18px;
}
.report-table {
  margin-bottom: 14px;
}
.report-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.report-table-head h3 {
  margin: 0;
}
.report-table-head span {
  color: var(--muted);
}
.report-table-head strong {
  color: #087c3d;
}
.report-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 46px 20px;
  border: 1px dashed #afc5da;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--muted);
  text-align: center;
}
.report-empty .ui-icon {
  width: 36px;
  height: 36px;
  color: #087c3d;
}
.ui-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}
.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: #087c3d;
  font-size: 12px;
  font-weight: 900;
}
.movement-box {
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
}
.movement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.movement-head h2 {
  margin-bottom: 5px;
}
.movement-head p {
  margin: 0;
}
.movement-selector {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, .55fr);
  gap: 14px;
  padding: 18px 22px;
  background: #f5f8fc;
  border-bottom: 1px solid var(--line);
}
.movement-selector select,
.movement-selector input {
  background: #fff;
  font-weight: 800;
}
.movement-panel {
  padding: 20px 22px;
}
.purchase-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.purchase-editor {
  overflow: hidden;
  border: 1px solid #ccd9e8;
  border-radius: 8px;
  background: #fff;
}
.purchase-line-head,
.purchase-item-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(150px, .55fr) minmax(180px, .9fr) 170px 44px;
  gap: 10px;
  align-items: center;
}
.purchase-line-head {
  padding: 11px 14px;
  background: #10243e;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.purchase-items {
  display: grid;
}
.purchase-item-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.purchase-item-row:nth-child(even) {
  background: #f9fbfd;
}
.purchase-item-row > label {
  min-width: 0;
}
.purchase-item-row > label > span:first-child,
.field-caption {
  display: none;
}
.purchase-item-row input {
  min-width: 0;
}
.purchase-money-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.purchase-money-input b {
  padding: 0 10px;
  color: #60738a;
  font-size: 13px;
  white-space: nowrap;
}
.purchase-money-input input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}
.purchase-receipt {
  min-width: 0;
}
.receipt-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid #cbd8e7;
  border-radius: 8px;
  background: #eef4fa;
  color: #23405f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-button:hover {
  border-color: #6698d3;
  background: #e2efff;
  color: #0048b8;
}
.icon-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.attachment-eye {
  color: #087c3d;
  background: #edf9f2;
  border-color: #bde5cc;
}
.selected-file-name {
  display: block;
  max-width: 165px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remove-purchase-item {
  color: #8d2b23;
  background: #fff4f2;
  border-color: #f0cbc6;
}
.purchase-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  background: #f3f7fb;
}
.purchase-total {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.purchase-total span {
  color: var(--muted);
  font-weight: 800;
}
.purchase-total strong {
  color: #087c3d;
  font-size: 22px;
}
.compact-movement-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.movement-submit {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px 22px;
}
.purchase-history {
  margin-top: 16px;
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.history-head h2 {
  margin: 0;
}
.history-count {
  min-width: 84px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf3f8;
  color: #405b76;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 18px;
  border: 1px dashed #bed0e2;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
  text-align: center;
}
.empty-state .ui-icon {
  width: 30px;
  height: 30px;
  color: #087c3d;
}
.empty-state strong {
  color: var(--ink);
}
.purchase-records {
  display: grid;
  gap: 10px;
}
.purchase-record {
  border: 1px solid #d4dfeb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.purchase-record[open] {
  border-color: #a9c2dc;
  box-shadow: 0 10px 24px rgba(10, 31, 68, .07);
}
.purchase-record summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px 170px;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  background: #fbfdff;
}
.purchase-record summary::-webkit-details-marker {
  display: none;
}
.purchase-record summary > span {
  color: var(--muted);
  font-weight: 800;
}
.purchase-record summary > b {
  color: #087c3d;
  font-size: 18px;
  text-align: left;
}
.purchase-summary-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.purchase-summary-main time {
  min-width: 100px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #10243e;
  color: #fff;
  direction: ltr;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.purchase-summary-main div {
  display: grid;
}
.purchase-summary-main small {
  color: var(--muted);
}
.purchase-record-body {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}
.purchase-note {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-right: 3px solid #0aa453;
  background: #f1faf5;
}
.responsive-table {
  overflow-x: auto;
}
.purchase-record tfoot td {
  background: #f3f7fb;
  color: var(--ink);
  font-weight: 900;
}
.view-receipt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #087c3d;
  font-weight: 900;
}
.view-receipt .ui-icon {
  width: 17px;
  height: 17px;
}
.purchase-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.purchase-delete {
  display: flex;
  align-items: center;
  gap: 7px;
}
.purchase-delete input {
  width: 150px;
  min-height: 42px;
}
.doc-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}
.doc-line-head {
  display: grid;
  grid-template-columns: 1fr 140px 190px 210px;
  gap: 8px;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 800;
}
.items-editor { display: grid; gap: 10px; }
.item-row {
  display: grid;
  grid-template-columns: 1fr 140px 190px 210px;
  gap: 8px;
  align-items: center;
}
.item-row input {
  font-weight: 700;
  font-size: 15px;
}
.money-input,
.currency-input,
.percent-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
}
.money-input span,
.currency-input b,
.percent-input b {
  color: #64748b;
  font-weight: 800;
}
.money-input input,
.currency-input input,
.percent-input input {
  border: 0;
  box-shadow: none;
  text-align: left;
  padding-left: 0;
}
.line-amount {
  min-height: 46px;
  display: flex;
  align-items: center;
  color: #111827;
  font-weight: 800;
  padding: 0 12px;
}
.add-line {
  width: 100%;
  min-height: 44px;
  background: #eef2f7;
  color: #334155;
}
.doc-totals-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: start;
}
.totals-panel {
  display: grid;
  gap: 12px;
  padding: 10px 0 0;
}
.totals-panel > div,
.totals-panel label {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 18px;
  align-items: center;
  color: #475569;
  font-size: 17px;
  font-weight: 800;
}
.totals-panel strong {
  color: #0f172a;
  text-align: right;
}
.grand-total {
  border-top: 2px solid #d7dde7;
  padding-top: 18px;
  margin-top: 8px;
  color: #0f172a !important;
  font-size: 22px !important;
}
.invoice-sheet {
  width: min(980px, 100%);
  min-height: 1180px;
  margin: 0 auto;
  background: #fff;
  color: #3c3c3c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 48px 48px 34px;
  box-shadow: 0 18px 50px rgba(10, 31, 68, .10);
  direction: ltr;
  font-family: Arial, sans-serif;
}
.invoice-head {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: start;
}
.company-block img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: 20px;
}
.company-block p { font-size: 16px; line-height: 1.28; margin: 0; }
.invoice-title { text-align: right; }
.invoice-title h1 {
  font-size: 42px;
  font-weight: 400;
  color: #3a3a3a;
  margin: 0;
}
.invoice-title > p {
  font-size: 20px;
  color: #777;
  margin: 4px 0 54px;
}
.invoice-title dl,
.invoice-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  margin: 0;
  font-size: 17px;
}
.invoice-title dt,
.invoice-summary dt { color: #777; text-align: right; }
.invoice-title dd,
.invoice-summary dd { margin: 0; color: #333; text-align: right; }
.invoice-total {
  margin-top: 18px;
  background: #f1f1f1;
  border-radius: 6px;
  padding: 12px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 42px;
  font-size: 20px;
}
.invoice-parties {
  display: grid;
  grid-template-columns: 230px 230px;
  gap: 56px;
  margin: 34px 0 72px;
  font-size: 17px;
}
.invoice-parties span { display: block; color: #777; margin-bottom: 6px; }
.invoice-parties strong { display: block; color: #333; }
.invoice-parties p { margin: 0; line-height: 1.25; }
.invoice-table th {
  background: #0f172a;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  text-align: right;
}
.invoice-table th:first-child,
.invoice-table td:first-child { text-align: left; }
.invoice-table td {
  border-bottom: 0;
  font-size: 16px;
  padding: 7px 24px;
  text-align: right;
}
.invoice-bottom {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 44px;
  margin-top: 70px;
}
.invoice-notes {
  color: #666;
  font-size: 15px;
}
.invoice-summary {
  font-size: 17px;
  gap: 14px 28px;
}
.invoice-summary dt:last-of-type,
.invoice-summary dd:last-of-type {
  color: #333;
  font-weight: 800;
  font-size: 19px;
}
.invoice-footer {
  margin-top: 80px;
  color: #6d7b90;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }
  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    width: auto;
    min-height: 0;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 10px 30px rgba(6, 21, 47, .18);
  }
  .brand {
    display: flex;
    align-items: center;
    justify-items: initial;
    gap: 8px;
    padding: 0;
    text-align: right;
  }
  .brand img {
    width: 42px;
    height: 42px;
    padding: 5px;
    border-radius: 7px;
    box-shadow: none;
  }
  .brand strong {
    font-size: 14px;
    white-space: nowrap;
  }
  .brand small {
    display: none;
  }
  nav {
    display: flex;
    gap: 5px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }
  nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
  }
  nav a.active,
  nav a:hover {
    box-shadow: inset 0 -3px 0 var(--accent);
  }
  .userbox {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 0;
  }
  .userbox a {
    margin: 0;
    padding: 8px 7px;
    font-size: 12px;
    white-space: nowrap;
  }
  .main { margin-right: 0; padding: 18px; }
  .stats, .two, .three, .split, .share-summary, .project-list-item, .item-row, .doc-line-head, .doc-totals-grid, .invoice-head, .invoice-parties, .invoice-bottom, .movement-selector, .purchase-meta, .compact-movement-panel { grid-template-columns: 1fr; }
  .dashboard-welcome {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
  }
  .dashboard-counts,
  .dashboard-finance,
  .project-editor-grid,
  .report-filters,
  .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-finance article {
    min-height: 90px;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
  .dashboard-finance article:last-child {
    border-bottom: 0;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-panel.activity-panel {
    grid-column: auto;
  }
  .dashboard-activity {
    grid-template-columns: 1fr;
  }
  .project-notes {
    grid-column: 1 / -1;
  }
  .movement-head { align-items: stretch; flex-direction: column; }
  .purchase-line-head { display: none; }
  .purchase-item-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  .purchase-item-row > label > span:first-child,
  .field-caption {
    display: block;
    color: #4b6178;
    font-size: 12px;
    font-weight: 800;
  }
  .purchase-receipt {
    display: grid;
    gap: 6px;
  }
  .remove-purchase-item {
    justify-self: end;
  }
  .selected-file-name {
    max-width: 100%;
  }
  .purchase-editor-foot,
  .movement-submit,
  .purchase-record-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .purchase-total {
    justify-content: space-between;
  }
  .purchase-record summary {
    grid-template-columns: 1fr auto;
  }
  .purchase-record summary > span {
    text-align: left;
  }
  .purchase-record summary > b {
    grid-column: 1 / -1;
    text-align: right;
  }
  .purchase-summary-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .purchase-delete {
    align-items: stretch;
    flex-direction: column;
  }
  .purchase-delete input {
    width: 100%;
  }
  .grid > * {
    min-width: 0;
  }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }
  .purchase-history {
    overflow: visible;
  }
  .topbar { align-items: stretch; flex-direction: column; }
  table { font-size: 14px; }
  .invoice-sheet { padding: 24px; min-height: auto; }
  .invoice-title { text-align: left; }
}

@media (max-width: 560px) {
  .sidebar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 8px;
  }
  .brand img {
    width: 38px;
    height: 38px;
  }
  .brand strong {
    display: none;
  }
  nav a {
    padding: 7px 9px;
    font-size: 12px;
  }
  .userbox a {
    padding: 7px 4px;
    font-size: 11px;
  }
  .main {
    padding: 12px;
  }
  .dashboard-welcome {
    padding: 20px;
  }
  .dashboard-welcome h1 {
    font-size: 24px;
  }
  .dashboard-counts,
  .dashboard-finance,
  .dashboard-mini-grid,
  .project-editor-grid,
  .report-filters,
  .report-kpis {
    grid-template-columns: 1fr;
  }
  .dashboard-count {
    min-height: 96px;
  }
  .dashboard-panel {
    padding: 16px;
  }
  .recent-projects > a {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }
  .recent-projects > a b {
    grid-column: 2 / -1;
  }
  .project-editor-head,
  .project-editor-actions,
  .directory-title,
  .report-heading,
  .report-table-head {
    align-items: stretch;
    flex-direction: column;
  }
  .project-editor-actions .button,
  .project-editor-actions button,
  .report-filter-actions .button,
  .report-filter-actions button {
    width: 100%;
  }
  .report-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .report-heading > span {
    align-self: flex-start;
  }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar.no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
  .invoice-sheet {
    width: 100%;
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 36px 42px;
  }
  @page { size: letter; margin: 0.35in; }
}
