:root {
  --bg: #eef0f0;
  --line: #a6afba;
  --text: #222;
  --blue-dark: #324b67;
  --blue-mid: #3f5b79;
  --blue-soft: #e8eef5;
  --green: #1fba7a;
  --cyan: #29b4d8;
  --red: #d75656;
  --icon-blue: #2a84c5;
  --icon-gray: #e5e7ea;
  --main-left-bottom-tile-height: 62px;
  --main-right-tile-height: 77px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Tahoma, sans-serif;
  color: var(--text);
  background: #eceff2;
  font-size: 12px;
}

.app-shell {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 18px 12px;
}

.topbar {
  background: linear-gradient(#3d5977, #324b67);
  color: #fff;
  border: 1px solid #2f455e;
  height: 50px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 10px;
}

.topbar-left { display: flex; gap: 16px; align-items: center; }
.logo {
  font-family: "open_sansregular", arial, helvetica, sans-serif;
  font-size: 34px;
  letter-spacing: -1px;
  line-height: 1;
  white-space: nowrap;
  font-weight: normal !important;
}
.logo-ver { font-size: 16px; color: #2ca5da; vertical-align: super; }
.identity { display: flex; flex-direction: column; line-height: 1.05; }
.user-name { font-size: 16px; color: #d2deeb; font-weight: 400; }
.user-org { font-size: 10px; color: #2ca5da; text-transform: uppercase; }
.topbar-right {
  display: flex;
  align-items: stretch;
  gap: 14px;
  height: 100%;
}
.topbar-icons {
  display: flex;
  gap: 0;
  font-size: 11px;
  align-items: stretch;
  height: 100%;
}

.top-icon {
  min-width: 48px;
  height: 100%;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-decoration: none;
  color: #ffffff;
  opacity: 1;
  border-left: 1px solid #334658;
  cursor: default;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.top-icon .fa {
  font-size: 20px;
}

.top-icon:hover {
  opacity: 1;
}

.crumbs {
  height: 26px;
  background: linear-gradient(#4f6884, #45607d);
  border: 1px solid #38516b;
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #d6e4f2;
  font-size: 11px;
  cursor: default;
  position: sticky;
  top: 0;
  z-index: 40;
}

.crumbs-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumbs a {
  color: #e3edf7;
  text-decoration: underline;
  cursor: pointer;
}
.crumbs .burger {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: #dbe8f6;
  cursor: default;
}

.crumbs-toggle {
  border: none;
  background: transparent;
  color: #c7d9ec;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.crumbs-toggle:hover {
  color: #fff;
}
.content { padding-top: 0; }

.screen-frame {
  border: none;
  background: transparent;
}

.page-title {
  margin: 0 0 4px;
  font-size: 33px;
  font-weight: 400;
  text-transform: uppercase;
  background: transparent;
  border: none;
  padding: 2px 0 2px;
  letter-spacing: -0.6px;
  position: sticky;
  top: 26px;
  z-index: 35;
  background: #eceff2;
}

.card,
.sub-card {
  background: #fff;
  border: 1px solid #556a7f;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 4px;
}

.section-title {
  background: linear-gradient(#466381, #3f5b79);
  color: #fff;
  text-transform: uppercase;
  font: 16px/32px "open_sansbold", arial, helvetica, sans-serif;
  font-weight: 700;
  margin: -8px -8px 8px;
  padding: 0 8px;
  position: relative;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto;
  cursor: pointer;
}

.section-title::before,
.section-title::after { content: none; }

.section-toggle-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #d8e5f3;
  background: rgba(255, 255, 255, 0.08);
  color: #e4edf7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.section-toggle-btn .fa {
  font-size: 9px;
  line-height: 1;
}

.section-header-row {
  margin: -8px -8px 8px;
  background: linear-gradient(#466381, #3f5b79);
  color: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  cursor: pointer;
  overflow: hidden;
}

.section-header-row .section-title {
  margin: 0;
  padding: 0 8px;
  background: transparent;
  min-height: 32px;
  flex: 1 1 auto;
  width: auto;
}

.section-header-row .section-toggle-btn {
  margin-right: 0;
}

.section-header-row .actions-icons,
.section-header-row .toolbar {
  margin-right: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 3px 6px 3px 0;
  gap: 5px;
  cursor: default;
  flex-shrink: 0;
}

.section-header-row .actions-icons .icon-btn,
.section-header-row .toolbar .icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 2.5px;
}

.section-header-row .actions-icons .icon-btn .fa,
.section-header-row .toolbar .icon-btn .fa {
  font-size: 11px;
}

/* Covers headers where icon button is direct child (no toolbar wrapper). */
.section-header-row > .icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 2.5px;
  margin-right: 6px;
  flex-shrink: 0;
}

.section-header-row > .icon-btn .fa {
  font-size: 11px;
}

.page-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  margin: 0 0 6px;
}

.page-toolbar-inline {
  margin-top: -40px;
  margin-bottom: 8px;
}

.equipment-toolbar {
  position: relative;
  z-index: 36;
  margin-top: -36px;
  margin-bottom: 8px;
}

.section.collapsed > :not(.section-title):not(.section-header-row) {
  display: none !important;
}

.section.collapsed {
  padding: 0;
}

.section.soft-collapsed-compact {
  padding: 0;
}

.section.soft-animating {
  transition: padding 220ms ease;
}

.section.soft-animating > .section-title,
.section.soft-animating > .section-header-row {
  transition: margin 220ms ease;
}

.section.collapsed > .section-title,
.section.collapsed > .section-header-row {
  margin: 0;
}

.section.soft-collapsed-compact > .section-title,
.section.soft-collapsed-compact > .section-header-row {
  margin: 0;
}

.quick-grid {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.quick-pill {
  background: #e4e7eb;
  border: 1px solid #c8cdd3;
  border-radius: 4px;
  color: #2f3338;
  text-decoration: none;
  padding: 7px 12px;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.quick-pill:hover {
  background: #dbe0e6;
  border-color: #bcc3cb;
}

.quick-pill.active {
  background: #ffffff;
  border-color: #aeb7c1;
}

.filters-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 6px 12px;
}

.filters-grid.two-cols { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.form-grid .wide { grid-column: span 3; }

.quick-form {
  border: 1px solid #8f9cab;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 12px;
}

.quick-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #222;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #cfd6de;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  color: #4f6073;
  padding: 0 8px;
  height: 32px;
}
select[size] { height: 132px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #9cb6d1;
  box-shadow: 0 0 0 1px rgba(45, 165, 218, 0.12);
}

input[type="checkbox"],
input[type="radio"] {
  width: 14px;
  height: 14px;
  border: 1px solid #8fa2b4;
  margin: 0;
  vertical-align: middle;
}

input[type="checkbox"] {
  border-radius: 2px;
}

input[type="radio"] {
  border-radius: 50%;
}

textarea { height: auto; min-height: 50px; }
.filters-actions { align-self: end; display: flex; gap: 6px; }

.btn {
  border: 1px solid #cfd6de;
  border-radius: 2px;
  background: #fff;
  color: #6a7786;
  height: 28px;
  padding: 0 12px;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn:hover {
  background: #f7f9fb;
}

.btn-clear {
  background: #fff;
  color: #6a7786;
  border-color: #cfd6de;
}

.btn-search {
  background: #2da5da;
  border-color: #1c90c3;
  color: #fff;
}

.btn-search:hover {
  background: #299bcd;
}

.btn-approve { background: #23b079; color: #fff; border-color: #169362; }
.btn-return { background: #dd5e5e; color: #fff; border-color: #ca4b4b; }

.actions-icons { display: flex; gap: 5px; }
.toolbar { display: flex; gap: 6px; align-items: center; }

.icon-btn {
  width: 33px;
  height: 29px;
  border: 1px solid #6a7b8d;
  border-radius: 2.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  background: #9aa6b3;
  padding: 0;
  transition: filter 0.16s ease, background-color 0.16s ease;
}

.icon-btn .fa {
  font-size: 11px;
  line-height: 1;
  color: #fff;
  transition: opacity 0.16s ease;
}

.icon-btn:hover {
  filter: brightness(1.08);
}

.icon-btn:hover .fa {
  opacity: 0.98;
}

.icon-btn:active {
  filter: brightness(0.94);
}

.icon-green { background: #1bb095; border-color: #2aa790; }
.icon-cyan { background: #2da5da; border-color: #1c90c3; }
.icon-red { background: #d9534f; border-color: #d43f3a; }
.icon-blue { background: #337ab7; border-color: #2e6da4; }
.icon-gray { background: var(--icon-gray); color: #34495e; }
.icon-gray .fa { color: #34495e; }


.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  border: 1px solid #c7cfd8;
}

.table th,
.table td {
  border: 1px solid #cfd6de;
  padding: 4px 5px;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: middle;
}

.table input[type="checkbox"] {
  width: 13px;
  height: 13px;
  display: block;
  margin: 0 auto;
}

.table th {
  background: #f3f5f7;
  text-align: center;
  font-weight: 600;
  color: #2f3d4f;
  border-color: #c7cfd8;
}

.table td {
  color: #2d3a49;
}

.table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.table tbody tr:nth-child(even) {
  background: #f6f7f9;
}

.table td a { color: #222; text-decoration: none; }
.table td a.icon-btn { color: #fff; }
.table td a.icon-btn.icon-gray { color: #34495e; }
.status-tag { background: transparent; border: none; padding: 0; font-weight: 700; }
.table td.actions {
  display: table-cell !important;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
.table td.actions .icon-btn {
  display: inline-flex;
  vertical-align: middle;
}
.actions { display: inline-flex; gap: 4px; justify-content: center; }
.actions .icon-btn + .icon-btn { margin-left: 2px; }
.table th.action-col-2,
.table td.action-col-2 {
  width: 76px !important;
  min-width: 76px;
  max-width: 76px;
  padding-left: 4px;
  padding-right: 4px;
  box-sizing: border-box;
}
.table th.action-col-3,
.table td.action-col-3 {
  width: 112px !important;
  min-width: 112px;
  max-width: 112px;
  padding-left: 4px;
  padding-right: 4px;
  box-sizing: border-box;
}
.empty { text-align: center; color: #666; }

.tabs {
  display: flex;
  gap: 18px;
  margin-top: 6px;
  margin-bottom: 10px;
  align-items: flex-end;
}

.equipment-page .tabs {
  margin-top: 16px;
  margin-bottom: 4px;
}

.tab {
  border: none;
  border-top: 4px solid #c7cfd8;
  background: transparent;
  padding: 5px 0 7px;
  font-size: 20px;
  text-transform: uppercase;
  color: #2e6fae;
  font-weight: 400;
  font-family: Arial, Tahoma, sans-serif;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, color 0.15s ease;
  appearance: none;
}

.tab:hover {
  color: #2a6399;
}

.tab:not(.active):hover {
  border-top-color: #8fc2e2;
}

.tab.active {
  color: #2a70b0;
  border-top-color: #2a9fd4;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.inline-actions { display: flex; gap: 6px; margin-top: 6px; }
.btn-link { border: none; background: transparent; color: #2a84c5; cursor: pointer; }
.archive-title {
  margin-top: 8px;
  border: 1px solid #7f8b98;
  border-bottom: none;
  background: #f0f4f8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  padding: 6px 8px;
}

.inner-subtitle {
  margin: 6px 0 4px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  color: #3e5875;
}

.ktru-box {
  border: 1px solid #7f8b98;
  padding: 8px 10px;
  margin: 0 0 12px;
}

.ktru-item {
  display: block;
  margin-bottom: 6px;
  color: #202020;
  font-size: 11px;
  line-height: 1.35;
}

.ktru-subitem {
  margin: 0 0 8px 14px;
  color: #202020;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  width: fit-content;
}

.ktru-subitem input[type="radio"] {
  width: 13px;
  height: 13px;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
}

.nested-header {
  margin: 0 0 8px;
}

.nested-section.collapsed .nested-header {
  margin-bottom: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
}

.modal-content {
  width: min(900px, 96vw);
  background: #fff;
  border: 1px solid #6f7f90;
  padding: 10px;
}

.modal-head, .modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.screen-footer {
  height: 32px;
  background: #f1f4f7;
  color: #5c6f84;
  border-top: 1px solid #c4ced9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
}

.screen-footer a {
  color: #2f86c5;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #1f2937;
  color: #fff;
  border: 1px solid #111827;
  padding: 8px 10px;
  max-width: 460px;
}

.hidden { display: none !important; }

.scroll-side-fill {
  position: fixed;
  top: 0;
  height: 100vh;
  background: linear-gradient(#44b2de, #2f9fcc);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 110;
}

.scroll-side-fill.is-active {
  opacity: 1;
}

.scroll-arrow {
  position: fixed;
  border: 1px solid #5aa8cf;
  background: linear-gradient(#44b2de, #34a6d7);
  color: #e9f7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 120;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: opacity 0.18s ease, background-color 0.18s ease, visibility 0.18s ease, border-color 0.18s ease;
}

.scroll-arrow-left {
  border-radius: 0;
  border-right-color: #38516b;
}

.scroll-arrow-right {
  border-radius: 0;
  border-left-color: #38516b;
}

.scroll-arrow.is-visible {
  opacity: 0.95;
  visibility: visible;
}

.scroll-arrow:hover {
  background: linear-gradient(#3da9d3, #2f9ecc);
  border-color: #4f9cc2;
}

.scroll-arrow .fa {
  font-size: 15px;
  line-height: 1;
}

.main-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px 0 10px;
}

.main-left {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.main-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tile {
  min-height: 68px;
  border: 1px solid #6fb5d8;
  background: #33a6d8;
  color: #e9f6ff;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.1px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.tile:hover:not(.tile-disabled) {
  background: #2e9bc9;
  border-color: #5ea8cd;
}

.tile-dark {
  border-color: #425a74;
  background: #304862;
  color: #e1ebf5;
}

.tile-dark:hover:not(.tile-disabled) {
  background: #3a5370;
  border-color: #4f6882;
}

.tile-big {
  min-height: 250px;
  font-size: 47px;
  line-height: 0.98;
  align-items: flex-end;
  padding: 16px 14px;
}

.tile-big span {
  position: relative;
  z-index: 2;
  display: block;
}

.tile-img {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 94px;
  height: 94px;
  object-fit: contain;
  z-index: 1;
}

.tile-wide {
  grid-column: span 2;
}

.main-right .tile {
  gap: 8px;
  min-height: var(--main-right-tile-height);
  height: var(--main-right-tile-height);
  font-size: 13px;
  line-height: 1;
  padding: 0 9px;
}

.main-right .tile span {
  display: block;
  white-space: nowrap;
}

.main-left .tile-wide {
  min-height: var(--main-left-bottom-tile-height);
  height: var(--main-left-bottom-tile-height);
  font-size: 13px;
  line-height: 1;
  align-items: center;
  padding: 0 10px;
}

.tile-icon {
  width: 14px;
  flex: 0 0 14px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  opacity: 0.95;
}

.tile-disabled .tile-icon {
  opacity: 0.65;
}

.directories-board {
  padding: 0 0 10px;
}

.directories-title {
  margin: 0 0 4px;
  font: 31px/1 "open_sansregular", arial, helvetica, sans-serif;
  color: #4a5f74;
  font-weight: 400;
}

.directories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.directories-column {
  display: flex;
  flex-direction: column;
}

.directory-link {
  min-height: 31px;
  border: 1px solid #d0d4d9;
  border-bottom: none;
  background: #eff1f3;
  color: #4a5d70;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.15;
  padding: 3px 12px 3px 15px;
  display: flex;
  align-items: center;
  position: relative;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.directory-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #2db4d7;
}

.directory-link:hover {
  background: #e2e6ea;
  color: #3f5162;
}

.directories-column .directory-link:last-child {
  border-bottom: 1px solid #d0d4d9;
}

.tile-disabled {
  background: #e6eaee;
  color: #c1c9d1;
  border-color: #d7dde3;
}

@media (max-width: 900px) {
  .filters-grid, .form-grid, .filters-grid.two-cols, .quick-form { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: span 1; }
  .main-dashboard { grid-template-columns: 1fr; }
  .main-left, .main-right { grid-template-columns: 1fr; }
  .tile-wide { grid-column: span 1; }
  .directories-grid { grid-template-columns: 1fr; gap: 8px; }
}
