/* BONO SAYIM — UI polish layer
 * UI-only: no data, API or persistence changes.
 */
:root {
  --bono-accent: #2446d8;
  --bono-accent-strong: #1835b6;
  --bono-accent-soft: color-mix(in srgb, var(--bono-accent) 11%, transparent);
  --bono-success: #16845a;
  --bono-warning: #a86608;
  --bono-danger: #c52b3a;
  --bono-focus: color-mix(in srgb, var(--bono-accent) 32%, transparent);
}

/* Work surfaces stay readable and quiet; glass is reserved for transient chrome. */
.form-card, .stat-card, .dashboard-card, .table-wrap, .list-card,
.modal-card, .modal-content, .panel, .empty-state, .login-box {
  background: color-mix(in srgb, #ffffff 88%, transparent) !important;
  border-color: color-mix(in srgb, #1d1d1f 10%, transparent) !important;
}

button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:not(:disabled):active { transform: translateY(1px) scale(.985); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--bono-focus);
  outline-offset: 2px;
}

/* Financial and stock values scan better when digits line up. */
.uk-fiyat, .uk-stok, .sum-val, .summary-value, .metric-value,
.stat-value, .bakiye, .tutar, [data-bono-number], [data-bono-money] {
  font-variant-numeric: tabular-nums lining-nums;
}

.ui-operation-island {
  position: fixed;
  z-index: 7000;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  max-width: min(440px, calc(100vw - 28px));
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.64);
  border-radius: 999px;
  background: rgba(29,29,31,.88);
  color: #fff;
  box-shadow: 0 14px 38px rgba(0,0,0,.18);
  backdrop-filter: blur(22px) saturate(150%);
  transform: translate(-50%, -14px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out, transform 220ms cubic-bezier(.2,.8,.2,1);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.ui-operation-island.is-visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}
.ui-operation-island[data-state="success"] { background: rgba(18,105,72,.92); }
.ui-operation-island[data-state="error"] { background: rgba(157,30,45,.94); }
.ui-operation-island[data-state="working"] { background: rgba(29,29,31,.92); }
.ui-operation-island__icon { width: 16px; height: 16px; flex: none; }
.ui-operation-island__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ui-hold-button { position: relative; overflow: hidden; }
.ui-hold-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: .12;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.ui-hold-button.is-holding::after {
  transform: scaleX(1);
  transition: transform 1000ms linear;
}
.ui-hold-button.is-holding { color: #fff !important; background: var(--bono-danger) !important; }

.ui-cancel-edit {
  color: var(--ink-soft, #6e6e73) !important;
  background: transparent !important;
  border-color: transparent !important;
}
.ui-cancel-edit:not(:disabled):hover { color: var(--bono-danger) !important; }

@media (max-width: 640px) {
  .ui-operation-island { max-width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .ui-operation-island { transition: opacity 120ms ease; transform: translate(-50%, 0); }
  button:not(:disabled):active { transform: none; }
  .ui-hold-button::after { transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .ui-operation-island { background: #1d1d1f; backdrop-filter: none; }
}

/* Form controls: one predictable touch target and readable numeric entry. */
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea,
.modal-card input:not([type="checkbox"]):not([type="radio"]),
.modal-card select,
.modal-card textarea,
.panel input:not([type="checkbox"]):not([type="radio"]),
.panel select,
.panel textarea {
  min-height: 42px;
  border-radius: 13px;
  font-variant-numeric: tabular-nums;
}
.form-card input[type="number"],
.modal-card input[type="number"],
.panel input[type="number"] {
  text-align: right;
}
.form-card input::placeholder,
.modal-card input::placeholder,
.panel input::placeholder,
.form-card textarea::placeholder,
.modal-card textarea::placeholder,
.panel textarea::placeholder {
  color: color-mix(in srgb, currentColor 42%, transparent);
}

/* BONO SAYIM — component pass
 * The app remains operational and information-dense; hierarchy is improved
 * through rhythm, touch targets and restrained emphasis.
 */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.shell, .shell-body, .screen { min-width: 0; }
.topbar {
  min-height: 64px;
  border-bottom: 1px solid color-mix(in srgb, #1d1d1f 8%, transparent);
}
.nav-btn, .hizli-btn, .group-sekme-btn, .grup-sekme-btn, .tab-btn,
.btn, .status-btn {
  transition: transform 160ms ease, background-color 160ms ease,
              border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}
.nav-btn:not(:disabled):hover, .hizli-btn:not(:disabled):hover,
.group-sekme-btn:not(:disabled):hover, .grup-sekme-btn:not(:disabled):hover,
.tab-btn:not(:disabled):hover, .btn:not(:disabled):hover,
.status-btn:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--bono-accent) 28%, transparent);
}
.nav-btn.active, .tab-btn.active, .grup-sekme-btn.active {
  color: var(--bono-accent-strong);
  background: var(--bono-accent-soft);
}
.screen-head {
  gap: 14px;
  align-items: center;
}
.screen-head h1, .screen-head h2, .ana-baslik {
  letter-spacing: -0.025em;
}
.form-card, .islem-kart, .cari-ozet, .count-summary, .ana-listeler {
  border-radius: 20px;
}
.form-card, .islem-kart {
  padding: clamp(14px, 2vw, 22px);
}
.form-card label, .islem-kart label, .ayar-bolum label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
  color: color-mix(in srgb, currentColor 68%, transparent);
}
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea,
.islem-kart input:not([type="checkbox"]):not([type="radio"]),
.islem-kart select,
.islem-kart textarea,
.ayar-bolum input:not([type="checkbox"]):not([type="radio"]),
.ayar-bolum select,
.ayar-bolum textarea {
  min-height: 44px;
  border-radius: 13px;
  padding-inline: 13px;
  font-size: 14px;
}
.btn, .hizli-btn, .nav-btn, .tab-btn, .status-btn {
  min-height: 40px;
}
.btn-primary, .btn-success, .btn-dark {
  font-weight: 700;
  letter-spacing: -.01em;
}
.table-wrap {
  border-radius: 18px;
  overflow: auto;
}
.table-wrap table { border-collapse: separate; border-spacing: 0; }
.table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, #ffffff 94%, transparent);
  backdrop-filter: blur(12px);
}
.table-wrap td, .table-wrap th { padding-block: 11px; }
.badge, .status-btn { border-radius: 999px; }
.qty, .sc-seri, .sc-cift, .coz-val, .is-tutar {
  font-variant-numeric: tabular-nums lining-nums;
}
@media (max-width: 720px) {
  .topbar { min-height: 58px; }
  .screen-head { align-items: flex-start; flex-wrap: wrap; }
  .head-actions { width: 100%; }
  .head-actions > * { flex: 1 1 auto; }
  .form-card, .islem-kart { border-radius: 17px; padding: 14px; }
  .table-wrap { margin-inline: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-btn, .hizli-btn, .group-sekme-btn, .grup-sekme-btn, .tab-btn,
  .btn, .status-btn { transition: none; }
}
button.is-processing {
  cursor: progress;
  opacity: .72;
}


/* NERVIA motion surface — source-level gooey island + ReactBits-style hold feedback */
.ui-operation-island {
  isolation: isolate;
  filter: url("#nervia-gooey") drop-shadow(0 14px 34px rgba(0,0,0,.18));
  will-change: transform, opacity;
}
.ui-operation-island::before,
.ui-operation-island::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: inherit;
  opacity: .82;
  pointer-events: none;
}
.ui-operation-island::before { left: 14%; bottom: -4px; }
.ui-operation-island::after { right: 16%; top: -4px; }
.ui-operation-island__icon,
.ui-operation-island__text { position: relative; z-index: 1; }

.ui-hold-button {
  --hold-progress: 0;
  --hold-fill: var(--bono-danger);
  isolation: isolate;
  touch-action: manipulation;
}
.ui-hold-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--hold-fill);
  transform: scaleX(var(--hold-progress));
  transform-origin: left center;
  pointer-events: none;
  will-change: transform;
}
.ui-hold-button::after {
  transform: translateX(calc((var(--hold-progress) * 100%) - 100%));
  transition: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.34) 46%, transparent 70%);
  opacity: clamp(0, calc(var(--hold-progress) * 1.7), .55);
  will-change: transform, opacity;
}
.ui-hold-button.is-holding { background: color-mix(in srgb, var(--hold-fill) 16%, transparent) !important; }
.ui-hold-button.is-holding::before { border-radius: inherit; }
.ui-hold-button[data-hold-complete="1"] { --hold-progress: 1; }
@media (prefers-reduced-motion: reduce) {
  .ui-operation-island { filter: none; }
  .ui-operation-island::before, .ui-operation-island::after { display: none; }
  .ui-hold-button::before, .ui-hold-button::after { transition: none; }
}
@media (prefers-contrast: more) {
  .ui-operation-island { border-color: currentColor; backdrop-filter: none; }
  .ui-hold-button { outline: 1px solid currentColor; }
}


