/* ==========================================================================
   BOS – İKK İşlemleri
   Figma: BOS Ekranları / node 186:23129
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  --neutral-0: #ffffff;
  --neutral-1: #fcfcfd;
  --neutral-2: #f9fafb;
  --neutral-3: #f3f4f7;
  --neutral-4: #ebecf0;
  --neutral-5: #cfd5de;
  --neutral-6: #96a2b6;
  --neutral-7: #647087;
  --neutral-9: #324057;
  --neutral-10: #1b293a;
  --neutral-11: #0c1829;

  --primary-5: #509acf;
  --primary-6: #2481c3;
  --primary-7: #1d679c;
  --primary-9: #10192a;

  --info-2: #d3e6f3;
  --info-6: #2381c4;
  --danger-1: #fbe9eb;
  --danger-8: #841320;
  --success-2: #e2f4ef;
  --accent: #e5015a;

  --mi-1: #ffd9f7;
  --mi-2: #c6f6d3;
  --mi-3: #ffddbb;
  --mi-4: var(--info-2);

  --radius-outer: 10px;
  --radius-inner: 6px;

  --shadow-card: 0 12px 24px rgba(39, 51, 59, 0.05);
  --shadow-float: 0 2px 5.45px rgba(39, 51, 59, 0.1);

  --topbar-h: 54px;
  --rail-w: 55px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: var(--neutral-9);
  background: var(--neutral-3);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  flex: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary-6);
  outline-offset: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "top top top"
    "nav main aside";
  min-width: 1200px;
  min-height: 100vh;
}

/* ---------- Top navigation ---------- */
.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 8px 20px 9px;
  background: var(--neutral-2);
  border-bottom: 1px solid var(--neutral-4);
}

.topbar__brand,
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 285px;
}

.topbar__actions {
  justify-content: flex-end;
}

/* The logo bitmap has padding around it; crop it exactly as in the design. */
.brand-logo {
  position: relative;
  width: 67px;
  height: 24px;
  overflow: hidden;
}
.brand-logo img {
  position: absolute;
  left: -17.91%;
  top: -83.6%;
  width: 135.82%;
  height: 267.2%;
  max-width: none;
}
.brand-logo--muted {
  opacity: 0.18;
}

.v-divider {
  flex: none;
  width: 1px;
  height: 26px;
  background: var(--neutral-4);
}
.v-divider--lg {
  height: 36px;
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 540px;
  height: 100%;
  padding: 0 14px;
  background: var(--neutral-0);
  border: 1px solid var(--neutral-4);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.search:focus-within {
  border-color: var(--primary-6);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}
.search input::placeholder {
  color: var(--neutral-6);
}

.avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
}
.avatar img {
  position: absolute;
  left: -5.72%;
  top: -3.53%;
  width: 111.45%;
  height: 167.17%;
  max-width: none;
}

/* ---------- Icon button (shared by rails, top bar and table) ---------- */
.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 4px;
}
.icon-btn:hover {
  background: var(--neutral-4);
}
.icon-btn--outlined {
  border: 1px solid var(--neutral-4);
}
.icon-btn--active,
.icon-btn--active:hover {
  background: linear-gradient(226deg, var(--primary-9) 33.2%, var(--primary-7) 100%);
}
.icon-btn--success,
.icon-btn--success:hover {
  background: var(--success-2);
}
.icon-btn--flip img {
  transform: scaleX(-1);
}

/* Tooltip shown to the right of rail items */
.icon-btn[data-tooltip]::after,
.icon-btn[data-tooltip]::before {
  position: absolute;
  top: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  left: 35px;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--primary-7);
  color: var(--neutral-0);
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
  z-index: 40;
}
.icon-btn[data-tooltip]::before {
  content: "";
  left: 32px;
  width: 7px;
  height: 7px;
  background: var(--primary-7);
  transform: translateY(-50%) rotate(45deg);
  z-index: 40;
}
.icon-btn[data-tooltip]:hover::after,
.icon-btn[data-tooltip]:hover::before,
.icon-btn[data-tooltip]:focus-visible::after,
.icon-btn[data-tooltip]:focus-visible::before {
  opacity: 1;
}

/* ---------- Side rails ---------- */
.sidenav,
.aside {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  background: var(--neutral-2);
  z-index: 20;
}

.sidenav {
  grid-area: nav;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-right: 1px solid var(--neutral-4);
}
.sidenav__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aside {
  grid-area: aside;
  border-left: 1px solid var(--neutral-4);
}
.aside__head {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--neutral-4);
}

