:root {
  --blue-950: #071f4f;
  --blue-900: #0b2f73;
  --blue-700: #2563eb;
  --blue-600: #2f6df6;
  --blue-100: #eaf1ff;
  --blue-50: #f5f8ff;
  --cyan: #10b7d7;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --ink: #152033;
  --muted: #64748b;
  --line: #dbe5f4;
  --surface: #ffffff;
  --bg: #f6f9fd;
  --shadow: 0 18px 45px rgba(11, 47, 115, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --ink: #e6eefc;
  --muted: #9db0cf;
  --line: #233452;
  --surface: #0b1628;
  --bg: #020713;
  --blue-50: #0d1b31;
  --blue-100: #13284a;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
}

html[data-theme="dark"] body {
  background: #020713;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar-brand,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .config-card,
html[data-theme="dark"] .operator-card,
html[data-theme="dark"] .fruit-card,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .filters,
html[data-theme="dark"] .credential-card,
html[data-theme="dark"] .day-modal {
  background: var(--surface);
  color: var(--ink);
}

html[data-theme="dark"] .sidebar-brand {
  border-color: var(--line);
}

html[data-theme="dark"] .topbar-title strong,
html[data-theme="dark"] .section-head h1,
html[data-theme="dark"] .config-card h2,
html[data-theme="dark"] .operator-title strong,
html[data-theme="dark"] .operator-title span,
html[data-theme="dark"] .stat strong,
html[data-theme="dark"] .summary-card strong,
html[data-theme="dark"] .fruit-main strong,
html[data-theme="dark"] .day-modal-head h2,
html[data-theme="dark"] .day-modal-summary strong,
html[data-theme="dark"] .credential-card strong,
html[data-theme="dark"] .credential-code {
  color: var(--ink);
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .data-table input,
html[data-theme="dark"] .data-table select,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .company-switch,
html[data-theme="dark"] .operator-main,
html[data-theme="dark"] .fruit-main,
html[data-theme="dark"] .calendar-day {
  color: var(--ink);
  background: #0f2039;
  border-color: var(--line);
}

html[data-theme="dark"] .nav-link {
  color: #cbd8ef;
}

html[data-theme="dark"] .nav-link.active,
html[data-theme="dark"] .profile-qr-item,
html[data-theme="dark"] .day-modal-summary div,
html[data-theme="dark"] .mini-table th,
html[data-theme="dark"] .data-table th {
  background: #13284a;
}

html[data-theme="dark"] .app-footer {
  background: #0b1628;
}

html[data-theme="dark"] .login-body {
  background: #020713;
}

html[data-theme="dark"] .login-shell,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .login-aside {
  background: #0b1628;
  color: var(--ink);
}

html[data-theme="dark"] .login-panel h1,
html[data-theme="dark"] .login-brand {
  color: var(--ink);
}

html[data-theme="dark"] .login-panel p {
  color: var(--muted);
}

button,
input,
select {
  font: inherit;
}

.login-body {
  display: block;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(16, 183, 215, 0.18), transparent 28%),
    linear-gradient(135deg, #eef6ff 0%, #f9fbff 45%, #e8f1ff 100%);
}

.login-page-shell {
  width: min(1000px, 100%);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.login-page-shell .topbar {
  position: static;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.login-page-shell .sidebar-toggle,
.login-page-shell .avatar-button,
.login-page-shell [data-sync-state],
.login-page-shell .topbar-actions > .icon-button:first-of-type {
  display: none;
}

.login-page-shell .topbar-actions {
  display: flex;
}

.login-page-shell .app-footer {
  margin: 0;
  border-radius: 14px;
}

.login-shell {
  width: min(960px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 34px;
  color: var(--blue-950);
  font-size: 29px;
  font-weight: 800;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, var(--blue-700), var(--cyan));
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.login-panel h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.04;
  color: var(--blue-950);
  letter-spacing: 0;
}

.login-panel p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: white;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.14);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--blue-700);
}

.secondary-button {
  color: var(--blue-900);
  background: var(--blue-100);
  border-color: #b9ccff;
}

.ghost-button {
  color: var(--blue-700);
  background: transparent;
  border-color: var(--line);
}

.error-message {
  min-height: 20px;
  margin: 0;
  color: #b91c1c;
  font-weight: 700;
  font-size: 13px;
}

.login-aside {
  padding: 38px;
  color: white;
  background:
    linear-gradient(155deg, rgba(7, 31, 79, 0.95), rgba(37, 99, 235, 0.88)),
    url("data:image/svg+xml,%3Csvg width='420' height='420' viewBox='0 0 420 420' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.15'%3E%3Cpath d='M0 70h420M0 140h420M0 210h420M0 280h420M0 350h420M70 0v420M140 0v420M210 0v420M280 0v420M350 0v420'/%3E%3C/g%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
}

.metric-card span {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: white;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  color: var(--ink);
  background: #fbfdff;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
}

.sidebar-brand > span:last-child {
  flex: 1;
  text-align: center;
}

.sidebar-brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.company-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fbfdff;
}

.company-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: white;
  background: #3657d6;
  font-weight: 800;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: #0f172a;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-link.active {
  color: var(--blue-700);
  background: var(--blue-100);
  box-shadow: inset 3px 0 0 var(--blue-600);
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-weight: 900;
}

.main-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 57px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.page-kicker {
  color: var(--muted);
  font-size: 12px;
}

.topbar-title strong {
  color: var(--blue-950);
  font-size: 18px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-pill {
  padding: 5px 10px;
  border-radius: 999px;
  color: #047857;
  background: #dff8eb;
  font-size: 12px;
  font-weight: 800;
}

.icon-button,
.avatar-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--blue-900);
  cursor: pointer;
  font-weight: 900;
}

