@font-face {
  font-family: 'Glacial Indifference';
  src: url('fonts/GlacialIndifference-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Glacial Indifference';
  src: url('fonts/GlacialIndifference-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: 'Glacial Indifference';
  src: url('fonts/GlacialIndifference-Italic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
}

/* style.css — Div3rg3nt Homes admin panel
   Palette: #0B2530 (navy), #1A9C8C (teal), #F5F0EB (cream) */

:root {
  --navy: #080808;
  --navy-light: #0F0F0F;
  --teal: #0D6B74;
  --teal-light: #118C98;
  --cream: #F5F0EB;
  --error: #D9534F;
  --text-muted: rgba(245, 240, 235, 0.5);
  --border-divider: rgba(245, 240, 235, 0.08);
}

* {
  box-sizing: border-box;
}

html, h1, h2, h3, h4, h5, h6 {
  font-family: 'Glacial Indifference', sans-serif;
}

body {
  height: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Glacial Indifference', sans-serif;
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--cream);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

body.wide-page {
  align-items: flex-start;
  padding-top: 48px;
  padding-bottom: 48px;
}

/* ---------- Login page ---------- */

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--navy-light);
  border: 1px solid var(--border-divider);
  border-radius: 10px;
  padding: 36px 32px;
}

.login-card .logo {
  display: block;
  height: 64px;
  width: auto;
  margin: 0 auto 20px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card .subtitle {
  margin: 0 0 28px;
  color: var(--cream);
  opacity: 0.65;
  font-size: 0.85rem;
}

label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 6px;
  opacity: 0.85;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--navy);
  border: 1px solid var(--border-divider);
  border-radius: 6px;
  color: var(--cream);
  font-size: 0.95rem;
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-light) 25%, transparent);
}

.btn {
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 6px;
  background: var(--teal);
  color: var(--cream);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--teal-light);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  width: auto;
  background: transparent;
  border: 1px solid var(--border-divider);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--teal);
}

.btn-small {
  width: auto;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger {
  width: auto;
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error);
  color: var(--cream);
}

.error-box {
  background: color-mix(in srgb, var(--error) 15%, transparent);
  border: 1px solid var(--error);
  color: color-mix(in srgb, var(--error) 35%, white);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

.error-box[hidden] {
  display: none;
}

/* ---------- Loading state (shared) ---------- */

.loading-screen {
  color: var(--cream);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ---------- Dashboard page ---------- */

.dashboard-shell {
  width: 100%;
  max-width: 720px;
}

.dashboard-shell.wide {
  max-width: 980px;
}

.dashboard-shell[hidden] {
  display: none;
}

.back-link {
  display: inline-block;
  color: var(--cream);
  opacity: 0.7;
  font-size: 0.8rem;
  text-decoration: none;
  margin-bottom: 8px;
}

.back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-divider);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.dashboard-header h1 {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.dashboard-main {
  background: var(--navy-light);
  border: 1px solid var(--border-divider);
  border-radius: 10px;
  padding: 28px;
}

#welcomeMsg {
  margin: 0;
  font-size: 1rem;
}

/* ---------- Products page ---------- */

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.list-toolbar h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.85;
}

#productListStatus {
  opacity: 0.65;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.product-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-divider);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.product-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-divider);
  vertical-align: middle;
}

.product-table tbody tr:hover {
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

.table-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--navy);
  border: 1px solid var(--border-divider);
  display: block;
}

.table-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--navy);
  border: 1px dashed color-mix(in srgb, var(--teal) 60%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  opacity: 0.5;
  text-align: center;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-in-stock {
  background: color-mix(in srgb, var(--teal) 25%, transparent);
  color: var(--teal-light);
  border: 1px solid var(--border-divider);
}

.badge-out-stock {
  background: color-mix(in srgb, var(--error) 20%, transparent);
  color: var(--error);
  border: 1px solid var(--error);
}

/* ---------- Product form ---------- */

.product-form-card {
  background: var(--navy-light);
  border: 1px solid var(--border-divider);
  border-radius: 10px;
  padding: 28px;
  margin-top: 24px;
}

.product-form-card[hidden] {
  display: none;
}

.product-form-card h2 {
  margin: 0 0 20px;
  font-size: 1.05rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.field-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.field-checkbox label {
  margin: 0;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--navy);
  border: 1px solid var(--border-divider);
  border-radius: 6px;
  color: var(--cream);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

textarea:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-light) 25%, transparent);
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--navy);
  border: 1px solid var(--border-divider);
  border-radius: 6px;
  color: var(--cream);
  font-size: 0.95rem;
}

/* ---------- Image upload ---------- */

