:root {
  --ink: #1B2430;
  --ink-soft: #5B6472;
  --paper: #F7F5F0;
  --paper-raised: #FFFFFF;
  --line: #DCD6C6;
  --brass: #A9803F;
  --brass-deep: #8A6A31;
  --brass-tint: #F1E7D3;
  --good: #3F6D52;
  --good-tint: #E6EEE8;
  --bad: #9A3B34;
  --bad-tint: #F5E6E4;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.logo-img {
  max-height: 50px;
  max-width: 200px;
  object-fit: contain;
}

.logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
}



.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .brand {
  padding: 0;
}

.sidebar-logo {
  display: inline-flex;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
}

.sidebar-logo img {
  max-height: 50px;
  max-width: 100px;
  object-fit: contain;
  display: block;
}


.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 600;
}

.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 8px 16px;
  border-radius: 5px;
}

.nav-cta:hover {
  background: var(--brass-deep);
  text-decoration: none;
}

.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 24px;
}

.alert {
  padding: 12px 16px;
  border-radius: 5px;
  margin-bottom: 24px;
  font-size: 14px;
}

.alert-success {
  background: var(--good-tint);
  color: var(--good);
}

.alert-error {
  background: var(--bad-tint);
  color: var(--bad);
}

.alert-info {
  background: var(--brass-tint);
  color: var(--brass-deep);
}

.narrow {
  max-width: 480px;
  margin: 0 auto;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
}

.page-sub {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 28px;
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 400;
}

.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=date],
.field input[type=tel],
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  font-family: inherit;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.product-select-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.product-select-row .field {
  flex: 1;
  margin-bottom: 0;
}

.warranty-chip {
  background: var(--brass-tint);
  color: var(--brass-deep);
  border-radius: 5px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 120px;
  text-align: center;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  background: var(--brass-deep);
  color: var(--paper);
  text-decoration: none;
}

.btn-full {
  width: 100%;
  text-align: center;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--brass);
  color: var(--brass-deep);
  background: transparent;
}

.btn-danger {
  background: var(--bad);
}

.btn-danger:hover {
  background: #7c2f29;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

.helper-links {
  text-align: center;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.dash-welcome {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}

.dash-sub {
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-size: 14.5px;
}

.warranty-list {
  display: grid;
  gap: 14px;
}

.warranty-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.warranty-card .wc-name {
  font-weight: 700;
  font-size: 15.5px;
}

.warranty-card .wc-meta {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 3px;
}

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.badge.pending {
  background: var(--brass-tint);
  color: var(--brass-deep);
}

.badge.verified {
  background: var(--good-tint);
  color: var(--good);
}

.badge.rejected {
  background: var(--bad-tint);
  color: var(--bad);
}

.badge.expired {
  background: #EEE;
  color: #888;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.empty-state h3 {
  color: var(--ink);
  font-size: 18px;
  margin: 0 0 6px;
}

/* ---- Admin panel ---- */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: var(--ink);
  color: var(--paper);
  flex-shrink: 0;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .brand {
  color: var(--paper);
  padding: 0 20px 24px;
  font-weight: 700;
  font-size: 16px;
}

.admin-sidebar nav a {
  display: block;
  color: #C9CDD6;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.admin-main {
  flex: 1;
  padding: 32px 36px 80px;
  max-width: 1200px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-topbar h1 {
  font-size: 22px;
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

@media (max-width: 800px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat .n {
  font-size: 26px;
  font-weight: 700;
}

.stat .l {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--paper-raised);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;
  font-size: 13.5px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 700;
  background: var(--paper);
}

tr:last-child td {
  border-bottom: none;
}

td .sub {
  color: var(--ink-soft);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions a,
.row-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  font-family: inherit;
}

.action-verify {
  color: var(--good);
}

.action-reject {
  color: var(--bad);
}

.action-edit {
  color: var(--brass-deep);
}

.action-delete {
  color: var(--bad);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13.5px;
  min-width: 220px;
  font-family: inherit;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Mobile responsiveness fixes ---- */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 24px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    padding: 14px 0;
  }

  .sidebar-top {
    padding: 0 16px 10px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .admin-sidebar nav {
    display: none;
    flex-direction: column;
  }

  .admin-sidebar nav.open {
    display: flex;
  }

  .admin-sidebar nav a {
    padding: 12px 20px;
  }

  .admin-main {
    padding: 20px 16px 60px;
  }
}

/* ---- Tables become stacked cards on narrow screens ---- */
@media (max-width: 700px) {
  table.responsive-table thead {
    display: none;
  }

  table.responsive-table,
  table.responsive-table tbody,
  table.responsive-table tr,
  table.responsive-table td {
    display: block;
    width: 100%;
  }

  table.responsive-table {
    min-width: 0;
  }

  table.responsive-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 10px 14px;
  }

  table.responsive-table td {
    border-bottom: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }

  table.responsive-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ink-soft);
    font-size: 11.5px;
    text-align: left;
    flex-shrink: 0;
  }

  table.responsive-table .row-actions {
    justify-content: flex-end;
  }
}

/* ---- sorting header ---- */
.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--brass-deep);
  text-decoration: none;
}