/* ---------- Main column ---------- */
.main {
  grid-area: main;
  min-width: 0;
  padding: 3px 0 48px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 24px;
  list-style: none;
  white-space: nowrap;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumbs li + li::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("../assets/chevron-down.svg") center / 16px 16px no-repeat;
  transform: rotate(-90deg);
}
.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

.section {
  padding: 0 24px;
}
.section--summary {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

/* ---------- Summary card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  background: var(--neutral-0);
  border-radius: var(--radius-outer);
}
.card__head {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  height: 50px;
  padding: 4px 12px 2px;
}
.card__label {
  font-weight: 500;
  color: var(--primary-7);
}
.card__value {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--neutral-10);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(42.67px, auto);
  column-gap: 32px;
  margin: 0;
  padding: 11px;
  background: var(--neutral-2);
  border: 1px solid var(--neutral-4);
  border-radius: var(--radius-inner);
  filter: drop-shadow(0 12px 12px rgba(39, 51, 59, 0.05));
}
.detail-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--neutral-4);
  font-weight: 500;
  white-space: nowrap;
}
.detail-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.detail-grid dt {
  color: var(--primary-7);
}
.detail-grid dd {
  margin: 0;
  color: var(--neutral-10);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 4px 8px;
  border-radius: 9px;
  background: var(--neutral-4);
  color: var(--neutral-11);
  font-size: 10px;
  line-height: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.badge--regular {
  font-weight: 400;
}
.badge--danger {
  background: var(--danger-1);
  color: var(--danger-8);
}
.badge--mi-1 {
  background: var(--mi-1);
}
.badge--mi-2 {
  background: var(--mi-2);
}
.badge--mi-3 {
  background: var(--mi-3);
}
.badge--mi-4 {
  background: var(--mi-4);
}

/* ---------- Quick actions ---------- */
.quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 90px;
}

.hero-btn {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex: none;
  width: 173px;
  height: 100%;
  padding: 16px 12px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 2px 10.9px rgba(39, 51, 59, 0.1);
  color: var(--neutral-0);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-align: left;
}
.hero-btn__label {
  display: block;
  width: 82px;
}
.hero-btn__art {
  position: absolute;
  right: -16.63px;
  max-width: none;
}
.hero-btn__art--car {
  top: 28.71px;
  transform: scaleX(-1);
}
.hero-btn__art--reflection {
  top: 65.94px;
  transform: rotate(180deg);
}

.quick-actions__list {
  display: flex;
  flex: 1;
  gap: 12px;
  min-width: 0;
}

.action-btn {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 0;
  height: 92px;
  padding: 12px;
  border-radius: 8px;
  background: var(--neutral-0);
  filter: drop-shadow(var(--shadow-float));
  text-align: left;
  transition: transform 0.12s;
}
.action-btn:hover {
  transform: translateY(-1px);
}
.action-btn__label {
  flex: 1;
  align-self: stretch;
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: transparent;
  background: linear-gradient(to bottom, var(--primary-9), var(--primary-7));
  -webkit-background-clip: text;
  background-clip: text;
}
.action-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 35.6px;
  height: 35.6px;
  border-radius: 50%;
  background: var(--primary-7);
}
.action-btn__icon img {
  width: 17.058px;
  height: 17.8px;
}

/* ---------- Section title row + pill buttons ---------- */
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 12px 0;
}
.title-row--end {
  justify-content: flex-end;
}
.title-row h2 {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.title-row__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--neutral-3);
  color: var(--primary-7);
  font-weight: 500;
  white-space: nowrap;
}
.pill-btn:hover {
  background: var(--neutral-4);
}
.pill-btn--primary,
.pill-btn--primary:hover {
  background: linear-gradient(to left, var(--primary-9), var(--primary-5));
  color: var(--neutral-0);
}
.pill-btn--primary:hover {
  filter: brightness(1.08);
}
.pill-btn--raised {
  box-shadow: var(--shadow-card);
}

/* ---------- Table panel ---------- */
.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--neutral-1);
  border-radius: var(--radius-outer);
  box-shadow: var(--shadow-card);
}

.table-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-outer) var(--radius-outer) 0 0;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 10px;
  line-height: 14px;
  font-weight: 500;
  color: var(--neutral-7);
}

/* Column widths (design: 110 / 108 / 5 × 129 / 141 / 141 / 97 / 44 at 1284px) */
.data-table .col-line {
  width: 110px;
}
.data-table .col-code {
  width: 108px;
}
.data-table .col-wide {
  width: 11%;
}
.data-table .col-last {
  width: 7.55%;
}
.data-table .col-action {
  width: 44px;
}

