:root {
  color-scheme: light;
  --ink: #111a24;
  --muted: #667386;
  --line: #d7e0ea;
  --soft: #f5f8fb;
  --panel: #ffffff;
  --navy: #102941;
  --blue: #147fc1;
  --teal: #1599a3;
  --green: #20744a;
  --amber: #c98317;
  --bad: #b7472a;
  --shadow: 0 18px 44px rgba(16, 41, 65, 0.08);
  --shadow-soft: 0 10px 26px rgba(16, 41, 65, 0.055);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #0f2a42 0, #0f2a42 250px, #eef4f8 250px, #eef4f8 100%),
    #eef4f8;
  color: var(--ink);
  font-family: Aptos, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.42fr) minmax(0, 0.58fr);
  background: #fff;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 42px clamp(28px, 5vw, 64px) 34px;
  position: relative;
}

.language-toggle {
  justify-self: end;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
}

.language-toggle button {
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.language-toggle button.active {
  background: #1295d8;
  color: #fff;
}

.login-content {
  align-self: center;
  display: grid;
  gap: 26px;
  width: min(100%, 520px);
}

.login-logo {
  width: 210px;
  height: auto;
  display: block;
}

.login-content h1 {
  font-size: clamp(26px, 3vw, 34px);
}

.login-content h1 span {
  color: #1387c9;
}

.login-content p {
  margin: 10px 0 0;
  color: #3d4a58;
  font-size: 18px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 18px;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  background: #fff;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.password-field input {
  border: 0;
  border-radius: 0;
  background: #eef5ff;
}

.password-field button {
  min-width: 108px;
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  border-left: 1px solid var(--line);
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: #405064;
  font-weight: 600 !important;
}

.remember-row input {
  width: 22px;
  height: 22px;
  accent-color: #1295d8;
}

.login-button {
  min-height: 58px;
  background: #1295d8;
  font-size: 18px;
}

.login-status {
  min-height: 22px;
  margin: -4px 0 0 !important;
  color: var(--muted) !important;
  font-size: 15px !important;
  font-weight: 700;
}

.login-status.error {
  color: var(--bad) !important;
}

.login-links {
  text-align: center;
  color: var(--muted);
}

.login-links button {
  background: transparent;
  color: #1387c9;
  padding: 4px 2px;
}

.login-links p {
  margin-top: 16px;
  font-size: 16px;
}

.login-footer {
  display: grid;
  gap: 16px;
}

.login-footer a {
  color: #6d7a89;
  text-decoration: none;
}

.login-visual {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(12, 32, 48, 0.82), rgba(18, 70, 92, 0.2) 55%, rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 72% 36%, rgba(41, 174, 182, 0.34), transparent 25%),
    linear-gradient(135deg, #0f2636, #165b7e 54%, #dfe9ef);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(100deg, transparent 0 42px, rgba(255, 255, 255, 0.12) 43px 44px),
    linear-gradient(0deg, rgba(0, 0, 0, 0.28), transparent 42%);
  transform: skewX(-8deg) scale(1.15);
}

.login-visual::after {
  content: "";
  position: absolute;
  right: -8vw;
  bottom: 7vh;
  width: min(58vw, 880px);
  aspect-ratio: 2.35;
  border-radius: 34px 8px 10px 34px;
  background:
    linear-gradient(90deg, #f7fbff 0 67%, #1788c8 67% 100%),
    #f7fbff;
  box-shadow:
    inset 0 -28px 0 #192634,
    inset 38px 0 0 #dce5eb,
    0 34px 70px rgba(3, 15, 25, 0.34);
}

.visual-overlay {
  position: absolute;
  left: clamp(32px, 5vw, 78px);
  top: clamp(42px, 9vh, 110px);
  z-index: 1;
  max-width: 520px;
  color: #fff;
}

.visual-overlay img {
  width: 230px;
  padding: 18px 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.visual-overlay p {
  margin: 42px 0 8px;
  color: #a9e4ff;
  font-weight: 800;
  text-transform: uppercase;
}

.visual-overlay strong {
  display: block;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.02;
  max-width: 700px;
}

.app-layout {
  position: relative;
  display: block;
  min-height: 100vh;
  background: #eef4f8;
}

.app-layout.nav-closed .side-nav {
  display: none;
}

.side-nav {
  position: fixed;
  top: 94px;
  right: 28px;
  z-index: 50;
  width: min(310px, calc(100vw - 32px));
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 36%),
    #102941;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(8, 24, 38, 0.34);
}

.app-layout.nav-open .side-nav {
  display: grid;
}

.nav-brand {
  display: none;
}

.nav-brand h1 {
  font-size: 20px;
}

.main-menu {
  display: grid;
  align-content: start;
  gap: 8px;
}

.menu-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d7e9f2;
  text-align: left;
}

.menu-item span {
  font-weight: 900;
}

.menu-item small {
  color: #94b8ca;
  font-size: 12px;
  font-weight: 700;
}

.menu-item.active {
  border-color: rgba(142, 220, 234, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 4px 0 0 #169bc4;
}

.nav-actions {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.nav-actions .download,
.nav-actions .logout {
  width: 100%;
  text-align: center;
}

.nav-actions .logout {
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
}

.app-main {
  min-width: 0;
  padding: 18px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 44%),
    #112f4a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 24px 55px rgba(4, 13, 22, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 132px;
  max-width: 34vw;
  height: auto;
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
}

.eyebrow {
  margin: 0 0 4px;
  color: #8edcea;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.download,
button {
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
  text-decoration: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.top-actions .logout {
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
}

.top-actions .download {
  background: #16a1d8;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.hamburger-button {
  width: 44px;
  min-width: 44px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

.hamburger-button[aria-expanded="true"] {
  background: #169bc4;
}

.download:hover,
button:hover {
  filter: brightness(0.94);
}

.hidden {
  display: none;
}

.upload-band {
  margin-top: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.standalone-form,
.settings-panel {
  max-width: 920px;
}

.settings-panel {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.form-head {
  margin-bottom: 12px;
}

.form-head h2 {
  color: var(--navy);
  font-size: 22px;
}

.project-create {
  position: relative;
  overflow: hidden;
  border: 0;
}

.project-create::before {
  content: "Neues Projekt";
  position: absolute;
  right: 18px;
  top: 14px;
  color: #d8e3ec;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.upload-band.dragover {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.14);
}

#uploadForm,
#projectForm {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 0.75fr) minmax(160px, auto);
  gap: 14px;
  align-items: stretch;
}

.upload-nu-box {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.inline-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.upload-nu-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.upload-nu-fields input {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form button {
  justify-self: start;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.simple-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.simple-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.simple-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.simple-item strong {
  color: var(--navy);
}

.simple-item span,
.simple-item small {
  color: var(--muted);
  font-size: 13px;
}

input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

#uploadForm > label[for="fileInput"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  padding: 12px;
  border: 1px dashed #99adbf;
  border-radius: 6px;
  background: #f7fafc;
  cursor: pointer;
}

.upload-file-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.upload-file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  border: 1px solid #cfe1ec;
  border-radius: 6px;
  background: #f4f9fc;
  color: var(--navy);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.upload-file-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.upload-file-chip em {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e9f8ef;
  color: #20744a;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.upload-file-chip strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #7590a6;
  color: #fff;
  line-height: 1;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.text-field {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.text-field span {
  color: #4f6172;
  font-size: 13px;
  font-weight: 800;
}

.text-field input,
.text-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  background: #fbfdff;
}

.text-field input:disabled {
  color: #6b7888;
  background: #eef4f8;
}

.wide-field {
  grid-column: 1 / -1;
}

.upload-title {
  font-size: 18px;
  font-weight: 800;
}

.upload-meta,
.status,
.panel-head span,
td {
  color: var(--muted);
}

.status {
  margin: 12px 2px 0;
  min-height: 20px;
  font-size: 13px;
}

.status.error {
  color: var(--bad);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.projects-panel {
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 78%, #f7fafc 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  position: sticky;
  top: 16px;
  box-shadow: var(--shadow);
}

.project-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.overview-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid #c8d9e6;
  border-radius: 8px;
  background:
    linear-gradient(140deg, #f0fbff, #ffffff 66%),
    #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 26px rgba(16, 41, 65, 0.055);
}

.overview-card.active {
  border-color: #169bc4;
  box-shadow: inset 4px 0 0 #169bc4, 0 16px 32px rgba(20, 127, 193, 0.12);
}

.overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #143756;
  color: #fff;
  font-weight: 900;
}

.overview-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.overview-card strong {
  font-size: 15px;
  color: var(--navy);
}

.overview-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-card em {
  grid-column: 2;
  color: var(--navy);
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
}

.project-group-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eef4f8;
  color: var(--navy);
  text-align: left;
}

.project-group-toggle span {
  font-weight: 900;
}

.project-group-toggle strong {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  text-align: center;
}

.project-group-toggle i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.project-children {
  display: grid;
  gap: 9px;
  padding-left: 12px;
  border-left: 2px solid #d9e5ee;
}

.project-card {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.project-card:hover {
  box-shadow: 0 14px 26px rgba(16, 41, 65, 0.09);
  transform: translateY(-1px);
}

.project-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #94a7b8;
}

.project-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.project-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.project-card small,
.project-card em,
.empty {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.project-card em {
  grid-column: 2;
  color: var(--navy);
  font-weight: 800;
  font-size: 14px;
}

.project-card.active {
  border-color: #169bc4;
  background: #eef9fd;
  box-shadow: inset 4px 0 0 #169bc4, 0 12px 24px rgba(20, 127, 193, 0.11);
}

.project-card.active .project-dot {
  background: #169bc4;
}

.dashboard-area {
  min-width: 0;
}

.document-panel-full {
  margin-top: 16px;
  width: 100%;
}

.document-panel-full .table-wrap {
  overflow-x: visible;
  width: 100%;
}

.document-panel-full table {
  min-width: 0;
  table-layout: fixed;
}

.document-panel-full th,
.document-panel-full td {
  padding: 6px 7px;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.document-panel-full th {
  font-size: 11px;
}

.document-panel-full td.money,
.document-panel-full td.diff {
  white-space: nowrap;
}

.document-panel-full th:nth-child(1),
.document-panel-full td:nth-child(1) {
  width: 9%;
}

.document-panel-full th:nth-child(2),
.document-panel-full td:nth-child(2) {
  width: 13%;
}

.document-panel-full th:nth-child(3),
.document-panel-full td:nth-child(3) {
  width: 9%;
}

.document-panel-full th:nth-child(4),
.document-panel-full td:nth-child(4) {
  width: 9%;
}

.document-panel-full th:nth-child(5),
.document-panel-full td:nth-child(5) {
  width: 12%;
}

.document-panel-full th:nth-child(6),
.document-panel-full td:nth-child(6),
.document-panel-full th:nth-child(7),
.document-panel-full td:nth-child(7),
.document-panel-full th:nth-child(8),
.document-panel-full td:nth-child(8),
.document-panel-full th:nth-child(9),
.document-panel-full td:nth-child(9) {
  width: 7%;
}

.document-panel-full th:nth-child(10),
.document-panel-full td:nth-child(10) {
  width: 20%;
}

.nu-workspace {
  grid-template-columns: 1fr;
}

.nu-workspace .projects-panel {
  display: none;
}

.nu-portal {
  display: grid;
  gap: 16px;
}

.nu-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.nu-hero h2 {
  color: var(--navy);
  font-size: 28px;
}

.nu-hero p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.nu-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.nu-stat-grid article {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid #169bc4;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.nu-stat-grid article:nth-child(2) {
  border-left-color: #78c21d;
}

.nu-stat-grid article:nth-child(3) {
  border-left-color: #15a968;
}

.nu-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.nu-stat-grid strong {
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.nu-stat-grid small {
  color: var(--muted);
  font-weight: 700;
}

.nu-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 480px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.nu-search {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #8a9aae;
}

.nu-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  background: transparent;
}

.nu-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nu-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #637386;
}

.nu-chip.active {
  background: var(--navy);
  color: #fff;
}

.nu-chip strong {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 167, 184, 0.22);
}

.nu-project-list {
  display: grid;
  gap: 14px;
}

.nu-project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.nu-project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f5f8fb;
  border-bottom: 1px solid var(--line);
}

.nu-project-head strong {
  color: var(--navy);
  font-size: 16px;
}

.nu-project-head span:not(.nu-folder-icon) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.nu-folder-icon {
  color: #169bc4;
  font-weight: 900;
}

.nu-table {
  display: grid;
}

.nu-table-head,
.nu-table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.05fr) minmax(140px, 0.95fr) minmax(135px, 0.8fr) minmax(145px, 0.85fr) minmax(115px, 0.65fr) minmax(170px, 0.9fr);
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
}

.nu-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.nu-table-row {
  border-bottom: 1px solid #e4ebf2;
}

.nu-table-row:last-child {
  border-bottom: 0;
}

.nu-table-row strong {
  display: block;
  color: var(--ink);
}

.nu-table-row small {
  display: block;
  margin-top: 3px;
  color: #8a9aae;
}

.nu-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #d8ead2;
  border-radius: 999px;
  background: #f5fbf2;
  color: #50a917;
  font-style: normal;
  font-weight: 900;
}

.nu-status-pill.pending {
  border-color: #cfe7f8;
  background: #f1f9ff;
  color: #169bd5;
}

.nu-status-pill.accepted {
  border-color: #d8ead2;
  background: #f5fbf2;
  color: #50a917;
}

.nu-status-pill.rejected {
  border-color: #f6caca;
  background: #fff5f3;
  color: #d24a36;
}

.nu-review-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}

.nu-review-actions [data-review-download] {
  white-space: normal;
  text-align: center;
}

.nu-decision-actions {
  display: inline-flex;
  gap: 6px;
}

.nu-review-slot {
  display: flex;
  width: 152px;
  max-width: 100%;
  min-height: 32px;
  align-items: stretch;
}

.nu-review-slot > a,
.nu-review-slot > .nu-decision-actions {
  width: 100%;
}

.nu-review-slot .nu-decision-actions > button {
  flex: 1;
}

.mini.success,
.mini.reject {
  min-width: 36px;
  padding-inline: 10px;
  font-size: 18px;
  line-height: 1;
}

.mini.success {
  background: #effbf1;
  color: #1a9f46;
  border-color: #bdebc8;
}

.mini.reject {
  background: #fff3f0;
  color: #d24a36;
  border-color: #f2c6bd;
}

.mini.warning {
  background: #fff8e7;
  color: #9b6415;
  border-color: #f1d59c;
}

.nu-review-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.nu-assignment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #edf7fb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.file-cell {
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.nu-review-badge.pending {
  background: #eef8ff;
  color: #168fc7;
}

.nu-review-badge.accepted {
  background: #edf9ef;
  color: #1c9441;
}

.nu-review-badge.rejected {
  background: #fff0ed;
  color: #c43f2f;
}

.nu-amount {
  color: var(--navy);
  font-weight: 900;
  text-align: right;
}

.detail-upload {
  margin: 0 0 16px;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background:
    linear-gradient(120deg, #ffffff 0, #ffffff 62%, #edf7fb 100%);
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.view-head h2 {
  font-size: 24px;
  line-height: 1.05;
}

.view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  text-align: right;
}

.date-filter {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.date-filter label {
  display: grid;
  gap: 5px;
  text-align: left;
}

.date-filter label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.date-filter input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.secondary {
  background: #e9f0f5;
  color: var(--navy);
}

.filter-active {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f7fb;
  color: #126e8d !important;
  font-weight: 800;
}

.eyebrow.dark {
  color: #167b9a;
}

.folder-path {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.kpis article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.kpis article {
  position: relative;
  overflow: hidden;
  padding: 14px;
  min-height: 106px;
}

.kpis article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #169bc4;
}

.kpis .kpi-1 {
  background:
    linear-gradient(140deg, rgba(22, 155, 196, 0.13), transparent 50%),
    #fff;
}

.kpis .kpi-2::before {
  background: #1c8f70;
}

.kpis .kpi-3::before {
  background: #235b8a;
}

.kpis .kpi-4::before {
  background: #c8841c;
}

.kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.kpis strong {
  display: block;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.05;
  letter-spacing: 0;
}

.kpis small {
  display: block;
  margin-top: 7px;
  color: #718194;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.panel {
  padding: 14px;
  min-width: 0;
}

.panel.wide {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  color: var(--navy);
}

.bars {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  container-type: inline-size;
}

.month-block {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 84px minmax(12px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.bar-row strong {
  font-size: 13px;
  color: #33485c;
}

.bar-row span {
  text-align: right;
  font-weight: 800;
  color: var(--navy);
}

.bar-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.week-list {
  display: grid;
  gap: 5px;
  margin-left: 14px;
  padding: 6px 0 2px 10px;
  border-left: 2px solid #d9e5ee;
}

.week-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #e1e9f0;
  border-radius: 6px;
  background: #f8fbfd;
}

@container (max-width: 430px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .bar-row .track { display: none; }
  .bar-row em { grid-column: 2; }
  .week-row { grid-template-columns: minmax(0, 1fr) auto; }
  .week-row em { grid-column: 2; }
}

.week-row strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
}

.week-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.week-row span,
.week-row em {
  color: var(--navy);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.week-row em {
  color: var(--muted);
}

.track {
  height: 14px;
  background: #edf3f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: linear-gradient(90deg, #1599a3, #1788c8);
  min-width: 2px;
  border-radius: inherit;
}

.rank-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.rank-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rank-item code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 6px;
  background: #eef5f9;
  color: var(--navy);
  font-weight: 800;
}

.rank-title {
  font-weight: 700;
}

.rank-meta {
  color: var(--muted);
  font-size: 13px;
}

.rank-value {
  font-weight: 800;
  text-align: right;
  color: var(--navy);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

th,
td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f5f8fb;
  color: var(--navy);
  font-size: 12px;
  border-top: 0;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fbfd;
}

td.money,
td.diff {
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

td.discount {
  color: #b7472a;
}

td.payout {
  color: var(--green);
  font-weight: 800;
}

td.ok {
  color: var(--green);
  font-weight: 800;
}

.mini {
  min-width: 66px;
  padding: 6px 8px;
  font-size: 12px;
}

.document-panel-full .mini {
  min-width: auto;
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.15;
}

.document-panel-full .pdf-download {
  min-width: 56px;
}

.document-panel-full .nu-pdf-link {
  min-width: 96px;
}

.document-panel-full .mail-link {
  min-width: 72px;
}

.document-panel-full .nu-review-badge,
.document-panel-full .nu-assignment-badge {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 10px;
}

.document-panel-full .nu-assignment-badge {
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-panel-full .mini.warning {
  max-width: 120px;
  white-space: normal;
}

.row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.nu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.nu-toggle input {
  width: 13px;
  height: 13px;
  accent-color: #169bc4;
}

.document-subcontractor-row td {
  padding: 0 7px 8px;
  background: #f8fbfd;
  white-space: normal;
}

.document-subcontractor-row:hover {
  background: transparent;
}

.document-subcontractor-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 175px);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid #d8e4ed;
  border-radius: 8px;
  background: #fff;
}

.document-subcontractor-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(190px, 1.1fr) auto;
  gap: 8px;
  align-items: end;
}

.document-subcontractor-form .text-field {
  gap: 4px;
}

.document-subcontractor-form .text-field span {
  font-size: 11px;
}

.document-subcontractor-form input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.document-subcontractor-form input:disabled {
  color: #5f6f80;
  background: #eef4f8;
}

.document-subcontractor-actions {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.nu-summary-card {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 50px;
  padding: 7px 9px;
  border-left: 4px solid #169bc4;
  border-radius: 6px;
  background: #eef7fb;
}

.nu-summary-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.nu-summary-card strong {
  color: var(--navy);
  font-size: 17px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.nu-summary-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.nu-summary-warning {
  color: #b7472a;
}

.pdf-download {
  display: inline-flex;
  justify-content: center;
  background: #143756;
  color: #fff;
  text-decoration: none;
}

.mail-link {
  display: inline-flex;
  justify-content: center;
  min-width: 92px;
  background: #169bc4;
  color: #fff;
  text-decoration: none;
}

.nu-pdf-link {
  display: inline-flex;
  justify-content: center;
  min-width: 118px;
  background: #143756;
  color: #fff;
  text-decoration: none;
}

.danger {
  background: #be3d2a;
}

.danger:disabled {
  cursor: wait;
  opacity: 0.7;
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  body {
    background: #eef4f8;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: 100vh;
    padding: 24px 22px;
  }

  .login-content {
    width: 100%;
  }

  .login-logo {
    width: 172px;
  }

  .login-form input[type="text"],
  .login-form input[type="password"] {
    min-height: 54px;
    font-size: 16px;
  }

  .password-field {
    grid-template-columns: 1fr;
  }

  .password-field button {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .login-visual {
    display: none;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .main-menu {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 14px;
  }

  .project-create::before {
    display: none;
  }

  .topbar,
  #uploadForm,
  #projectForm,
  .document-subcontractor-panel,
  .document-subcontractor-form,
  .field-grid,
  .grid,
  .workspace,
  .kpis,
  .nu-stat-grid,
  .nu-toolbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    padding: 18px;
  }

  .brand {
    align-items: flex-start;
  }

  .view-head,
  .view-actions {
    align-items: flex-start;
    text-align: left;
  }

  .date-filter {
    width: 100%;
    justify-content: flex-start;
  }

  .date-filter label,
  .date-filter input,
  .date-filter button {
    width: 100%;
  }

  .view-head {
    display: grid;
  }

  .view-head h2 {
    font-size: 24px;
  }

  .projects-panel {
    position: static;
  }

  .bar-row,
  .week-row,
  .rank-item,
  .simple-item,
  .nu-table-head,
  .nu-table-row {
    grid-template-columns: 1fr;
  }

  .nu-table-head {
    display: none;
  }

  .bar-row span,
  .bar-row em,
  .week-row span,
  .week-row em,
  .rank-value,
  .nu-amount {
    text-align: left;
  }
}
.price-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: 80vh;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 20px;
  color: #18252e;
}
.price-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.price-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price-heading h2 { font-size: 20px; margin: 0; }
.price-heading button { width: 36px; height: 36px; padding: 0; font-size: 24px; }
.price-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e4e8eb; }
.price-line button { padding: 4px 8px; font-size: 13px; }
.price-editor { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 16px; }
.price-editor label { display: grid; gap: 4px; flex: 1 1 150px; font-size: 13px; }
.price-editor input { width: 100%; min-width: 0; }
.ag-price-warning-row > td { padding: 4px 10px 8px; }
.ag-price-warning { border-left: 3px solid #b77912; background: #fff9ec; padding: 8px 12px; color: #664712; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.ag-price-warning summary { cursor: pointer; font-weight: 600; }
.ag-price-warning summary svg { width: 15px; height: 15px; margin: 0 6px; vertical-align: middle; }
.ag-price-warning p { margin: 6px 0; }
.ag-price-warning section { margin-top: 10px; }
.ag-price-warning ul { margin: 4px 0; padding-left: 20px; }
