:root {
  --bg: #e8f6ff;
  --panel: rgba(246, 252, 255, 0.88);
  --panel-strong: #ffffff;
  --line: rgba(12, 98, 145, 0.14);
  --text: #11344a;
  --muted: #5f8297;
  --accent: #1098ad;
  --accent-dark: #0c6a8f;
  --ok: #198754;
  --warn: #d97706;
  --danger: #d9485f;
  --shadow: 0 18px 40px rgba(17, 74, 107, 0.12);
  font-family: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(16, 152, 173, 0.2), transparent 25%),
    radial-gradient(circle at bottom right, rgba(12, 106, 143, 0.16), transparent 25%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  padding: 24px;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.app-shell.app-locked {
  pointer-events: none;
  user-select: none;
  filter: blur(4px);
  transform: scale(0.995);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(230, 246, 255, 0.42);
  backdrop-filter: blur(8px);
}

.auth-card {
  position: relative;
  width: min(460px, calc(100vw - 48px));
  max-width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(84, 176, 206, 0.22);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(10, 62, 88, 0.18);
  padding: 28px;
}

.auth-card h2 {
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}

.auth-overlay:not([hidden]) {
  align-items: center !important;
  display: grid !important;
  justify-items: center !important;
  min-height: 100dvh;
}

.auth-overlay:not([hidden]) .auth-card {
  align-self: center;
  justify-self: center;
}

.auth-feedback {
  min-height: 1.25rem;
  margin-top: 10px;
}

.auth-feedback.error {
  color: #b94b3f;
}

.auth-feedback.success {
  color: #167f56;
}

.brand-lock-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.sidebar,
.card,
#transaction-dialog,
#collection-dialog {
  backdrop-filter: blur(12px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.brand {
  padding: 24px;
}

.card {
  padding: 20px;
}

.stack,
.detail-column,
.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  background: linear-gradient(135deg, #f5fdff, #e3f4fb);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.operations-hero {
  display: flex;
  flex-direction: column;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  width: 100%;
  align-items: stretch;
}

.operations-intro {
  max-width: 760px;
}

.quick-entry-card,
.daily-board-card {
  min-height: 100%;
}

.quick-entry-card {
  min-width: 0;
}

.daily-board-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.daily-board-card .section-head {
  margin-bottom: 12px;
}

.daily-board-card #daily-operations-list {
  flex: 1;
  min-height: 420px;
}

.hero-stats,
.overview-grid,
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.stat-card,
.overview-card {
  background: var(--panel-strong);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
}

.period-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.period-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.period-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.period-line strong {
  color: var(--text);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 24px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.customer-list-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-list,
.transaction-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-operation-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.customer-operation-track {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 4px 12px;
  scroll-padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.customer-operation-slide {
  flex: 0 0 min(100%, 780px);
  max-width: 100%;
  min-width: 0;
  height: 560px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.customer-operation-slide .transaction-list,
.customer-operation-slide .history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.customer-operation-slide .transaction-list.empty-state,
.customer-operation-slide .history-list.empty-state {
  min-height: 0;
}

.customer-operation-track::-webkit-scrollbar {
  height: 10px;
}

.customer-operation-track::-webkit-scrollbar-thumb {
  background: rgba(16, 152, 173, 0.24);
  border-radius: 999px;
}

.customer-operation-track::-webkit-scrollbar-track {
  background: rgba(12, 98, 145, 0.06);
  border-radius: 999px;
}

.ledger-detail-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-top: 18px;
}

.ledger-detail-track {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 4px 12px;
  scroll-padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.ledger-detail-slide {
  flex: 0 0 min(100%, 680px);
  max-width: 100%;
  min-width: 0;
  height: 420px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.ledger-detail-slide .sub-head {
  margin-top: 0;
}

.ledger-detail-slide .history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.ledger-detail-slide .history-list.empty-state {
  min-height: 0;
}

.ledger-detail-track::-webkit-scrollbar {
  height: 10px;
}

.ledger-detail-track::-webkit-scrollbar-thumb {
  background: rgba(16, 152, 173, 0.24);
  border-radius: 999px;
}

.ledger-detail-track::-webkit-scrollbar-track {
  background: rgba(12, 98, 145, 0.06);
  border-radius: 999px;
}

.customer-item,
.transaction-item,
.history-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.customer-item {
  padding: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.customer-item:hover,
.customer-item.active {
  transform: translateY(-1px);
  border-color: rgba(16, 152, 173, 0.45);
}

.section-head.compact {
  margin-bottom: 10px;
}

.product-picker .section-head.compact {
  align-items: center;
}

.transaction-item {
  padding: 16px;
}

.history-item {
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
}

.compact-actions {
  align-items: flex-start;
  position: relative;
}

.action-primary {
  min-width: 190px;
}

.section-head h2,
.brand h1,
.hero h2 {
  margin: 0;
}

.sub-head {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.muted {
  color: var(--muted);
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

.inline-field {
  min-width: 180px;
}

.action-field {
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

legend {
  padding: 0 8px;
  font-weight: 800;
  color: var(--accent-dark);
}

.primary {
  background: var(--accent);
  color: #fff;
}

.danger {
  background: var(--danger);
  color: #fff;
}

.ghost {
  background: rgba(46, 32, 20, 0.08);
  color: var(--text);
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pill {
  background: rgba(16, 152, 173, 0.12);
  color: var(--accent-dark);
}

.pill-closed {
  background: rgba(76, 175, 80, 0.14);
  color: #2e7d32;
}

.status.pending {
  background: rgba(191, 124, 24, 0.14);
  color: var(--warn);
}

.status.due {
  background: rgba(217, 119, 6, 0.16);
  color: var(--warn);
}

.status.overdue {
  background: rgba(217, 72, 95, 0.14);
  color: var(--danger);
}

.status.scheduled {
  background: rgba(16, 152, 173, 0.14);
  color: var(--accent-dark);
}

.status.partial {
  background: rgba(165, 66, 48, 0.12);
  color: var(--danger);
}

.status.editing {
  background: rgba(16, 152, 173, 0.14);
  color: var(--accent-dark);
}

.status.delivered,
.status.closed {
  background: rgba(43, 122, 75, 0.14);
  color: var(--ok);
}

.amount {
  font-size: 1.5rem;
  font-weight: 800;
}

.meta-row,
.transaction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
}

.transaction-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.history-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.scroll-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 6px;
}

.customer-list-card .customer-list {
  max-height: 980px;
  overflow-y: auto;
  padding-right: 6px;
}

.customer-toolbar {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
}

.customer-search-field {
  min-width: 0;
}

.customer-list-card .customer-list::-webkit-scrollbar {
  width: 10px;
}

.customer-list-card .customer-list::-webkit-scrollbar-thumb {
  background: rgba(16, 152, 173, 0.24);
  border-radius: 999px;
}

.customer-list-card .customer-list::-webkit-scrollbar-track {
  background: rgba(12, 98, 145, 0.06);
  border-radius: 999px;
}

.scroll-list::-webkit-scrollbar {
  width: 10px;
}

.scroll-list::-webkit-scrollbar-thumb {
  background: rgba(16, 152, 173, 0.24);
  border-radius: 999px;
}

.scroll-list::-webkit-scrollbar-track {
  background: rgba(12, 98, 145, 0.06);
  border-radius: 999px;
}

.history-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tools-panel {
  padding: 0;
}

.tool-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

.tool-block h3 {
  margin: 0;
  font-size: 1rem;
}

.recent-customers-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-customer-picker {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
}

.quick-customer-picker input {
  flex: 1;
}

.quick-customer-open-button {
  white-space: nowrap;
  min-height: 48px;
}

#customer-picker-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  background: #f7fdff;
}

#customer-add-dialog,
#customer-editor-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  background: #f7fdff;
}

#customer-add-dialog::backdrop,
#customer-editor-dialog::backdrop {
  background: rgba(37, 23, 13, 0.35);
  backdrop-filter: blur(8px);
}

#customer-picker-dialog::backdrop {
  background: rgba(37, 23, 13, 0.35);
  backdrop-filter: blur(8px);
}

.customer-management-card {
  gap: 12px;
}

.customer-management-card .primary,
.customer-management-card .ghost {
  width: 100%;
}

.customer-picker-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 560px);
  overflow-y: auto;
  padding: 4px;
}

.customer-picker-result {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fff;
  color: #12344e;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.customer-picker-result:hover,
.customer-picker-result:focus-visible {
  border-color: rgba(28, 132, 172, 0.26);
  background: rgba(27, 156, 205, 0.08);
  transform: translateY(-1px);
}

.customer-picker-result.active {
  border-color: rgba(28, 132, 172, 0.3);
  background: rgba(27, 156, 205, 0.12);
}

.customer-picker-empty {
  padding: 10px 12px;
  color: #6c8ba1;
  font-size: 0.92rem;
}

.recent-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.recent-customer-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.recent-customer-chip {
  padding: 10px 12px;
  border-radius: 999px;
}

.action-menu-trigger {
  min-width: 170px;
}

.action-menu-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  width: 100%;
}

.action-menu-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.history-group-title {
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  margin-top: 4px;
  margin-bottom: 2px;
}

.history-filter-tabs .ghost.active {
  background: var(--accent);
  color: #fff;
}

.compact-summary-card {
  padding-top: 16px;
}

.compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.command-center-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-command-center {
  padding-top: 0;
}

.command-center-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.command-list-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.command-stat {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(232, 246, 255, 0.92));
}

.watch-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  padding: 14px;
}

