/* ===== Design system: LGP Tracker ===== */
:root {
  /* Surfaces */
  --bg-base: #0c1222;
  --bg-elevated: #111827;
  --bg-card: #1a2332;
  --bg-input: #0f172a;
  --bg-hover: rgba(255, 255, 255, 0.04);
  /* Borders */
  --border: #2d3a4d;
  --border-focus: #14b8a6;
  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  /* Brand & semantic */
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-subtle: rgba(20, 184, 166, 0.12);
  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.12);
  --danger: #f43f5e;
  --danger-subtle: rgba(244, 63, 94, 0.12);
  --info: #0ea5e9;
  --info-subtle: rgba(14, 165, 233, 0.12);
  /* Elevation */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.header {
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
}

.header h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.tabs {
  flex-shrink: 0;
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 0.7rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 1rem;
  overflow: auto;
}

.tab-panel.hidden {
  display: none !important;
}

#tab-dashboard.tab-panel {
  overflow: hidden;
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.dashboard-section h2 {
  flex-shrink: 0;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.dashboard-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dashboard-filter-bar.dashboard-filter-bar {
  margin-bottom: 0.75rem;
}

.dashboard-cards {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dashboard-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.5rem;
  text-align: center;
  min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dashboard-card-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.dashboard-card-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-card-total .dashboard-card-value { color: var(--accent); }
.dashboard-card-overdue .dashboard-card-value { color: var(--danger); }
.dashboard-card-soon .dashboard-card-value { color: var(--warning); }
.dashboard-card-30 .dashboard-card-value { color: var(--info); }
.dashboard-card-ok .dashboard-card-value { color: var(--success); }

.dashboard-charts {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0;
}

.dashboard-chart-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.dashboard-chart-title {
  flex-shrink: 0;
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dashboard-chart-container {
  flex: 1;
  min-height: 100px;
  position: relative;
}

.dashboard-table-heading {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

#dashboard-table-wrapper {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dashboard-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
}

.dashboard-table tbody tr:hover {
  background: var(--bg-hover);
}

.dashboard-table .alert-cell {
  font-weight: 500;
}

#dashboard-empty.visible {
  display: block;
  margin-top: 1rem;
}

.form-section,
.list-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
}

.form-section h2,
.list-section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.records-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.records-toolbar h2 {
  margin: 0;
}

.records-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.records-toolbar-buttons .upload-label {
  margin: 0;
  cursor: pointer;
}

.records-filter-bar,
.dashboard-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.dashboard-filter-bar {
  margin-bottom: 1.25rem;
}

.records-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  max-width: 220px;
}

.records-filter-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.records-filter-input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.records-filter-input::placeholder {
  color: var(--text-muted);
}

.records-filter-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.records-filter-clear.hidden {
  display: none;
}

/* Form – single column, big fields */
#record-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#record-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#record-form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#record-form input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

#record-form input::placeholder {
  color: var(--text-muted);
}

#record-form input[readonly] {
  opacity: 0.9;
  cursor: default;
  background: var(--bg-elevated);
}

.field-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85em;
}

#record-form select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#record-form select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-message {
  margin: 0;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.btn {
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-save {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  margin-top: 0.25rem;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.btn-save:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
}

.btn-save:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-remove {
  background: transparent;
  color: var(--danger);
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.btn-remove:hover {
  background: var(--danger-subtle);
}

.btn-edit {
  background: transparent;
  color: var(--accent);
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.btn-edit:hover {
  background: var(--accent-subtle);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  margin-left: 0.5rem;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-export {
  background: linear-gradient(180deg, var(--success) 0%, #059669 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-export:hover {
  filter: brightness(1.08);
}

.hidden {
  display: none !important;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  margin-right: 0.25rem;
}

/* Table */
#table-wrapper {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.records-table th,
.records-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.records-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elevated);
}

.records-table tbody tr:hover {
  background: var(--bg-hover);
}

.time-ok {
  color: var(--success);
  font-weight: 500;
}

.time-soon {
  color: var(--warning);
  font-weight: 500;
}

.time-overdue {
  color: var(--danger);
  font-weight: 500;
}

.empty-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 1.75rem;
  margin: 0;
  display: none;
  font-size: 0.95rem;
}

.empty-message.visible {
  display: block;
}

.customers-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
}

.customers-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.customers-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.customer-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.customer-add-form label {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 500;
  color: #b1bac4;
}

.customer-add-form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
}

.customers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.customers-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  min-height: 2.75rem;
}

.customer-handler-span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.customer-row-label {
  display: flex;
  align-items: center;
  min-width: 0;
  grid-column: 1;
}