.avatar-button {
  border-radius: 50%;
  color: white;
  background: #405a91;
}

.sidebar-toggle {
  display: none;
  place-items: center;
  gap: 3px;
}

.sidebar-toggle span {
  width: 16px;
  height: 2px;
  background: currentColor;
}

.content {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 28px 24px 38px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h1 {
  margin: 0;
  color: var(--blue-950);
  font-size: 29px;
  letter-spacing: 0;
}

.section-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
}

.operator-list,
.fruit-list,
.export-panel {
  display: grid;
  gap: 14px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.profile-qr-card {
  grid-column: 1 / -1;
}

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

.profile-qr-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: #f8fbff;
}

.profile-qr-item h3 {
  margin: 0 0 12px;
  color: var(--blue-950);
}

.profile-qr-item > div {
  display: flex;
  justify-content: center;
  min-height: 220px;
}

.profile-qr-item code {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.credentials-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.credential-filters {
  margin-bottom: 18px;
}

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

.credential-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 24px rgba(11, 47, 115, 0.05);
}

.credential-card.is-assigned {
  border-top: 3px solid var(--green);
}

.credential-card.is-available {
  border-top: 3px solid #64748b;
}

.credential-card-head,
.credential-foot,
.credential-owner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.credential-label,
.credential-owner span,
.credential-foot,
.credential-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.credential-code {
  display: block;
  margin-top: 3px;
  color: var(--blue-950);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.credential-owner {
  justify-content: flex-start;
}

.credential-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: white !important;
  background: linear-gradient(135deg, var(--blue-700), var(--cyan));
  font-size: 18px !important;
  font-weight: 900;
}

.credential-owner strong,
.credential-owner span {
  display: block;
}

.credential-owner strong {
  color: var(--blue-950);
}

.credential-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.credential-metrics div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-50);
}

.credential-metrics strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-950);
  font-size: 17px;
}

.credential-foot {
  align-items: flex-start;
  min-height: 28px;
  font-size: 11px;
}

.credential-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
}

.config-card {
  display: grid;
  gap: 13px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 24px rgba(11, 47, 115, 0.05);
}

.config-card h2 {
  margin: 0 0 4px;
  color: var(--blue-950);
  font-size: 17px;
  letter-spacing: 0;
}

.config-section {
  margin-top: 22px;
}

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

.section-head.compact h1 {
  font-size: 21px;
}

.operator-card,
.fruit-card,
.summary-card,
.table-card,
.filters,
.export-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 24px rgba(11, 47, 115, 0.05);
}

.operator-card {
  overflow: hidden;
}

.operator-main {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 0;
  padding: 16px;
  background: white;
  cursor: pointer;
  text-align: left;
}

.operator-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.operator-initial {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--blue-700), var(--cyan));
  font-weight: 900;
}