.watch-item strong {
  display: block;
  margin-bottom: 6px;
}

.watch-item .meta-row {
  margin-top: 8px;
}

.watch-item .action-row {
  margin-top: 12px;
}

.watch-item.overdue {
  border-color: rgba(217, 72, 95, 0.28);
  box-shadow: inset 0 0 0 1px rgba(217, 72, 95, 0.08);
}

.watch-item.warning {
  border-color: rgba(217, 119, 6, 0.25);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.06);
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-actions.stacked {
  flex-direction: column;
}

.dialog-actions button {
  width: 100%;
}

.product-picker {
  background: rgba(255, 255, 255, 0.72);
}

.product-row-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) 140px 140px auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.nested-card {
  padding: 18px;
  border-radius: 20px;
}

.catalog-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catalog-list {
  min-height: 260px;
}

.catalog-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.catalog-product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(16, 152, 173, 0.06);
  border: 1px solid rgba(16, 152, 173, 0.12);
}

.product-row label {
  margin: 0;
}

.product-select,
.product-price,
.product-qty {
  width: 100%;
  min-width: 0;
}

.small-button {
  padding: 10px 12px;
  font-size: 0.9rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 24px;
}

#transaction-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(640px, calc(100vw - 32px));
  padding: 0;
  background: #fffaf5;
}