.customer-edit-handler {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 140px;
  grid-column: 2;
}

.customer-row-label .customer-name-span {
  min-width: 0;
  word-break: break-word;
}

.customer-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
  grid-column: 3;
  justify-self: end;
}

.customer-edit-input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 160px;
}

.customer-edit-actions {
  display: flex;
  gap: 0.35rem;
  grid-column: 3;
  justify-self: end;
  align-self: center;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.customers-list li:last-child {
  border-bottom: none;
}

.customers-list li:hover {
  background: var(--bg-hover);
}

.customers-bulk {
  margin-bottom: 1rem;
}

.customers-bulk label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 500;
  color: #b1bac4;
}

.customers-bulk textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.customers-bulk .btn {
  margin-top: 0.5rem;
}

.customers-bulk-actions {
  margin-bottom: 1rem;
}

.customers-template-upload {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.bulk-heading {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bulk-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.bulk-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.upload-label {
  margin: 0;
  cursor: pointer;
  display: inline-block;
}

#customers-empty.visible {
  display: block;
  margin-top: 1rem;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
}

.settings-section h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-block {
  margin-bottom: 1rem;
}

.settings-heading {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.settings-section label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.settings-section select {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 200px;
}

.expiry-custom-wrap {
  margin-top: 0.75rem;
}

.expiry-custom-wrap.hidden {
  display: none !important;
}

.expiry-custom-wrap input {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  max-width: 120px;
}

.settings-block .btn-save {
  margin-top: 0.75rem;
}

.settings-block.account-handlers-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.settings-pagination {
  margin: 0.75rem 0 0;
}

.settings-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.settings-per-page-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.settings-per-page-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.settings-page-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.settings-page-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.settings-page-buttons .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-pagination + ul {
  margin-top: 0.5rem;
}

.handlers-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.handlers-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.handlers-list li:last-child {
  border-bottom: none;
}

.handlers-list .btn-remove {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.handler-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.handler-row:last-child {
  border-bottom: none;
}

.handler-row:hover {
  background: var(--bg-hover);
}

.settings-block.customers-in-settings {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ===== Mobile-friendly / responsive ===== */
@media (max-width: 768px) {
  .app {
    padding: 0.75rem 1rem;
  }
  .header {
    margin-bottom: 1rem;
  }
  .header-logo {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .header h1 {
    font-size: 1.35rem;
  }
  .tabs {
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem;
  }
  .tab {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
    padding: 0.85rem 0.6rem;
    font-size: 0.85rem;
    min-height: 44px;
  }
  .tab-panel {
    margin-top: 0.75rem;
  }
  .dashboard-section,
  .form-section,
  .list-section,
  .settings-section {
    padding: 1rem 1rem;
  }
  .dashboard-section h2,
  .form-section h2,
  .list-section h2,
  .settings-section h2 {
    font-size: 1.1rem;
  }
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .dashboard-card {
    padding: 0.5rem 0.35rem;
  }
  .dashboard-card-value {
    font-size: 1.35rem;
  }
  .dashboard-card-label {
    font-size: 0.65rem;
  }
  .dashboard-charts {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .records-filter-bar,
  .dashboard-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .records-filter-group {
    max-width: none;
    min-width: 0;
  }
  .records-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .records-toolbar-buttons {
    flex-wrap: wrap;
  }
  .records-toolbar-buttons .btn,
  .records-toolbar-buttons .upload-label {
    flex: 1 1 auto;
    min-height: 44px;
  }
  .settings-pagination-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .settings-page-buttons {
    margin-left: 0;
    justify-content: flex-end;
  }
  .btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
  #record-form input,
  #record-form select {
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 0.6rem 0.75rem;
  }
  .tabs {
    flex-direction: column;
  }
  .tab {
    flex: 0 0 auto;
    width: 100%;
  }
  .records-table th:nth-child(3),
  .records-table td:nth-child(3) {
    display: none;
  }
  #table-wrapper,
  .records-table {
    font-size: 0.85rem;
  }
  .records-table th,
  .records-table td {
    padding: 0.6rem 0.5rem;
  }
  .customer-add-form {
    flex-direction: column;
  }
  .customer-add-form label {
    min-width: 0;
  }
  .customers-list li {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .customer-handler-span {
    grid-column: 1;
  }
  .customer-edit-handler {
    grid-column: 1;
  }
  .customer-row-actions {
    grid-column: 1;
    justify-self: start;
  }
  .customer-edit-actions {
    grid-column: 1;
  }
}
