/* ACO Poland Stock — shared styles */

:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-alt: #f6f7f9;
  --border: #e2e5ea;
  --text: #1a1d21;
  --text-muted: #5b6270;
  --accent: #cb061d;
  --accent-contrast: #ffffff;
  --link: #b30518;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --radius: 12px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1c1f25;
  --surface-alt: #23262d;
  --border: #2e323a;
  --text: #e7e9ec;
  --text-muted: #9aa1ad;
  --accent: #ff4d5e;
  --accent-contrast: #14161a;
  --link: #ff8a94;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: var(--surface);
  flex-wrap: wrap;
}

.logo-badge {
  background: #ffffff;
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.logo-badge img {
  display: block;
  height: 32px;
  width: auto;
}

.title-block h1 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
}

.title-block p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Search form */
.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search-form label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-form select,
.search-form input[type="text"] {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  min-width: 220px;
}

.search-form select:focus,
.search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

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

/* Info section */
.info {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 13.5px;
  color: var(--text-muted);
}

.info h4 {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

.info p {
  margin: 0;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
}

.footer-note a {
  color: var(--text-muted);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Status bar (last update) */
.status-bar {
  padding: 12px 24px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 13px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.status-bar code {
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* Results */
.results-wrap {
  border-top: 1px solid var(--border);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.results-table th,
.results-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.results-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.results-table tbody tr:nth-child(even) {
  background: var(--surface-alt);
}

.results-table td.col-desc {
  white-space: normal;
}

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

.results-table col.col-item   { width: 14%; }
.results-table col.col-desc   { width: 46%; }
.results-table col.col-cat    { width: 14%; }
.results-table col.col-stock  { width: 12%; }
.results-table col.col-price  { width: 14%; }

.no-results {
  padding: 22px 24px;
  color: var(--text-muted);
  font-size: 13.5px;
}

@media (max-width: 640px) {
  .results-table thead {
    display: none;
  }
  .results-table, .results-table tbody, .results-table tr, .results-table td {
    display: block;
    width: 100%;
  }
  .results-table tr {
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
  }
  .results-table td {
    border-bottom: none;
    padding: 3px 0;
    white-space: normal;
  }
  .results-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 1px;
  }
}

.meta-bar {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.meta-bar code {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

@media (max-width: 560px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-form {
    width: 100%;
  }
  .search-form select,
  .search-form input[type="text"] {
    flex: 1;
    min-width: 0;
  }
}