#collection-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  background: #fffaf5;
}

#catalog-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(980px, calc(100vw - 32px));
  padding: 0;
  background: #f7fdff;
}

#settings-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  background: #f7fdff;
}

#customer-actions-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  background: #f7fdff;
}

#rollover-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  background: #f7fdff;
}

#rollover-collection-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  background: #f7fdff;
}

#transaction-dialog::backdrop,
#collection-dialog::backdrop,
#catalog-dialog::backdrop,
#rollover-dialog::backdrop,
#rollover-collection-dialog::backdrop,
#settings-dialog::backdrop,
#customer-actions-dialog::backdrop {
  background: rgba(37, 23, 13, 0.35);
}

.dialog-form {
  padding: 24px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(16, 152, 173, 0.12);
  color: var(--accent-dark);
  padding: 8px 12px;
  font-weight: 700;
}

.quick-collect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-collect-button {
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .brand,
  .hero,
  .card,
  .view,
  .content-grid,
  .operations-grid,
  .detail-column,
  .left-column,
  .customer-operation-panel,
  .ledger-detail-panel,
  .hero-stats,
  .overview-grid,
  .ledger-grid,
  .ozet-card,
  .ozet-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .main-content {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-stats,
  .overview-grid,
  .ledger-grid {
    grid-template-columns: 1fr;
  }

  .stat-card,
  .period-card,
  .command-stat {
    min-width: 0;
  }

  .period-line {
    gap: 8px;
  }

  .period-line strong {
    white-space: nowrap;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    order: 1;
  }

  .operations-hero {
    order: 2;
  }

  .customer-management-section {
    order: 3;
  }

  .content-grid {
    order: 4;
  }

  .settings-entry-section {
    order: 99;
  }

  .hero {
    flex-direction: column;
  }

  .operations-grid {
    grid-template-columns: 1fr;
  }

  .customer-operation-track {
    gap: 12px;
    padding: 0 0 12px;
  }

  .customer-operation-slide {
    flex-basis: 100%;
    height: 520px;
  }

  .ledger-detail-track {
    gap: 12px;
    padding: 0 0 12px;
  }

  .ledger-detail-slide {
    flex-basis: 100%;
    height: 380px;
  }

  .command-center-grid {
    grid-template-columns: 1fr;
  }

  .compact-actions {
    width: 100%;
    justify-content: stretch;
  }

  .action-primary,
  .action-menu-trigger {
    flex: 1 1 220px;
  }

  .product-row {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 140px) minmax(110px, 140px);
  }

  .product-row label:first-child {
    grid-column: 1 / -1;
  }

  .product-row .remove-product-row {
    grid-column: 1 / -1;
    width: 100%;
  }

  .recent-customer-chip {
    width: 100%;
  }

  .quick-customer-results {
    max-height: 260px;
  }

  .quick-customer-picker {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-customer-open-button {
    width: 100%;
  }

  .customer-list-card .customer-list {
    max-height: 235px;
  }
}

@media (max-width: 640px) {
  .auth-overlay {
    padding: 16px;
  }

  .auth-card {
    width: calc(100vw - 44px);
    padding: 22px;
  }

  .auth-card h2 {
    font-size: 1.42rem;
    line-height: 1.2;
  }

  #customer-editor-dialog,
  #customer-add-dialog,
  #customer-picker-dialog {
    width: min(100vw - 16px, 100%);
    max-height: calc(100vh - 16px);
  }

  .dialog-form {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .hero,
  .brand,
  .card,
  .customer-operation-slide,
  .ledger-detail-slide {
    border-radius: 16px;
  }

  .hero,
  .card,
  .customer-operation-slide,
  .ledger-detail-slide {
    padding: 16px;
  }

  .operations-intro h2 {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  .customer-operation-slide {
    height: 560px;
  }

  .customer-operation-slide .transaction-list,
  .customer-operation-slide .history-list {
    min-height: 0;
  }

  .action-row button {
    width: 100%;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    width: 100%;
  }

  .product-row {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .customer-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .quick-collect-grid {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

/* === Musteri ismi ve urun vurgusu (Secenek B) - yalnizca gorunum, veriye dokunmaz === */
.cust-name,
#detail-name,
.customer-item strong,
.customer-picker-result,
.recent-customer-chip,
.watch-item strong {
  color: #c62828;
  text-transform: uppercase;
  font-weight: 700;
}

#detail-name {
  font-size: 1.5rem;
}

.customer-item strong {
  font-size: 1.08rem;
}

.prod-name {
  color: #2e7d32;
  font-weight: 700;
}

/* === Sekme (view) navigasyon - mobil/tablet uyumlu === */
.app-shell {
  display: block;
  grid-template-columns: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px 104px;
  gap: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.topbar .brand .eyebrow {
  margin: 0;
  font-size: 0.62rem;
}

.topbar .brand h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.view-action-row .primary,
.view-action-row .ghost {
  flex: 1 1 auto;
}

.kontrol-hero {
  margin-bottom: 16px;
}

.view-kontrol .command-center-card {
  margin-bottom: 18px;
}

.view-kontrol .command-center-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.view-kontrol .card {
  margin-bottom: 16px;
}

/* Alt sekme cubugu */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(10, 62, 88, 0.12);
  backdrop-filter: blur(12px);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  padding: 7px 2px;
  border-radius: 14px;
  transition: color 0.15s ease, background 0.15s ease;
}

.bottom-nav-item:hover {
  background: rgba(16, 152, 173, 0.08);
}

.bottom-nav-icon {
  font-size: 21px;
  line-height: 1;
}

.bottom-nav-label {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item.active .bottom-nav-label {
  font-weight: 800;
}

@media (max-width: 760px) {
  .view-kontrol .command-center-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) {
  /* Masaustunde de sekme mantigi gecerli; iceriDe genis alan */
  .app-shell {
    padding-bottom: 104px;
  }
}

/* 5 sekme: etiketler dar ekranda tasmasin */
.bottom-nav-label {
  white-space: nowrap;
  font-size: 10.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Genel Ozet: gercek tablo === */
.ozet-search-field {
  display: block;
  margin-bottom: 12px;
}

.ozet-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  max-height: 68vh;
}

.ozet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ozet-table th,
.ozet-table td {
  padding: 11px 10px;
  vertical-align: middle;
  overflow: hidden;
}

.ozet-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ozet-table tbody tr {
  border-top: 1px solid var(--line);
}

.ozet-table tbody tr:nth-child(even) {
  background: rgba(16, 152, 173, 0.04);
}

.ozet-col-name {
  width: 38%;
}

.ozet-col-num {
  width: 21%;
}

.ozet-col-action {
  width: 20%;
}

.ozet-table .ozet-col-name {
  text-align: left;
}

.ozet-table .ozet-col-num {
  text-align: right;
}

.ozet-table .ozet-col-action {
  text-align: center;
}

.ozet-table td.ozet-col-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ozet-name-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: #c62828;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  width: 100%;
}
.ozet-name-link:hover,
.ozet-name-link:focus-visible {
  color: #9b1b1b;
  text-decoration-thickness: 2px;
}

.ozet-table td.ozet-col-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.ozet-islem-button {
  padding: 6px 6px;
  font-size: 0.78rem;
  line-height: 1.1;
  white-space: normal;
  text-align: center;
  width: 100%;
}

.ozet-empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 12px;
}

@media (max-width: 560px) {
  .ozet-table th,
  .ozet-table td {
    padding: 9px 6px;
    font-size: 0.86r