/* Screen-by-screen hierarchy pass — each work surface keeps its own first action */
#screen-dashboard .screen-head,
#screen-products .screen-head,
#screen-cari .screen-head,
#screen-report .screen-head,
#screen-settings .screen-head,
#screen-pending .screen-head { margin-bottom: 18px; }
#screen-dashboard .screen-head h1,
#screen-products .screen-head h1,
#screen-cari .screen-head h1,
#screen-report .screen-head h1,
#screen-settings .screen-head h1,
#screen-pending .screen-head h1 { font-size: clamp(21px, 2.2vw, 30px); line-height: 1.12; }
#screen-dashboard .dashboard-card,
#screen-dashboard .stat-card { box-shadow: 0 8px 24px rgba(22,31,54,.06); }
#screen-products #product-search,
#screen-cari #cari-search,
#screen-pending #pending-search { min-height: 46px; font-size: 15px; }
#screen-products .table-wrap,
#screen-cari .table-wrap,
#screen-pending .table-wrap { background: rgba(255,255,255,.74) !important; }
#screen-products .table-wrap tbody tr:hover,
#screen-cari .table-wrap tbody tr:hover,
#screen-pending .table-wrap tbody tr:hover { background: var(--bono-accent-soft); }
#screen-report .cari-ozet,
#screen-report .report-card { min-height: 112px; }
#screen-settings .ayar-bolum { border-radius: 16px; padding: 16px; margin-bottom: 14px; }
#screen-settings .ayar-bolum-baslik { margin-bottom: 10px; }
#screen-pending .pending-controls { gap: 10px; align-items: center; }
#screen-pending .pending-controls > * { min-height: 42px; }
#screen-order .order-edit-banner { display: flex; gap: 10px; align-items: center; }
#screen-order #btn-order-cancel { min-height: 42px; }
#screen-receive .form-card,
#screen-dispatch .form-card,
#screen-incoming .form-card { box-shadow: 0 8px 24px rgba(22,31,54,.05); }
@media (max-width: 720px) {
  #screen-dashboard .dashboard-grid,
  #screen-report .report-grid { grid-template-columns: 1fr; }
  #screen-order .order-edit-banner { align-items: stretch; flex-direction: column; }
  #screen-products .screen-head,
  #screen-cari .screen-head,
  #screen-pending .screen-head { position: sticky; top: 0; z-index: 4; padding-block: 10px; background: rgba(248,249,252,.9); backdrop-filter: blur(16px); }
}


