:root {
  --ink: #17211f;
  --muted: #68736f;
  --surface: #ffffff;
  --soft: #f4f6f3;
  --line: #dce3de;
  --forest: #163f36;
  --coral: #d96f4f;
  --blue: #315f7d;
  --danger: #b73e35;
  --shadow: 0 16px 40px rgba(23, 33, 31, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--blue);
  font-weight: 800;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--forest);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-button {
  color: var(--danger);
}

button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

/* Hilda Veyra LLC admin theme */
:root {
  --ink: #172033;
  --muted: #627084;
  --surface: #ffffff;
  --soft: #f3f8fd;
  --line: #d8e2ec;
  --forest: #102542;
  --coral: #f25c54;
  --blue: #1769aa;
  --danger: #b73e35;
  --shadow: 0 20px 50px rgba(16, 37, 66, 0.14);
}

body {
  background:
    linear-gradient(90deg, rgba(23, 105, 170, 0.08) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(#f9fbff, #f3f8fd 48%, #fffaf0);
}

button {
  background: var(--forest);
}

.login-card,
.panel,
.metric-grid div,
.admin-topbar {
  border-radius: 4px;
}

.login-card {
  border-top: 6px solid var(--coral);
  box-shadow: 12px 12px 0 rgba(242, 92, 84, 0.12), var(--shadow);
}

.login-card h1,
.admin-topbar h1,
.panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--forest);
}

.eyebrow {
  color: var(--coral);
}

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

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1,
.admin-topbar h1,
.panel h2 {
  margin: 0;
}

.muted,
.hint,
.status {
  margin: 0;
  color: var(--muted);
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.success {
  color: var(--forest);
  font-weight: 800;
}

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

.quick-login-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--blue);
  text-align: center;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  outline: 0;
}

textarea {
  resize: vertical;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dashboard-view {
  padding: 28px 0 44px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding-bottom: 22px;
}

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

.secondary-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metric-grid div,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-grid div {
  padding: 18px;
}

.metric-grid span,
.metric-grid strong {
  display: block;
}

.metric-grid span {
  color: var(--muted);
}

.metric-grid strong {
  margin-top: 6px;
  color: var(--forest);
  font-size: 28px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.orders-panel {
  margin-top: 18px;
}

.payment-panel {
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-head span {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.badge.inactive {
  color: var(--danger);
}

.product-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payment-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
}

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

.wide,
.product-form button,
.status {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-row input {
  width: auto;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cover-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.cover-preview img {
  width: 58px;
  height: 76px;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.cover-preview span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .admin-topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .admin-grid,
  .product-form,
  .payment-form,
  .login-actions {
    grid-template-columns: 1fr;
  }
}
