:root {
  --bg: #f7f7f7;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #d8dadd;
  --soft-line: #eceef1;
  --accent: #714b67;
  --accent-dark: #5f3f58;
  --ok: #1f7a45;
  --error: #b43b2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.odoo-navbar {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  color: #fff;
  background: var(--accent);
  border-bottom: 1px solid var(--accent-dark);
}

.odoo-brand {
  margin-right: 28px;
  font-weight: 700;
}

.odoo-navbar nav {
  display: flex;
  gap: 4px;
}

.odoo-navbar a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.odoo-navbar a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 12px;
  align-items: stretch;
}

.hero__copy,
.hero__panel,
.card,
.summary-grid article {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}

.hero__copy {
  padding: 18px 20px;
}

.hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.hero__copy p,
.section-heading p,
.empty-state,
.file-state,
.check-row,
.master-upload span:last-child {
  color: var(--muted);
}

.hero__copy p,
.section-heading p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.upload-box {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 14px;
  place-content: center;
  text-align: center;
  border: 1px dashed #b9bdc3;
  border-radius: 0;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.upload-box:hover {
  border-color: var(--accent);
  background: #f3edf2;
}

.upload-box input,
.upload-inline input {
  display: none;
}

.upload-box__title {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.upload-box__hint {
  color: var(--muted);
  font-size: 12px;
}

.file-state {
  margin-top: 8px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0 12px;
  font-size: 13px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 0;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  transition: opacity 120ms ease, background 120ms ease;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

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

button.secondary {
  min-height: 32px;
  color: var(--ink);
  background: #fff;
  border-color: #c8ccd2;
}

button.secondary:hover:not(:disabled) {
  background: #f1f2f4;
}

button.danger {
  min-height: 32px;
  color: #fff;
  background: var(--error);
}

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

.summary-grid article {
  padding: 12px 14px;
}

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

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.card {
  overflow: hidden;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.section-heading--split {
  align-items: center;
}

.master-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.upload-inline {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c8ccd2;
  border-radius: 0;
  color: var(--accent);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.master-upload span:last-child {
  font-size: 13px;
}

.master-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(260px, 1.4fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.master-form label,
.search-field,
.page-size-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.master-form input[type="text"],
.list-toolbar input,
.list-toolbar select {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
}

.check-row--compact {
  margin: 0;
  min-height: 32px;
  align-content: center;
}

.form-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}

.form-actions button {
  width: fit-content;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pager span {
  min-width: 96px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

#master-data .table-wrap {
  max-height: 520px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 8px 10px;
  text-align: left;
  border-top: 1px solid var(--soft-line);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #4b5563;
  background: #f1f2f4;
  font-size: 12px;
  font-weight: 600;
}

td {
  background: #fff;
  font-size: 13px;
}

tbody tr:hover td {
  background: #f9fafb;
}

.status {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
}

.status--valid {
  color: var(--ok);
  background: rgba(31, 122, 69, 0.12);
}

.status--error {
  color: var(--error);
  background: rgba(180, 59, 46, 0.12);
}

.row-actions {
  display: flex;
  gap: 6px;
  min-width: 132px;
}

.row-actions button {
  min-height: 28px;
  padding: 0 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid #111827;
  border-radius: 0;
  color: #fff;
  background: var(--ink);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 640px);
    padding: 12px 0 24px;
  }

  .odoo-navbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 8px 12px;
  }

  .odoo-navbar nav {
    width: 100%;
  }

  .odoo-navbar a {
    min-height: 34px;
    padding: 0 10px;
  }

  .hero,
  .summary-grid,
  .list-toolbar,
  .master-form {
    grid-template-columns: 1fr;
  }

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

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .master-upload {
    align-items: stretch;
    flex-direction: column;
  }

  .master-upload button,
  .upload-inline,
  .form-actions button {
    justify-content: center;
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .pager {
    justify-content: space-between;
  }
}