/* NERVIA completion pass — calm density, clear priority and touch-safe controls */
:root {
  --nervia-surface: #fbfbfa;
  --nervia-ink: #1c1c1e;
  --nervia-muted: #6e6e73;
  --nervia-line: rgba(28,28,30,.09);
}
.screen {
  contain: layout paint;
}
.screen-head {
  min-height: 48px;
}
.screen-head .head-actions,
.screen-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.table-wrap td:first-child,
.table-wrap th:first-child { padding-left: 14px; }
.table-wrap td:last-child,
.table-wrap th:last-child { padding-right: 14px; }
.table-wrap tbody tr { transition: background-color 140ms ease; }
.btn:focus-visible, .nav-btn:focus-visible, .tab-btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 4px var(--bono-focus);
}
.ui-operation-island {
  max-width: min(460px, calc(100vw - 24px));
  user-select: none;
}
.ui-operation-island__icon {
  display: grid;
  place-items: center;
  font-weight: 800;
}
@media (max-width: 720px) {
  .screen { padding-inline: 12px; }
  .screen-head .head-actions,
  .screen-head .actions { width: 100%; }
  .screen-head .head-actions > button,
  .screen-head .actions > button { flex: 1 1 140px; }
  .table-wrap { border-radius: 14px; }
  .table-wrap table { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  .table-wrap tbody tr { transition: none; }
}


/* NERVIA final pass — operational hierarchy */
:root {
  --nervia-blue: #2446d8;
  --nervia-blue-soft: rgba(36,70,216,.08);
  --nervia-green-soft: rgba(22,132,90,.10);
  --nervia-warm: #f7f6f2;
}
body {
  background:
    radial-gradient(circle at 92% -10%, rgba(36,70,216,.07), transparent 34rem),
    var(--nervia-warm);
}
.shell-body, .screen {
  background: transparent;
}
.screen-head {
  position: relative;
}
.screen-head h1::after {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--nervia-blue);
  opacity: .82;
}
#screen-dashboard .stat-card,
#screen-dashboard .dashboard-card,
#screen-report .report-card,
#screen-cari .cari-ozet {
  position: relative;
  overflow: hidden;
}
#screen-dashboard .stat-card::before,
#screen-dashboard .dashboard-card::before,
#screen-report .report-card::before,
#screen-cari .cari-ozet::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--nervia-blue);
  opacity: .75;
}
#screen-dashboard .stat-card:nth-child(2)::before,
#screen-report .report-card:nth-child(2)::before { background: var(--bono-success); }
#screen-dashboard .stat-card:nth-child(3)::before,
#screen-report .report-card:nth-child(3)::before { background: var(--bono-warning); }
#screen-dashboard .stat-card:nth-child(4)::before,
#screen-report .report-card:nth-child(4)::before { background: var(--bono-danger); }
#screen-dashboard .metric-value,
#screen-dashboard .stat-value,
#screen-report .summary-value,
#screen-cari .bakiye {
  letter-spacing: -.035em;
  font-weight: 760;
}
#screen-products .table-wrap tbody tr,
#screen-cari .table-wrap tbody tr,
#screen-pending .table-wrap tbody tr {
  border-radius: 12px;
}
#screen-products .table-wrap tbody tr:hover,
#screen-cari .table-wrap tbody tr:hover,
#screen-pending .table-wrap tbody tr:hover {
  box-shadow: inset 3px 0 0 var(--nervia-blue);
}
.quick-actions, .hizli-islemler, .dashboard-actions {
  gap: 10px;
}
.quick-actions .btn, .hizli-islemler .btn, .dashboard-actions .btn {
  min-height: 48px;
  border-radius: 15px;
}
.modal-card, .modal-content {
  max-height: min(88dvh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal-card .modal-actions, .modal-content .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.96) 28%);
}
.ui-cancel-edit {
  min-height: 42px;
  font-weight: 650;
}
@media (max-width: 720px) {
  .screen-head h1::after { margin-top: 6px; }
  .quick-actions, .hizli-islemler, .dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-actions .btn, .hizli-islemler .btn, .dashboard-actions .btn {
    min-width: 0;
    padding-inline: 10px;
  }
  .modal-card, .modal-content {
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .table-wrap tbody tr { transition: none; }
}
