:root {
  --green: #0f7a5b;
  --green-2: #0b2f27;
  --green-3: #2fa16f;
  --red: #dc3d45;
  --amber: #e6a11b;
  --ink: #17211d;
  --muted: #64746c;
  --line: #d8e2dc;
  --panel: rgba(255, 255, 255, .9);
  --card: #f3f7f4;
  --bg: #f4f7f4;
  --shadow: 0 22px 58px rgba(20, 39, 31, .14);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(15,122,91,.24), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(230,161,27,.20), transparent 24rem),
    linear-gradient(135deg, #eef4ef, #dfe9e4);
  background-attachment: fixed;
}
body.app-screen {
  position: relative;
  background: #0b2f27;
}
body.app-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(11, 47, 39, .28), rgba(11, 47, 39, .54)),
    var(--app-bg-url, none),
    linear-gradient(135deg, #0b2f27, #17211d);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
a { color: inherit; text-decoration: none; }

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: #eef2f0;
}
.login-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(238, 242, 240, .42), rgba(238, 242, 240, .62)),
    var(--login-bg-url, none),
    linear-gradient(135deg, #eef2f0, #dfe8e4);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 28px 80px rgba(20, 32, 27, .16);
}
.auth-card h1 { margin: 0 0 8px; font-size: 30px; }
.auth-card p { color: var(--muted); }
.login-logo {
  width: 96px;
  height: 70px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}