.operator-title strong {
  display: block;
  color: var(--blue-950);
  font-size: 17px;
}

.operator-title span {
  color: var(--muted);
  font-size: 13px;
}

.operator-stats {
  display: grid;
  grid-template-columns: repeat(5, 92px) 28px;
  gap: 10px;
  align-items: center;
}

.stat {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  color: var(--blue-950);
  font-size: 18px;
}

.chevron {
  color: var(--blue-700);
  font-size: 18px;
  text-align: center;
}

.operator-detail {
  display: none;
  padding: 0 16px 16px 70px;
}

.operator-card.open .operator-detail {
  display: block;
}

.mini-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.mini-table th,
.mini-table td,
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
}

.mini-table th,
.data-table th {
  color: var(--blue-900);
  background: #f8fbff;
  font-size: 12px;
}

.summary-stack {
  display: grid;
  gap: 14px;
}

.export-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.summary-card {
  padding: 16px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-950);
  font-size: 24px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
}

.filters .field {
  min-width: 210px;
}

.payment-category-panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 24px rgba(11, 47, 115, 0.05);
}

.payment-category-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.payment-category-heading h2 {
  margin: 4px 0;
  color: var(--blue-950);
  font-size: 20px;
}

.payment-category-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.payment-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.payment-category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--blue-950);
  cursor: pointer;
  text-align: left;
}

.payment-category-card:hover,
.payment-category-card.selected {
  border-color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.payment-category-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #dbeafe;
  font-size: 20px;
}

.payment-category-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
  flex: 1;
}

.payment-category-copy strong {
  font-size: 14px;
}

.payment-category-copy small {
  color: var(--muted);
  font-size: 11px;
}

.payment-category-total {
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.category-back-button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--blue-700);
  cursor: pointer;
  font-weight: 800;
}

.payment-category-empty {
  display: grid;
  gap: 5px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.payment-category-empty strong {
  color: var(--blue-950);
}

.fruit-card {
  overflow: hidden;
}

.fruit-main {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 120px 120px 28px;
  gap: 14px;
  align-items: center;
  border: 0;
  padding: 16px;
  background: white;
  cursor: pointer;
  text-align: left;
}

.fruit-main strong {
  color: var(--blue-950);
  font-size: 17px;
}

.fruit-main span {
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  width: fit-content;
  border-radius: 999px;
  padding: 0 9px;
  color: white;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.tag.blue {
  background: #405a91;
}

.tag.orange {
  background: var(--orange);
}

.fruit-detail {
  display: none;
  padding: 0 16px 16px;
}

.fruit-card.open .fruit-detail {
  display: block;
}

.table-card {
  overflow: auto;
}

.table-card .data-table {
  min-width: 900px;
}

.data-table input,
.data-table select {
  width: 100%;
  min-width: 120px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}

.data-table input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--blue-700);
}

.money,
.number {
  font-variant-numeric: tabular-nums;
}

.salary-button {
  border: 0;
  padding: 0;
  color: var(--blue-900);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.28);
  text-underline-offset: 4px;
}

.export-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 31, 79, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.day-modal {
  width: min(760px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow);
}

.day-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.day-modal-head span,
.day-modal-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.day-modal-head h2 {
  margin: 4px 0 0;
  color: var(--blue-950);
  font-size: 20px;
  letter-spacing: 0;
}

.day-modal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
}

.day-modal-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-50);
}

.day-modal-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-950);
  font-size: 22px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(78px, 1fr));
  gap: 10px;
  padding: 18px;
}

