@font-face {
  font-family: IBM Plex Sans;
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+100-2BA, U+2BD-2C5, U+2C7-2CC, U+2CE-2D7, U+2DD-2FF, U+304, U+308, U+329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: IBM Plex Sans;
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  color: #17272d;
  background: #f3f5f6;
  --nav: #0b4d56;
  --accent: #0b6974;
  --border: #dce3e6;
  --muted: #52656d;
}
* { box-sizing: border-box; }
body { margin: 0; }
.inventory-page { font-size: 14px; font-weight: 400; line-height: 18.2px; }
.inventory-page p { line-height: inherit; }
.inventory-page .page-header h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 36.4px;
  letter-spacing: -0.56px;
}
.inventory-page #open-receive { font-size: 14px; font-weight: 500; line-height: 18.2px; }
.inventory-page .filters :is(input, select) {
  font-size: 12px;
  font-weight: 400;
  line-height: 15.6px;
}
.inventory-page .filters select { appearance: base-select; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { background: var(--nav); color: white; padding: 25px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand strong { display: block; letter-spacing: .09em; }
.brand div span { display: block; color: #bdd9dd; margin-top: 2px; font-size: .86rem; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--nav); font-weight: 700; flex: none; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar a { font-size: 14px; font-weight: 400; line-height: 18.2px; color: #dcf0f2; text-decoration: none; padding: 10px; border-radius: 7px; }
.sidebar a:hover, .sidebar a[aria-current] { background: #ffffff20; color: white; }
.sidebar a[aria-current] { font-weight: 600; }
.sidebar-footer { margin-top: auto; }
.workspace main { min-width: 0; width: 100%; padding: 34px clamp(14px, 3vw, 44px); }
h1 { margin: 0 0 7px; font-size: 2rem; line-height: 1.17; letter-spacing: -.035em; }
h2 { font-size: 1.12rem; margin: 0; }
p { color: var(--muted); margin: 0; line-height: 1.5; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
button, input, select, textarea { font: inherit; border: 1px solid #ccd7db; border-radius: 7px; background: white; color: inherit; padding: 8px 11px; }
button { cursor: pointer; font-weight: 600; }
button:disabled { opacity: .55; cursor: default; }
button:not(:disabled):hover { background: #e9f2f4; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.primary:not(:disabled):hover { background: var(--nav); }
:focus-visible { outline: 2px solid #168ca0; outline-offset: 3px; }
.metrics {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 16px;
  margin-bottom: 12px;
  padding-block: 10px 12px;
  overflow-x: auto;
  background: #f3f5f6;
}
#hatlar { scroll-margin-top: 184px; }
.metric-card, .inventory { background: white; border: 1px solid var(--border); border-radius: 10px; }
.metric-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  min-height: 152px;
  padding: 18px 20px;
}
.metric-card h2 { color: #445c66; font-size: 12px; line-height: 16px; font-weight: 600; }
.metric-card > strong { font-size: 27px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-breakdown, .metric-details { display: grid; gap: 3px; color: var(--muted); font-size: 12px; line-height: 16px; }
.metric-breakdown [data-operator="vodafone"] { color: #b51c1c; }
.metric-breakdown [data-operator="turkcell"] { color: #07529b; }
.metric-breakdown [data-operator="turktelekom"] { color: #00758a; }
.metric-details { margin-top: 2px; font-weight: 600; }
.metric-details [data-tone="active"] { color: #196747; }
.metric-details [data-tone="passive"] { color: #a32b1d; }
.filters, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; }
.filters h2, .pagination span { margin-right: auto; }
.table-scroll { overflow-x: auto; }
.inventory table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  color: #223b44;
  font-size: 12px;
  line-height: 17px;
}
.inventory th, .inventory td { padding-inline: 20px; }
.inventory th {
  height: 41px;
  border-block: 1px solid #e4eaec;
  background: #f5f8f8;
  color: #5b7079;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
}
.inventory tbody tr { height: 52px; }
.inventory td {
  padding-block: 8px;
  border-bottom: 1px solid #e7edef;
  font-weight: 400;
}
.inventory tbody tr:last-child td { border-bottom: 0; }
.inventory td button { padding: 4px 8px; font-size: inherit; font-weight: 400; }
.identifier { font-variant-numeric: tabular-nums; }
.inventory .customer-name {
  width: 30%;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.inventory .line-number { font-weight: 700; }
.operator-imei {
  display: block;
  margin-top: 3px;
  color: #607680;
  font-size: 10px;
  line-height: 14px;
  font-weight: 400;
}
.inventory .match-reason { white-space: normal; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #d4e7df;
  border-radius: 6px;
  background: #e2f0ec;
  color: #24583e;
  font-size: 10px;
  line-height: 13px;
  font-weight: 400;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.stock { border-color: #d6e2e6; background: #ebf0f2; color: #3c5159; }
.badge.mismatch { border-color: #f5ddd7; background: #fae4e2; color: #892b22; }
.badge.pending { border-color: #f3dfb3; background: #fff1d5; color: #72500e; }
.inventory td.empty { color: var(--muted); text-align: center; padding-block: 36px; }
.pagination { border-top: 1px solid #e4eaec; }
#notice { margin-top: 12px; }
dialog { width: min(490px, 100% - 30px); border: 1px solid #ccd7db; border-radius: 10px; color: inherit; padding: 20px; }
dialog::backdrop { background: #17272d88; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-weight: 600; }
textarea { resize: vertical; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-error { color: #9b2f22; }
.form-error:empty { display: none; }
.login { display: grid; grid-template-columns: 48% 1fr; min-height: 100svh; }
.login-brand, .login-main { padding: clamp(24px, 3.5vw, 50px); }
.login-brand { background: var(--nav); color: white; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-brand h2 { max-width: 400px; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.15; margin-bottom: 14px; }
.login-brand p { color: #bdd9dd; }
.login-footer { font-size: .83rem; }
.login-main { display: grid; place-items: center; }
.login-content { width: min(100%, 400px); }
.login-content fieldset { display: grid; gap: 14px; border: 0; margin: 22px 0; padding: 0; min-width: 0; }
.login-content input, .login-content button { min-height: 44px; }
.preview-back { color: var(--accent); font-weight: 600; }
@media (max-width: 780px) {
  .workspace, .login { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 14px; gap: 10px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 0; }
  .sidebar-footer { align-self: flex-start; }
  .workspace main { padding-top: 23px; }
  .login-brand { gap: 22px; }
}
@media (max-width: 480px) {
  .metrics { gap: 10px; }
  .filters h2 { width: 100%; }
  .filters input, .filters select { max-width: 100%; }
}

.inventory td .line-detail-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #075d69;
  font-weight: inherit;
  text-underline-offset: 2px;
}
.inventory td .line-detail-link:hover { background: transparent; text-decoration: underline; }
#line-detail {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(100%, 460px);
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 22px 24px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  overflow-y: auto;
}
.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-header h2 { margin-top: 6px; font-size: 24px; line-height: 1.2; }
#detail-body section { margin-top: 22px; }
#detail-body h3 { margin: 0; font-size: 14px; }
#detail-body dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 12px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
#detail-body dt { color: var(--muted); }
#detail-body dd { margin: 0; overflow-wrap: anywhere; }
#detail-body .detail-source { margin-top: 24px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

#file-mapping:not([hidden]) { display: grid; gap: 10px; }
#manual-numbers[hidden] { display: none; }

[hidden] { display: none !important; }
.metric-breakdown a, .metric-details a { color: inherit; text-decoration: none; justify-self: start; }
.metric-breakdown a:hover, .metric-details a:hover { text-decoration: underline; }
#logout {
  align-self: start;
  color: #fff;
  background: #ffffff14;
  border-color: #ffffff66;
}
#logout:not(:disabled):hover { background: #ffffff29; }
.user-management { display: grid; grid-template-columns: minmax(235px, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
.user-management section { min-width: 0; }
#user-notice, #user-error { margin-top: 12px; }
@media (max-width: 780px) {
  .user-management { grid-template-columns: minmax(0, 1fr); }
}

.mobile-navigation { display: flex; flex: 1; flex-direction: column; gap: 12px; }
.mobile-navigation > summary { display: none; cursor: pointer; }
.mobile-navigation::details-content { display: flex; flex: 1; flex-direction: column; gap: 12px; }
.mobile-navigation #logout { margin-top: auto; }
.metric-card > strong a { color: inherit; text-decoration: none; }
.metric-card > strong a:hover { text-decoration: underline; }
.metric-warning { border-color: #edcd8a; }
.metric-warning > strong, .end-soon, .customer-warning { color: #8a4d0b; }
.metric-breakdown .zero-count { color: #667d86; }
#hatlar .table-scroll { max-height: 66vh; overflow: auto; }
#hatlar thead th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px #e4eaec; }
#hatlar thead button { font: inherit; color: inherit; padding: 2px 0; background: transparent; border: 0; }
#hatlar th[aria-sort="ascending"] button::after { content: " ↑"; }
#hatlar th[aria-sort="descending"] button::after { content: " ↓"; }
#hatlar .customer-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 270px; }
#hatlar .pagination label { display: flex; align-items: center; gap: 5px; }
#page-number { width: 5em; }
#hatlar .pagination #page-total { margin: 0; }
#detail-body > button { margin-top: 12px; }
.review-actions { flex-wrap: wrap; }
.role-guide { margin-bottom: 0; }
.role-guide dt { font-weight: 600; margin-top: 8px; }
.role-guide dd { margin: 2px 0 0; color: var(--muted); }
#user-rows button + button { margin-left: 6px; }
@media (max-width: 780px) {
  .mobile-navigation > summary { display: list-item; }
  .mobile-navigation #logout { margin-top: 4px; }
}

.metrics .metric-card { cursor: pointer; }
