* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --tc-text: #0f172a;
  --tc-heading: #020617;
  --tc-muted: #475569;
  --tc-accent: #0d9488;
  --tc-accent-dark: #0f766e;
  --tc-banner-from: #134e4a;
  --tc-banner-to: #14b8a6;
  --tc-surface: #ffffff;
  --tc-surface-muted: #f8fafc;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: #f0fdfa;
  color: var(--tc-text);
}

h1,
h2,
h3,
strong {
  color: var(--tc-heading);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  background: var(--tc-surface);
  color: var(--tc-text);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.login-card {
  width: min(480px, 100%);
}

.subtitle {
  color: var(--tc-muted);
  line-height: 1.5;
}

button:not(.tc-good-card) {
  background: var(--tc-accent);
  color: #fff;
  border: 1px solid var(--tc-accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

button:not(.tc-good-card):hover {
  background: var(--tc-accent-dark);
}

button.secondary {
  background: #fff;
  color: var(--tc-accent-dark);
  border-color: #99f6e4;
}

button.secondary:hover {
  background: #f0fdfa;
}

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

input,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

.tc-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.tc-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--tc-banner-from), var(--tc-banner-to));
  color: #fff;
  margin-bottom: 16px;
}

.tc-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.tc-tagline {
  margin: 4px 0 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.tc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tc-prefs-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ecfdf5;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.tc-prefs-shortcut:hover {
  background: rgba(255, 255, 255, 0.22);
}

.tc-prefs-main {
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.tc-prefs-grid {
  display: grid;
  gap: 14px;
}

.tc-pref-field {
  display: grid;
  gap: 6px;
}

.tc-pref-field span {
  font-weight: 600;
  font-size: 0.9rem;
}

.tc-prefs-actions {
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

.tc-session-meta {
  font-size: 0.8rem;
  opacity: 0.95;
}

.tc-link-finance {
  color: #ccfbf1;
  font-size: 0.85rem;
}

.tc-main {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 16px;
}

@media (max-width: 900px) {
  .tc-main {
    grid-template-columns: 1fr;
  }
}

.tc-panel {
  background: var(--tc-surface);
  color: var(--tc-text);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.tc-panel label {
  color: var(--tc-text);
}

.tc-panel input,
.tc-panel select {
  color: var(--tc-text);
  background: #fff;
}

.tc-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tc-toolbar input {
  flex: 1;
}

.tc-muted {
  color: var(--tc-muted);
  font-size: 0.9rem;
}

.tc-goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
}

.tc-good-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  background: var(--tc-surface-muted);
  color: var(--tc-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: inherit;
  line-height: 1.35;
}

.tc-good-card strong {
  color: var(--tc-heading);
  font-weight: 600;
}

.tc-good-media {
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #ecfdf5;
  overflow: hidden;
}

.tc-good-img {
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.tc-good-img-placeholder {
  font-size: 1.5rem;
  color: #94a3b8;
  line-height: 1;
}

.tc-good-card:hover {
  border-color: var(--tc-accent);
  background: #ecfdf5;
  color: var(--tc-text);
}

.tc-good-code {
  font-size: 0.75rem;
  color: var(--tc-muted);
}

.tc-good-price {
  font-weight: 700;
  margin-top: 6px;
}

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

.tc-cart-table th,
.tc-cart-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  color: var(--tc-text);
}

.tc-cart-table th {
  color: var(--tc-heading);
}

.tc-cart-table input[type="number"] {
  width: 4rem;
}

.tc-checkout {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.tc-total-breakdown {
  display: grid;
  gap: 4px;
}

.tc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.1rem;
}

.tc-total-row.tc-total-sub {
  font-size: 0.95rem;
  color: var(--tc-muted);
}

.tc-pref-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
}

.tc-pref-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.tc-recent {
  margin-top: 16px;
}

.tc-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tc-recent-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: var(--tc-text);
}

.tc-recent-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tc-recent-item-body {
  flex: 1;
  min-width: 0;
}

.tc-btn-print-receipt {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.tc-total-row strong {
  color: var(--tc-heading);
}