.calendar-day {
  min-height: 106px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.calendar-day.paid {
  border-color: #bbf7d0;
  background: #effdf4;
}

.calendar-day.empty {
  border-color: #f3c5c5;
  background: #fff7f7;
}

.calendar-day.placeholder {
  border-color: transparent;
  background: transparent;
}

.calendar-day.paid.empty {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #effdf4 0%, #fff7f7 100%);
}

.calendar-day span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.calendar-day strong {
  color: var(--blue-950);
  font-size: 24px;
}

.calendar-day small {
  color: var(--blue-900);
  font-weight: 800;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-aside {
    min-height: 260px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    width: 250px;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: grid;
  }

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

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

  .credentials-grid,
  .credentials-summary {
    grid-template-columns: 1fr;
  }

  .operator-main,
  .fruit-main {
    grid-template-columns: 1fr;
  }

  .operator-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operator-detail {
    padding-left: 16px;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 22px 14px 32px;
  }

  .login-panel,
  .login-aside {
    padding: 28px;
  }

  .topbar {
    padding: 0 12px;
  }

  .sync-pill,
  .page-kicker {
    display: none;
  }

  .section-head {
    display: grid;
    align-items: start;
  }

  .operator-stats {
    grid-template-columns: 1fr;
  }

  .export-summary {
    grid-template-columns: 1fr;
  }

  .credential-metrics {
    grid-template-columns: 1fr;
  }

  .app-footer {
    display: grid;
  }

  .day-modal-summary,
  .calendar-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 921px) {
  .app-shell {
    gap: 16px;
    padding: 16px;
    background: radial-gradient(circle at 78% 0%, rgba(47, 109, 246, 0.10), transparent 30%);
  }

  .sidebar {
    top: 16px;
    height: calc(100vh - 32px);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .main-shell {
    min-height: calc(100vh - 32px);
  }

  .topbar {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(11, 47, 115, 0.05);
  }
}

/* Login inspirado en Control de Nuez, adaptado a la identidad azul de LJR. */
.login-body {
  padding: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 109, 246, 0.15), transparent 24%),
    linear-gradient(155deg, #eef4ff 0%, #f8fbff 52%, #e6efff 100%);
}

.login-page-shell {
  width: min(1240px, 100%);
  min-height: 100vh;
  padding: 20px 16px 16px;
  gap: 28px;
}

.login-page-shell .topbar {
  position: static;
  min-height: 80px;
  padding: 16px 28px;
  border: 1px solid rgba(47, 109, 246, 0.12);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 25px rgba(31, 63, 117, 0.08);
}

.dashboard-topbar-content {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-page-shell .dashboard-topbar-content {
  display: none;
}

.login-topbar-content {
  width: 100%;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.login-body .login-topbar-content {
  display: flex;
}

.login-header-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-header-brand .brand-logo-img {
  width: 48px;
  height: 48px;
}

.login-header-brand .page-kicker {
  display: block;
  color: #496080;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.login-header-brand strong {
  display: block;
  margin-top: 3px;
  color: #10264d;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.login-header-copy {
  margin-left: auto;
  color: #496080;
  font-size: 13px;
  text-align: right;
}

.login-shell {
  width: min(1050px, 100%);
  min-height: 560px;
  margin: 0 auto;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 20px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-panel,
.login-aside {
  min-height: 0;
  border: 1px solid rgba(47, 109, 246, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(31, 63, 117, 0.10);
}

.login-panel {
  padding: 42px;
  justify-content: center;
}

.login-panel-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #e7efff;
  font-size: 12px;
  font-weight: 800;
}

.login-panel h1 {
  margin-top: 18px;
  color: #10264d;
  font-size: 34px;
}

.login-panel p {
  max-width: 520px;
  color: #64748b;
}

.login-panel .legal-notice {
  border-color: #dce7f7;
  background: #f8fbff;
}

.login-aside.login-recovery {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  color: #172033;
  background: rgba(255, 255, 255, 0.92);
}

.login-recovery h2 {
  margin: 0;
  color: #10264d;
  font-size: 22px;
}

.login-recovery > p {
  margin: 12px 0 24px;
  color: #64748b;
  line-height: 1.55;
}

.login-recovery-form {
  display: grid;
  gap: 16px;
}

.login-recovery-form .secondary-button {
  justify-self: start;
  color: #1d4ed8;
  background: #e7efff;
  border-color: #c9d9ff;
}

.login-page-shell .app-footer {
  width: 100%;
  margin: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .login-body {
  background: #030916;
}

html[data-theme="dark"] .login-page-shell .topbar,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .login-aside.login-recovery,
html[data-theme="dark"] .login-page-shell .app-footer {
  border-color: #263a5b;
  background: #0b172b;
  color: #e7eefb;
}

html[data-theme="dark"] .login-header-brand strong,
html[data-theme="dark"] .login-panel h1,
html[data-theme="dark"] .login-recovery h2 {
  color: #e7eefb;
}

html[data-theme="dark"] .login-header-copy,
html[data-theme="dark"] .login-panel p,
html[data-theme="dark"] .login-recovery > p {
  color: #9badca;
}

html[data-theme="dark"] .login-panel-badge,
html[data-theme="dark"] .login-recovery-form .secondary-button {
  color: #b9d0ff;
  background: #14294c;
  border-color: #34558b;
}

@media (max-width: 720px) {
  .login-page-shell {
    padding: 12px;
    gap: 16px;
  }

  .login-page-shell .topbar {
    padding: 14px 16px;
  }

  .login-header-copy {
    display: none;
  }

  .login-shell {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-panel,
  .login-aside.login-recovery {
    padding: 28px 22px;
  }
}

/* Pagos utiliza todo el espacio disponible para facilitar la lectura de la planilla. */
.content {
  width: 100%;
  max-width: none;
}

.payment-table {
  width: 100%;
  min-width: 1600px;
}

.payment-table th,
.payment-table td {
  padding: 11px 10px;
}

.payment-table th {
  vertical-align: bottom;
}

.payment-day-header {
  min-width: 92px;
  text-align: center !important;
}

.payment-day-header span,
.payment-day-header small {
  display: block;
}

.payment-day-header span {
  color: var(--blue-950);
  font-size: 11px;
  font-weight: 900;
  text-transform: capitalize;
}

.payment-day-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

html[data-theme="dark"] .payment-day-header span {
  color: var(--ink);
}

/* Ajuste visual principal: panel compacto, claro y orientado a datos. */
:root {
  --ink: #172033;
  --muted: #718096;
  --line: #dde4ee;
  --surface: #ffffff;
  --bg: #f4f6f9;
  --blue-950: #10264d;
  --blue-900: #294b83;
  --blue-100: #edf3ff;
  --blue-700: #315bd6;
  --blue-600: #416df0;
  --shadow: 0 2px 10px rgba(20, 38, 70, 0.06);
}

body {
  background: var(--bg);
}

.sidebar {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

.sidebar-brand {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 13px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.company-switch {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.nav-list {
  gap: 4px;
}

.nav-link {
  min-height: 44px;
  border-left: 3px solid transparent;
  border-radius: 8px;
  color: var(--ink);
}

.nav-link:hover {
  background: #f5f7fb;
}

.nav-link.active {
  border-left-color: var(--blue-600);
  color: var(--blue-700);
  background: var(--blue-100);
  box-shadow: none;
}

.nav-icon {
  width: 22px;
  color: var(--blue-700);
  font-size: 17px;
  line-height: 1;
}

svg.nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: block;
  font-size: initial;
}

.main-shell {
  background: var(--bg);
}

.topbar {
  min-height: 66px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(20, 38, 70, 0.03);
}

.topbar-title strong,
.section-head h1,
.config-card h2,
.operator-title strong,
.stat strong,
.summary-card strong,
.fruit-main strong,
.day-modal-head h2,
.day-modal-summary strong,
.credential-owner strong,
.credential-code {
  color: var(--blue-950);
}

.content {
  width: 100%;
  max-width: none;
  padding: 32px 28px 42px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 6px;
}

.period-switcher {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 360px;
}

.period-switcher-label {
  display: grid;
  gap: 2px;
  min-width: 190px;
  text-align: center;
}

.period-switcher-label span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.period-switcher-label strong {
  color: var(--blue-950);
  font-size: 13px;
  white-space: nowrap;
}

.period-arrow {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--blue-700);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.period-arrow:hover {
  border-color: var(--blue-600);
  background: var(--blue-100);
}

html[data-theme="dark"] .period-arrow,
html[data-theme="dark"] .period-switcher .secondary-button {
  background: var(--surface);
  color: var(--blue-700);
}

.dashboard-grid {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
}

.operator-list,
.fruit-list {
  gap: 12px;
}

.operator-card,
.fruit-card,
.summary-card,
.table-card,
.filters,
.config-card,
.credential-card {
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.operator-card {
  align-self: start;
  height: fit-content;
}

.operator-main,
.fruit-main {
  background: var(--surface);
}

.operator-main {
  padding: 15px 16px;
}

.operator-detail {
  padding: 0 16px 16px;
}

.mini-table th,
.data-table th {
  color: var(--blue-900);
  background: #f7f9fc;
}

.mini-table td,
.data-table td {
  color: var(--ink);
}

.summary-stack {
  gap: 12px;
}

.summary-card {
  padding: 15px 16px;
}

.summary-card strong {
  font-size: 22px;
}

.filters {
  background: var(--surface);
}

.config-card,
.credential-card,
.profile-qr-item {
  background: var(--surface);
}

.profile-qr-item {
  border-radius: 12px;
}

.empty-state {
  background: var(--surface);
}

html[data-theme="dark"] {
  --ink: #e7eefb;
  --muted: #9badca;
  --line: #263a5b;
  --surface: #0b172b;
  --bg: #030916;
  --blue-950: #f2f6ff;
  --blue-900: #b9c9e8;
  --blue-100: #14294c;
  --blue-700: #78a6ff;
  --blue-600: #70a1ff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .main-shell,
html[data-theme="dark"] .app-shell {
  background: var(--bg);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .operator-main,
html[data-theme="dark"] .fruit-main,
html[data-theme="dark"] .mini-table th,
html[data-theme="dark"] .data-table th {
  background: var(--surface);
}

html[data-theme="dark"] .nav-link:hover {
  background: #102342;
}

html[data-theme="dark"] .mini-table th,
html[data-theme="dark"] .data-table th {
  background: #122542;
}

html[data-theme="dark"] .mini-table td,
html[data-theme="dark"] .data-table td {
  color: var(--ink);
}

html[data-theme="dark"] .section-head h1,
html[data-theme="dark"] .config-card h2,
html[data-theme="dark"] .operator-title strong,
html[data-theme="dark"] .stat strong,
html[data-theme="dark"] .summary-card strong,
html[data-theme="dark"] .fruit-main strong,
html[data-theme="dark"] .day-modal-head h2,
html[data-theme="dark"] .day-modal-summary strong,
html[data-theme="dark"] .credential-owner strong,
html[data-theme="dark"] .credential-code {
  color: var(--ink);
}

@media (min-width: 921px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 0;
    padding: 0;
    background: var(--bg);
  }

  .sidebar {
    top: 0;
    height: 100vh;
    border-radius: 0;
    border-width: 0 1px 0 0;
  }

  .main-shell {
    min-height: 100vh;
  }

  .topbar {
    margin: 0;
    border-radius: 0;
    border-width: 0 0 1px;
  }
}

@media (max-width: 720px) {
  .period-switcher {
    justify-content: flex-start;
    min-width: 0;
    flex-wrap: wrap;
  }

  .period-switcher-label {
    min-width: 150px;
  }
}

/* Inicio: resumen agrupado por supervisor y fruta. */
.supervisor-week-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.supervisor-week-card + .supervisor-week-card {
  margin-top: 12px;
}

.supervisor-week-head {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.supervisor-week-head:hover {
  background: var(--blue-100);
}

.supervisor-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.supervisor-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-700), var(--cyan));
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.supervisor-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.supervisor-identity strong {
  display: block;
  color: var(--blue-950);
  font-size: 17px;
}

.supervisor-week-summary {
  display: flex;
  align-items: center;
  gap: 22px;
}

.supervisor-week-summary > span:not(.tag):not(.chevron),
.supervisor-fruit-metrics > span {
  display: grid;
  gap: 3px;
  min-width: 72px;
}

.supervisor-week-summary small,
.supervisor-fruit-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.supervisor-week-summary strong,
.supervisor-fruit-metrics strong {
  color: var(--blue-950);
  font-size: 16px;
}

.supervisor-week-body {
  display: none;
  padding: 0 20px 20px;
}

.supervisor-week-card.open .supervisor-week-body {
  display: block;
}

.supervisor-week-card.open .supervisor-week-head {
  border-bottom: 1px solid var(--line);
}

.supervisor-week-card.open .chevron {
  transform: rotate(180deg);
}

.supervisor-fruit-block {
  padding: 18px 0 0;
}

.supervisor-fruit-block + .supervisor-fruit-block {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.supervisor-fruit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 8px 14px;
}

.supervisor-fruit-head > div:first-child {
  min-width: 160px;
}

.supervisor-fruit-head strong,
.supervisor-fruit-head > div:first-child > span:last-child {
  display: block;
}

.supervisor-fruit-head strong {
  color: var(--blue-950);
  font-size: 16px;
}

.supervisor-fruit-head > div:first-child > span:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.supervisor-fruit-metrics {
  display: flex;
  gap: 24px;
}

.supervisor-worker-table {
  width: 100%;
}

.supervisor-empty-state,
.dashboard-empty-state {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px dashed #b9c9e3;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-100), var(--surface));
}

.supervisor-empty-icon,
.dashboard-empty-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #dce8ff;
  color: var(--blue-700);
  font-size: 20px;
  font-weight: 900;
}

.supervisor-empty-state strong,
.dashboard-empty-state strong {
  color: var(--blue-950);
  font-size: 14px;
}

.supervisor-empty-state p,
.dashboard-empty-state p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-empty-state {
  min-height: 150px;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

html[data-theme="dark"] .supervisor-week-head:hover {
  background: #102342;
}

html[data-theme="dark"] .supervisor-empty-state,
html[data-theme="dark"] .dashboard-empty-state {
  border-color: #34558b;
  background: linear-gradient(135deg, #102342, var(--surface));
}

html[data-theme="dark"] .supervisor-empty-icon,
html[data-theme="dark"] .dashboard-empty-icon {
  background: #173663;
  color: #9ec1ff;
}

@media (max-width: 920px) {
  .supervisor-week-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .supervisor-week-summary {
    justify-content: space-between;
    gap: 10px;
  }

  .supervisor-fruit-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .supervisor-fruit-metrics {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
}

@media (max-width: 620px) {
  .supervisor-week-head,
  .supervisor-week-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .supervisor-week-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .supervisor-fruit-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .supervisor-worker-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .supervisor-empty-state {
    align-items: flex-start;
  }
}

/* Configuración visible del catálogo de frutas. */
.fruit-config-panel {
  margin: 16px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.fruit-config-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fruit-config-heading h2 {
  margin: 0;
  color: var(--blue-950);
  font-size: 19px;
}

.fruit-config-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.fruit-config-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 10px;
}

.fruit-config-option {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.fruit-config-option:hover {
  border-color: var(--blue-600);
  background: var(--blue-100);
  transform: translateY(-1px);
}

.fruit-config-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.fruit-config-option.inactive {
  opacity: 0.72;
}

.fruit-config-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 184, 132, 0.12);
}

.fruit-config-option.inactive .fruit-config-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.fruit-config-copy {
  display: grid;
  gap: 3px;
}

.fruit-config-copy strong {
  color: var(--blue-950);
  font-size: 13px;
}

.fruit-config-copy small,
.fruit-config-state {
  color: var(--muted);
  font-size: 11px;
}

.fruit-config-state {
  color: var(--blue-700);
  font-weight: 800;
}

.fruit-config-option.inactive .fruit-config-state {
  color: var(--muted);
}

.fruit-price-editor {
  display: grid;
  grid-template-columns: 44px minmax(68px, 1fr) 58px;
  align-items: center;
  gap: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.fruit-price-editor label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.fruit-price-editor input {
  width: 100%;
  min-width: 0;
  height: 27px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.fruit-price-save {
  min-height: 27px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--blue-700);
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.fruit-price-save:hover {
  background: var(--blue-600);
}

.app-toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 13px 16px;
  border: 1px solid #a7e8ce;
  border-radius: 10px;
  background: #ecfdf5;
  box-shadow: 0 12px 30px rgba(15, 86, 63, 0.18);
  color: #047857;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 13px;
}

html[data-theme="dark"] .app-toast {
  border-color: #176b53;
  background: #082f25;
  color: #a7f3d0;
}

@media (max-width: 620px) {
  .app-toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    min-width: 0;
  }
}

.credential-table-card {
  overflow-x: auto;
}

.credential-table {
  min-width: 620px;
}

.credential-name-cell {
  color: var(--blue-950);
  font-weight: 800;
}

.credential-bank-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.credential-bank-value.has-bank {
  color: #047857;
}

.credential-bank-value.no-bank {
  color: #b91c1c;
}

.credential-bank-value:hover {
  background: var(--blue-100);
}

.credential-bank-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}

.payment-bank-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.payment-bank-button.has-bank {
  border-color: #a7e5c6;
  color: #047857;
  background: #effdf5;
}

.payment-bank-button.no-bank {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff7f7;
}

.payment-bank-button:hover {
  border-color: var(--blue-600);
  background: var(--blue-100);
}

html[data-theme="dark"] .payment-bank-button.has-bank {
  border-color: #166534;
  background: #102d25;
  color: #86efac;
}

html[data-theme="dark"] .payment-bank-button.no-bank {
  border-color: #7f1d1d;
  background: #3b1111;
  color: #fecaca;
}

.credential-bank-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.credential-bank-editor input {
  width: 180px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.credential-bank-save {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: var(--blue-700);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.credential-delete-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff5f5;
  color: #b91c1c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.credential-delete-button:hover {
  border-color: #ef4444;
  background: #fee2e2;
}

.payment-table-scroll {
  overflow-x: auto;
}

.payment-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
}

.payment-table th,
.payment-table td {
  padding: 8px 5px;
  white-space: normal;
  line-height: 1.2;
}

.payment-name-cell {
  width: 14%;
  min-width: 0;
  color: var(--blue-950);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.payment-day-cell {
  width: 5.8%;
  min-width: 0;
  text-align: center !important;
  background: #fbfdff;
}

.payment-day-header {
  width: 5.8%;
  min-width: 0;
  padding-left: 3px !important;
  padding-right: 3px !important;
}

.payment-day-cell strong,
.payment-day-cell small {
  display: block;
}

.payment-day-cell strong {
  color: var(--blue-900);
  font-size: 12px;
}

.payment-day-header b {
  display: block;
  margin-bottom: 3px;
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.payment-day-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
}

.payment-day-cell.empty {
  color: #aab8cc;
  background: #f8fafc;
  font-size: 20px;
}

.payment-edit-guard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-50);
}

.guard-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-950);
  font-size: 12px;
  font-weight: 800;
}

.guard-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-700);
}

.guard-check input:disabled + span,
.guard-hint {
  color: var(--muted);
}

.guard-hint {
  font-size: 12px;
}

.bank-modal {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.bank-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.bank-modal-form .field {
  margin: 0;
}

.bank-modal-form .field:first-of-type,
.bank-modal-form .field:nth-of-type(2),
.bank-modal-form .form-status,
.bank-modal-actions {
  grid-column: 1 / -1;
}

.bank-modal-form input[readonly] {
  background: var(--blue-50);
  color: var(--muted);
}

.bank-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.form-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-status.is-success {
  color: #087443;
}

.form-status.is-error {
  color: #b42318;
}

html[data-theme="dark"] .bank-modal,
html[data-theme="dark"] .payment-day-cell {
  background: var(--surface);
}

html[data-theme="dark"] .payment-name-cell,
html[data-theme="dark"] .payment-day-cell strong,
html[data-theme="dark"] .guard-check {
  color: var(--ink);
}

html[data-theme="dark"] .payment-day-cell.empty {
  background: #0d1b31;
}

html[data-theme="dark"] .payment-edit-guard {
  background: #0d1b31;
}

html[data-theme="dark"] .credential-delete-button {
  border-color: #7f1d1d;
  background: #3b1111;
  color: #fecaca;
}

.fruit-inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(130px, 0.8fr) minmax(120px, 0.7fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.fruit-inline-form .field {
  margin: 0;
}

.fruit-inline-form .primary-button {
  min-height: 42px;
  white-space: nowrap;
}

.catalog-status-button {
  min-width: 78px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.catalog-status-button.inactive {
  background: var(--orange);
}

html[data-theme="dark"] .fruit-config-option:hover {
  background: #102342;
}

@media (max-width: 720px) {
  .fruit-config-heading {
    flex-direction: column;
  }

  .fruit-inline-form {
    grid-template-columns: 1fr 1fr;
  }

  .fruit-inline-form .field:first-child,
  .fruit-inline-form .primary-button {
    grid-column: 1 / -1;
  }

  .bank-modal-form {
    grid-template-columns: 1fr;
  }

  .bank-modal-form .field:first-of-type,
  .bank-modal-form .field:nth-of-type(2),
  .bank-modal-form .form-status,
  .bank-modal-actions {
    grid-column: auto;
  }
}