.hero {
  min-height: 154px;
  padding: 24px 4vw 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(230,161,27,.3), transparent 22rem),
    linear-gradient(100deg, color-mix(in srgb, var(--navbar-color, #0f7a5b) 78%, #071512), color-mix(in srgb, var(--navbar-color, #0f7a5b) 86%, #ffffff 8%));
  color: #eef7f4;
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 46px rgba(0,0,0,.24);
}
.station-mark {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 70px;
}
.station-mark strong {
  font-size: 26px;
  letter-spacing: .2px;
}
.wing {
  width: 104px;
  height: 62px;
  display: grid;
  place-items: center;
  color: #dce8e5;
  border: 3px solid #dce8e5;
  clip-path: polygon(0 26%, 66% 0, 100% 50%, 66% 100%, 0 74%, 28% 50%);
  font-size: 22px;
}
.nav-logo {
  width: 104px;
  height: 70px;
  object-fit: contain;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  padding: 5px;
}
.hello {
  position: absolute;
  right: 4vw;
  top: 26px;
  color: #dbe6e3;
  font-size: 14px;
}
.hello a {
  margin-left: 12px;
  color: #fff;
  font-weight: 700;
}
.topnav {
  display: flex;
  align-items: end;
  gap: 2px;
  overflow-x: auto;
  margin-top: 12px;
  height: 48px;
}
.topnav a {
  flex: 0 0 auto;
  padding: 17px 14px 14px;
  color: #d8e3df;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
}
.topnav a:hover,
.topnav a.active {
  color: #fff;
  border-color: #e7edf0;
  background: rgba(0,0,0,.12);
}

.workspace {
  position: relative;
  z-index: 1;
  width: calc(100% - 56px);
  max-width: 1760px;
  margin: 24px auto 56px;
}
.panel {
  background: rgba(250, 252, 251, .97);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(12, 33, 27, .18);
  padding: 26px;
  margin-bottom: 20px;
  backdrop-filter: blur(14px);
}
.panel-head,
.list-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.data-panel {
  min-height: auto;
}
.panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #17211d;
}
.panel-head > span,
.list-title > span {
  color: #64746c;
  font-size: 13px;
  font-weight: 700;
}
.list-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.table-tools label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin-left: 0;
}
.table-tools select {
  width: auto;
  min-width: 76px;
  min-height: 40px;
  padding: 8px 12px;
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.menu-card {
  min-height: 118px;
  background: linear-gradient(180deg, #ffffff, #f6faf8);
  border: 1px solid #dbe6df;
  border-radius: 7px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 16px;
  padding: 20px;
  color: #23423a;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.menu-card:hover {
  background: #effaf4;
  border-color: #9dcfbb;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(20, 48, 45, .14);
}
.menu-icon {
  grid-row: 1 / 3;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f7a5b, #06372d);
  color: #fff;
  box-shadow: 0 12px 24px rgba(15, 122, 91, .2);
}
.menu-icon svg {
  width: 28px;
  height: 28px;
}
.menu-text {
  grid-column: 2;
  align-self: end;
  display: block;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  color: #1f3d35;
}
.menu-card small {
  grid-column: 2;
  align-self: start;
  display: block;
  margin-top: 5px;
  color: var(--muted);
  text-align: left;
  line-height: 1.35;
}

.green-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--navbar-color, #0f7a5b), color-mix(in srgb, var(--navbar-color, #0f7a5b) 76%, #06372d));
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 95, 71, .2);
}
.green-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.button-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-weight: 900;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 14px;
}
.button.primary { background: var(--navbar-color, var(--green)); color: #fff; border-color: var(--navbar-color, var(--green)); }
.button.danger {
  background: #ef3f3f;
  color: #fff;
  border-color: #ef3f3f;
  font-weight: 700;
}
.button.full { width: 100%; }

.notice {
  background: #edf7f0;
  color: #1d5d45;
  border: 1px solid #bedeca;
  border-radius: 3px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.notice.error {
  color: #a01818;
  background: #fff0f0;
  border-color: #f0b8b8;
}

.filter-panel form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
  gap: 18px;
  align-items: end;
}
.filter-line {
  display: block;
  max-width: 420px;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.filter-line label {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
}
.filter-line input { height: 40px; }
.list-title label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-left: auto;
}
.table-tools label {
  margin-left: 0;
}
.modal-body label,
.filter-panel label {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  font-weight: 700;
  color: #303b38;
}
.modal-body label span,
.filter-panel label span { font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cdd5d3;
  background: #fff;
  color: var(--ink);
  min-height: 43px;
  padding: 10px 12px;
  font: inherit;
  border-radius: 8px;
}
textarea {
  min-height: 86px;
  resize: vertical;
}

.table-wrap {
  overflow-x: auto;
  padding-bottom: 0;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.table-wrap.menu-open {
  padding-bottom: 82px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: transparent;
}
th, td {
  border: 0;
  border-bottom: 1px solid #dde6e1;
  padding: 14px 13px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
th {
  font-weight: 700;
  color: #404947;
  background: #edf4ef;
}
tbody tr:hover { background: #f1faf5; }
.table-logo {
  width: 48px;
  height: 34px;
  object-fit: contain;
  display: block;
}
.table-logo-fallback {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 30px;
  border-radius: 6px;
  background: #eef6f2;
  color: #0f7a5b;
  font-size: 12px;
  font-weight: 800;
}
td.actions {
  text-align: center;
  width: 110px;
  font-size: 13px;
  white-space: nowrap;
  position: relative;
}
.action-menu {
  position: relative;
  display: inline-block;
}
.action-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
}
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu summary::after {
  content: "⌄";
  font-size: 12px;
  margin-left: 2px;
}
.action-menu div {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
  min-width: 150px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #d9dfe0;
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
  text-align: left;
}
.action-menu[open] div {
  z-index: 100;
}
.icon-action,
.inline-delete button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
}
.icon-action {
  color: #27302d;
  background: #fff;
}
.inline-delete {
  display: block;
  margin: 0;
}
.inline-delete button {
  color: #27302d;
  background: #fff;
  border: 0;
  cursor: pointer;
}
.icon-action:hover,
.inline-delete button:hover { background: #f2f6f5; }
.action-menu summary {
  width: 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 7px;
  background: #f0f6f2;
  color: #0f7a5b;
  font-size: 0;
  overflow: hidden;
}
.action-menu summary::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -7px 0 0 currentColor, 7px 0 0 currentColor;
  margin: 0;
}
.muted { color: var(--muted); }
.panel-toggle {
  border: 1px solid #cbd3d1;
  background: #fff;
  color: #2e3b38;
  min-height: 34px;
  border-radius: 2px;
  padding: 7px 10px;
  cursor: pointer;
}
.table-collapsed .table-wrap,
.table-collapsed .empty,
.table-collapsed .filter-line {
  display: none;
}
.tag {
  display: inline-flex;
  background: #2d8b35;
  color: #fff;
  padding: 6px 10px;
  margin-right: 5px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
}
.tag.dark { background: #1f3445; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px;
  border: 1px solid var(--line);
  background: #fff;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
}
.modal:target { display: block; }
.shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .66);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 48px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  margin: 58px auto;
  background: #fff;
  box-shadow: 0 26px 90px rgba(0,0,0,.45);
}
.modal-title {
  min-height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navbar-color, #146b21);
  color: #fff;
  padding: 0 28px;
  font-size: 20px;
}
.modal-title a {
  font-size: 30px;
  color: rgba(255,255,255,.7);
}
.modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 22px 26px;
  padding: 32px;
}
.modal-body label:has(textarea) {
  grid-column: 1 / -1;
}
.modal-actions {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 24px;
  padding: 0 32px 28px;
}
.modal-actions a { color: #293632; }

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px 24px;
}
.theme-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  align-items: center;
}
.theme-picker > span {
  font-weight: 700;
}
.swatch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 10px;
  margin-bottom: 8px;
  font-weight: 700;
}
.swatch input {
  width: auto;
  min-height: 0;
}
.swatch i {
  width: 30px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid rgba(0,0,0,.18);
}
.swatch b {
  font-size: 13px;
}
.settings-form label {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  font-weight: 700;
}
.logo-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #f3f6f5;
  border: 1px solid var(--line);
}
.logo-preview img {
  width: 120px;
  height: 80px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}