.image-upload-zone {
  border: 1px dashed var(--teal);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

.image-upload-zone input[type="file"] {
  color: var(--cream);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.upload-hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  opacity: 0.6;
}

.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.image-thumb {
  position: relative;
  width: 72px;
  height: 72px;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-divider);
  display: block;
}

.image-thumb .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--error);
  color: var(--cream);
  border: none;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-thumb .pending-badge {
  position: absolute;
  bottom: -6px;
  left: -2px;
  background: var(--teal);
  color: var(--cream);
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Specs editor ---------- */

.specs-editor {
  margin-bottom: 10px;
}

.specs-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.specs-row input {
  margin-bottom: 0;
}

.specs-remove {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--error);
  background: transparent;
  color: var(--error);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.specs-remove:hover {
  background: var(--error);
  color: var(--cream);
}

/* ---------- Form footer ---------- */

.form-error {
  background: color-mix(in srgb, var(--error) 15%, transparent);
  border: 1px solid var(--error);
  color: color-mix(in srgb, var(--error) 35%, white);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 4px 0 18px;
  font-size: 0.85rem;
}

.form-error[hidden] {
  display: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.form-actions .btn {
  width: auto;
  padding: 10px 20px;
}
/* ---------- Variant groups (variants.html) ---------- */

.variant-group-card {
  background: var(--navy-light);
  border: 1px solid var(--border-divider);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.variant-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.variant-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.variant-group-title h3 {
  margin: 0;
  font-size: 1rem;
}

.badge-color-group {
  background: color-mix(in srgb, var(--teal) 25%, transparent);
  color: var(--teal-light);
  border: 1px solid var(--border-divider);
}

.variant-group-meta {
  opacity: 0.55;
  font-size: 0.75rem;
  margin: 0 0 14px;
}

.variant-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.variant-options-list:empty::before {
  content: 'No options yet.';
  opacity: 0.5;
  font-size: 0.85rem;
}

.variant-option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--navy);
  border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
  border-radius: 8px;
}

.variant-option-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--navy-light);
  border: 1px solid var(--border-divider);
  flex-shrink: 0;
}

.variant-option-info {
  flex: 1;
  min-width: 0;
}

.variant-option-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.variant-option-price {
  font-size: 0.78rem;
  opacity: 0.65;
  margin-top: 2px;
}

.variant-group-actions,
.variant-option-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.inline-form {
  background: var(--navy);
  border: 1px dashed var(--teal);
  border-radius: 8px;
  padding: 16px;
  margin-top: 6px;
  margin-bottom: 14px;
}

.inline-form[hidden] {
  display: none;
}

.inline-form .form-grid {
  margin-bottom: 0;
}

.page-heading {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.page-subheading {
  margin: 0 0 24px;
  opacity: 0.6;
  font-size: 0.85rem;
}

.empty-groups-msg {
  opacity: 0.6;
  font-size: 0.9rem;
}

/* ---------- Quill Editor Overrides ---------- */

.ql-toolbar.ql-snow {
  background: var(--cream);
  border: 1px solid var(--border-divider) !important;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.ql-container.ql-snow {
  background: var(--cream);
  color: #000;
  border: 1px solid var(--border-divider) !important;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  border-top: none !important;
  min-height: 250px;
  font-family: inherit;
  font-size: 0.95rem;
}

.ql-editor {
  min-height: 250px;
}

/* ---------- Admin Layout & Sidebar ---------- */

.admin-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--navy-light);
  border-right: 1px solid var(--border-divider);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px;
  border-bottom: 1px solid var(--border-divider);
  text-align: center;
}

.sidebar-logo img {
  max-width: 140px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  color: var(--cream);
  background: rgba(245, 240, 235, 0.03);
}

.sidebar-link.active {
  color: var(--cream);
  background: color-mix(in srgb, var(--teal) 15%, transparent);
  border-left-color: var(--teal);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--border-divider);
}

.sidebar-footer .btn {
  width: 100%;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px 48px;
  width: calc(100% - 240px);
}


/* ---------- Mobile Responsiveness ---------- */
@media (max-width: 768px) {
  /* Let the body padding relax to save space */
  body.wide-page {
    padding: 0;
  }

  .admin-layout {
    flex-direction: column;
  }

  /* Unfix the sidebar and let it sit naturally at the top */
  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-divider);
    z-index: 10;
  }

  /* Release the left margin from the main content so it spans the full screen */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 16px;
  }

  /* Stack inputs vertically */
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Allow the table to swipe left/right */
  .dashboard-main {
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Force the table to keep its shape, triggering the scroll */
  .product-table {
    min-width: 600px;
  }

  /* Tighten paddings */
  .product-form-card {
    padding: 16px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