.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}

.field textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

.prose {
  max-width: 760px;
  margin: 0 auto;
}

.guidelines-body p {
  margin: 0 0 16px;
  line-height: 1.7;
  font-size: 15px;
}

.guidelines-body p:last-child {
  margin-bottom: 0;
}

/* ---- guideline-body ---- */

.guidelines-body {
  overflow-x: auto;
}

.guidelines-body h2 {
  font-size: 20px;
  margin: 24px 0 10px;
}

.guidelines-body h3 {
  font-size: 17px;
  margin: 20px 0 8px;
}

.guidelines-body ul,
.guidelines-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
  line-height: 1.7;
}

.guidelines-body li {
  margin-bottom: 4px;
}

.guidelines-body blockquote {
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 3px solid var(--line);
  color: var(--ink-soft);
}

.guidelines-body table {
  min-width: 0;
  width: 100%;
  margin: 0 0 16px;
  border: 1px solid var(--line);
}

.guidelines-body th,
.guidelines-body td {
  border: 1px solid var(--line);
}

.guidelines-body> :first-child {
  margin-top: 0;
}

/* ---- Guidelines: text alignment ---- */
.ta-left { text-align: left; }
.ta-center { text-align: center; }
.ta-right { text-align: right; }
.ta-justify { text-align: justify; }

/* ---- Guidelines: tables that scroll inside their own box (merged cells, no header row) ---- */
.guidelines-body .gl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; }
.guidelines-body .gl-scroll table { min-width: 560px; margin: 0; width: 100%; }

/* ---- Guidelines: tables with a header row become cards on phones ---- */
@media (max-width: 700px) {
  .guidelines-body table.gl-stack,
  .guidelines-body table.gl-stack thead,
  .guidelines-body table.gl-stack tbody,
  .guidelines-body table.gl-stack tfoot,
  .guidelines-body table.gl-stack tr,
  .guidelines-body table.gl-stack td,
  .guidelines-body table.gl-stack th { display: block; width: 100%; min-width: 0; }
  .guidelines-body table.gl-stack { border: none; }
  .guidelines-body table.gl-stack .gl-head { display: none; }
  .guidelines-body table.gl-stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 8px 14px; }
  .guidelines-body table.gl-stack td,
  .guidelines-body table.gl-stack th { border: none; padding: 6px 0; text-align: left; }
  .guidelines-body table.gl-stack td[data-label]::before,
  .guidelines-body table.gl-stack th[data-label]::before {
    content: attr(data-label); display: block; font-weight: 700; font-size: 12px;
    color: var(--ink-soft); margin-bottom: 2px;
  }
}