.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.document-toolbar {
  width: 210mm;
  max-width: 100%;
  margin: 0 auto 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.document-a4 {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  padding: 18mm 18mm 34mm;
  background: #fff;
  color: #111;
  box-shadow: 0 18px 70px rgba(0,0,0,.35);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13.5px;
  position: relative;
}
.doc-header {
  text-align: center;
  text-transform: uppercase;
  font-weight: 800;
  margin-top: 0;
}
.doc-header h1,
.doc-header h2,
.doc-header h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.08;
  letter-spacing: .3px;
  font-weight: 800;
}
.doc-header img {
  display: block;
  width: 58px;
  max-height: 42px;
  object-fit: contain;
  margin: 8px auto 5px;
}
.doc-line {
  height: 2px;
  background: #111;
  width: 176mm;
  margin: 10px auto 24px;
}
.doc-client {
  width: 142mm;
  margin: 0 auto 12px;
  background: #d9d6d2;
  font-weight: 800;
}
.doc-ident,
.doc-lines {
  width: 176mm;
  margin-left: auto;
  margin-right: auto;
}
.doc-ident th,
.doc-lines th {
  background: #77726c;
  color: #111;
  text-align: center;
  font-weight: 800;
}
.doc-ident td,
.doc-ident th,
.doc-client td,
.doc-client th,
.doc-lines td,
.doc-lines th {
  border: 1.7px solid #111;
  padding: 7px 9px;
}
.doc-client td,
.doc-client th,
.doc-ident td,
.doc-ident th {
  text-align: center;
  font-weight: 800;
}
.doc-section-title {
  width: 176mm;
  margin: 18px auto 8px;
  font-weight: 800;
  font-size: 14px;
}
.doc-lines td {
  text-align: center;
}
.doc-lines tbody tr {
  height: 36px;
}
.doc-blank-zone {
  height: 32mm;
  border-left: 1.7px solid #111 !important;
  border-right: 1.7px solid #111 !important;
  border-top: 1.7px solid #111 !important;
  border-bottom: 1.7px solid #111 !important;
  background: #fff;
}
.doc-payment,
.doc-amount {
  text-align: center;
  margin: 8px 0 0;
  font-weight: 800;
  font-size: 14.5px;
}
.doc-payment strong {
  margin-right: 26px;
}
.doc-footer {
  position: absolute;
  left: 18mm;
  right: 18mm;
  bottom: 6mm;
  text-align: center;
  border-top: 2px solid #111;
  padding-top: 9px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.75;
}
.report-page > h1 {
  margin: 0 0 16px;
  text-align: center;
  color: #fff;
  font-size: 22px;
}
.report-modern {
  display: grid;
  gap: 18px;
}
.report-modern .panel {
  margin-bottom: 0;
}
.report-card {
  padding: 22px;
  border-color: rgba(216, 226, 220, .98);
}
.report-card .panel-head {
  margin-bottom: 16px;
}
.report-card .panel-head h2 {
  font-size: 18px;
  font-weight: 700;
}
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 22px;
}
.report-mini {
  border: 1px solid #9fa8a4;
  background: #fff;
}
.report-mini th,
.report-mini td {
  border: 1px solid #cfd6d3;
  padding: 13px 16px;
  background: #fff;
}
.report-mini th {
  width: 70%;
  color: #0c1b16;
  font-weight: 800;
}
.report-mini td {
  text-align: center;
  font-weight: 700;
}
.report-table th,
.report-table td {
  border-right: 1px solid #d4dad8;
}
.report-table th:last-child,
.report-table td:last-child {
  border-right: 0;
}
.report-table tbody tr:hover {
  background: #fff;
}
.report-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 26px;
  align-items: start;
}
.report-subtitle {
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.report-subtitle + .table-wrap {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.document-toolbar {
  position: sticky;
  top: 12px;
  z-index: 8;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.report-print {
  width: 210mm;
  margin: 0 auto 24px;
  padding: 12mm;
  background: #fff;
  color: #111;
}
.report-print > h1 { color: #111; }
.report-print .panel {
  box-shadow: none;
  border: 1px solid #bbb;
  margin-bottom: 8mm;
}

@media (max-width: 1100px) {
  .menu-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .report-summary-grid,
  .report-two-col { grid-template-columns: 1fr; }
  .modal-body { grid-template-columns: 1fr; }
  .modal-body label,
  .filter-panel label { grid-template-columns: 1fr; gap: 7px; }
  .filter-panel form { grid-template-columns: 1fr; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form label { grid-template-columns: 1fr; }
  .workspace { width: calc(100% - 32px); }
  .list-title { flex-direction: column; }
  .table-tools { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .hero { padding: 18px 16px 0; }
  .station-mark { align-items: flex-start; gap: 12px; }
  .station-mark strong { font-size: 18px; }
  .wing { width: 58px; height: 38px; }
  .nav-logo { width: 64px; height: 44px; }
  .hello { position: static; margin-top: 8px; }
  .workspace { width: calc(100% - 20px); margin-top: 14px; }
  .panel { padding: 18px; }
  .menu-grid { grid-template-columns: 1fr; }
  .list-title { align-items: flex-start; flex-direction: column; }
  .table-tools { width: 100%; }
  .table-tools .green-button,
  .table-tools .panel-toggle,
  .table-tools label {
    width: 100%;
  }
}

@media print {
  body { background: #fff; }
  @page { size: A4; margin: 0; }
  .hero, .notice, .green-button, .document-toolbar, .topnav { display: none !important; }
  .report-filter { display: none !important; }
  .workspace { width: 100%; margin: 0; }
  .panel { box-shadow: none; border: 0; }
  .report-page > h1 { color: #111; }
  .report-print {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 10mm;
    box-shadow: none;
  }
  .document-a4 {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    padding: 18mm 18mm 34mm;
    box-shadow: none;
  }
}