.data-table th,
.data-table td {
  height: 41px;
  padding: 8px 12px;
  border: 1px solid var(--neutral-4);
  background: var(--neutral-0);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tr > :first-child {
  border-left: 0;
}
.data-table tr > :last-child {
  border-right: 0;
}

.data-table thead th {
  height: 48px;
  border-top: 0;
  background: var(--neutral-1);
  color: var(--primary-7);
  font-weight: 500;
}
.data-table thead th:first-child {
  padding-left: 15px;
  border-top-left-radius: var(--radius-outer);
}
.data-table thead th:last-child {
  border-top-right-radius: var(--radius-outer);
}
.data-table thead th:nth-child(-n + 2) {
  background: var(--neutral-0);
}
.data-table thead th:nth-child(n + 8) {
  padding-left: 6px;
}

/* 12px gap between row groups: the panel background shows through */
.data-table .spacer td {
  height: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.data-table .cell-line {
  padding: 6px;
  vertical-align: top;
}
.data-table .cell-code {
  color: var(--info-6);
}
.data-table .cell-code > span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.data-table .cell-code > span > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table .cell-badge {
  padding: 6px;
}
.data-table .cell-action {
  padding: 5px 6px;
  box-shadow: -4px 0 2px rgba(0, 0, 0, 0.04);
  clip-path: inset(0 0 0 -8px);
}

/* ---------- Entry row ---------- */
.data-table .entry td {
  height: 42px;
  padding: 0;
}
.data-table .entry .cell-action {
  padding: 5px 6px;
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 40px;
  padding: 0 6px 0 12px;
  outline: 1px solid transparent;
  outline-offset: -1px;
}
.field:focus-within,
.field.is-open {
  outline-color: var(--info-6);
}
.field--chip {
  padding-left: 6px;
}
.field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 500;
  color: var(--neutral-7);
  text-overflow: ellipsis;
}
.field input::placeholder {
  color: var(--neutral-5);
}
.field--code input::placeholder {
  color: var(--neutral-7);
}

.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--neutral-3);
}
.chip:hover {
  background: var(--neutral-4);
}

/* İş satırı picker – two visual variants from the design */
.line-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-weight: 500;
  text-align: left;
}
.line-select--boxed {
  margin: 4px 6px;
  width: calc(100% - 12px);
  padding: 7px 12px;
  border: 1px solid var(--neutral-5);
  border-radius: var(--radius-inner);
  background: var(--neutral-0);
  color: var(--neutral-9);
}
.line-select--boxed[aria-expanded="true"] {
  border-color: var(--primary-6);
}
.line-select--inline {
  height: 40px;
  padding: 6px;
  color: var(--neutral-6);
  outline: 1px solid transparent;
  outline-offset: -1px;
}
.line-select--inline[aria-expanded="true"],
.line-select--inline:focus-visible {
  outline-color: var(--primary-6);
}
.line-select__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-select .badge {
  height: 22px;
}

/* ---------- Floating lists (İş satırı menu + Parça kodu autocomplete) ---------- */
.popup {
  position: absolute;
  z-index: 10;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--neutral-4);
  border-radius: 0 0 var(--radius-inner) var(--radius-inner);
  background: var(--neutral-0);
  filter: drop-shadow(var(--shadow-float));
  font-size: 10px;
  line-height: 14px;
  font-weight: 500;
  color: var(--neutral-7);
}
.popup[hidden] {
  display: none;
}
.popup li + li {
  border-top: 1px solid var(--neutral-4);
}
.popup [role="option"] {
  cursor: pointer;
}
.popup [role="option"]:hover,
.popup [role="option"].is-active {
  background: var(--neutral-2);
}

.popup--lines {
  width: 112px;
}
.popup--lines li {
  display: flex;
  align-items: center;
  height: 41px;
  padding: 6px 12px;
}

.popup--codes {
  width: 283px;
  border-radius: var(--radius-inner) 0 var(--radius-inner) var(--radius-inner);
}
.popup--codes [role="option"] {
  display: grid;
  grid-template-columns: 111px minmax(0, 1fr);
  height: 41px;
}
.popup--codes [role="option"] > span {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  overflow: hidden;
}
.popup--codes [role="option"] > span > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.popup--codes [role="option"] > span + span {
  border-left: 1px solid var(--neutral-4);
}
.popup__hint {
  padding: 8px 12px;
  line-height: 16px;
  color: var(--primary-6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popup__empty {
  padding: 12px;
  color: var(--neutral-6);
}

/* ---------- Totals ---------- */
.totals {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 20px 12px;
  font-weight: 500;
}
.totals > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.totals > div + div {
  padding-left: 12px;
  border-left: 1px solid var(--neutral-4);
}
.totals dt {
  font-size: 10px;
  line-height: 14px;
  color: var(--primary-7);
  text-transform: uppercase;
  white-space: nowrap;
}
.totals dd {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--neutral-9);
}
