*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark: #1a1a2e;
  --gold: #e8c96d;
  --bg: #f9f9f9;
  --white: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a2e;
  --muted: #8888aa;
  --error: #d32f2f;
  --success: #388e3c;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 44px 40px;
  width: 360px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-logo {
  text-align: center; margin-bottom: 36px;
}
.login-logo img {
  width: 100px; height: auto;
}
.login-box .btn-primary {
  background: var(--gold);
  color: var(--dark);
}
.login-box .btn-primary:hover { background: #ddb84e; }
.login-box .btn-primary:disabled { background: #f0dfa0; color: #9a8040; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 11px; font-weight: bold;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: #666; margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; color: var(--text); outline: none;
  transition: border-color 0.2s; background: var(--white);
}
.form-group input:focus,
.form-group select:focus { border-color: var(--dark); }

.btn-primary {
  width: 100%; padding: 13px;
  background: var(--dark); color: var(--white);
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: bold;
  cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: #2d2d4e; }
.btn-primary:disabled { background: #999; cursor: not-allowed; }

.error-msg {
  color: var(--error); font-size: 13px;
  margin-top: 12px; text-align: center; min-height: 20px;
}
.attempts-msg {
  font-size: 12px; text-align: center; margin-top: 6px; min-height: 18px;
  color: #888;
}
.attempts-msg.warn { color: #c17f00; font-weight: bold; }
.attempts-msg.blocked { color: var(--error); font-weight: bold; }
.field-error { color: var(--error); font-size: 11px; margin-top: 4px; display: none; }
.field-error.visible { display: block; }

/* ===== APP SHELL ===== */
.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 130px; flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e8e8e8;
  color: #444;
  display: flex; flex-direction: column;
  padding: 20px 12px; gap: 4px;
}
.sidebar .logo {
  text-align: center; margin-bottom: 20px; padding: 4px 0;
}
.sidebar .logo img {
  width: 80px; height: auto;
}
.sidebar .nav-item {
  padding: 10px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 500; text-align: center;
  cursor: pointer; color: #888;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: background 0.15s, color 0.15s;
}
.sidebar .nav-item:hover { background: #f5f5f5; color: #333; }
.sidebar .nav-item.active { background: var(--gold); color: var(--dark); font-weight: 600; }
.nav-divider { height: 1px; background: #eee; margin: 8px 4px; }
.sidebar-bottom {
  margin-top: auto; display: flex; flex-direction: column; gap: 0;
}
.sidebar .logout {
  border-top: 1px solid #eee;
  padding-top: 12px; font-size: 11px; color: #bbb;
  text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.sidebar .logout:hover { color: #666; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  background: var(--white); font-size: 15px; font-weight: bold; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle { display: flex; gap: 4px; }
.btn-view {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white); color: #bbb;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-view:hover:not(.active) { background: #f5f5f5; color: #666; }
.btn-view.active { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* ===== SECTION VISIBILITY ===== */
.section { display: none; flex: 1; overflow: hidden; }
.section.active { display: flex; flex-direction: column; }

/* ===== HOME ===== */
.home-content {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 28px; gap: 36px;
}
.home-welcome { text-align: center; }
.home-logo { width: 90px; height: auto; margin-bottom: 12px; }
.home-subtitle { color: #999; font-size: 14px; }
.home-stats {
  display: flex; gap: 20px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 28px;
  text-align: center; min-width: 100px;
}
.stat-card.published { border-color: #b7dfbb; background: #f0faf1; }
.stat-card.draft { border-color: #f0e0a0; background: #fdf9ec; }
.stat-number { font-size: 32px; font-weight: bold; color: var(--dark); line-height: 1; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #999; margin-top: 6px; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 440px; }
.home-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 28px 16px; border-radius: 12px;
  background: var(--dark); color: var(--white);
  border: none; font-size: 14px; font-weight: bold;
  cursor: pointer; transition: background 0.2s;
}
.home-btn:hover { background: #2d2d4e; }
.home-btn svg { width: 28px; height: 28px; }
.home-btn.secondary {
  background: var(--white); color: var(--dark);
  border: 1px solid var(--border);
}
.home-btn.secondary:hover { background: #f5f5f5; }

/* ===== SIZES PICKER ===== */
.sizes-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.size-chip {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--white); color: var(--dark); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.size-chip:hover { border-color: var(--gold); }
.size-chip.selected { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* ===== ADD PRODUCT FORM ===== */
.form-content {
  flex: 1; padding: 24px 28px;
  display: flex; align-items: flex-start; gap: 28px; overflow: hidden;
}
.photo-upload {
  flex-shrink: 0; width: 42%; aspect-ratio: 1/1;
  border: 2px dashed #ccc; border-radius: 10px;
  background: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.2s;
  overflow: hidden; position: relative;
}
.photo-upload:hover { border-color: var(--dark); }
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.upload-placeholder span { font-size: 40px; }
.upload-placeholder p { font-size: 13px; font-weight: bold; color: #888; }
.upload-placeholder small { font-size: 11px; color: #ccc; }
.photo-upload img {
  width: 100%; height: 100%; object-fit: contain;
  position: absolute; top: 0; left: 0;
  background: #f5f5f5;
}
#product-name { text-transform: uppercase; }
.fields {
  flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 4px;
}
.fields .form-group { margin-bottom: 0; }
.fields .row { display: flex; gap: 14px; }
.fields .row .form-group { flex: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 8px;
  font-size: 14px; font-weight: bold; color: var(--white);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none; z-index: 1000;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.show { opacity: 1; }

/* ===== DRAFTS LIST ===== */
.drafts-content { flex: 1; padding: 24px 28px; overflow-y: auto; }
.drafts-title { font-size: 16px; font-weight: bold; margin-bottom: 16px; }
.product-list {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.product-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.product-row:last-child { border-bottom: none; }
.product-thumb {
  width: 48px; height: 48px; flex-shrink: 0;
  background: #eee; border-radius: 6px; overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 20px;
}
.product-info { flex: 1; }
.product-info .name { font-weight: bold; color: var(--dark); }
.product-info .meta { color: #999; font-size: 12px; margin-top: 2px; }
.badge { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: bold; }
.badge.draft { background: #fff3cd; color: #856404; }
.badge.published { background: #d4edda; color: #155724; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; width: 184px; justify-content: flex-end; }
.btn-status {
  padding: 6px 14px; border-radius: 5px;
  background: var(--dark); color: var(--white);
  border: none; font-size: 12px; font-weight: bold;
  cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.btn-status:hover { background: #2d2d4e; }
.btn-status:disabled { background: #ccc; cursor: default; }
.btn-delete {
  padding: 6px 8px; border-radius: 5px;
  background: transparent; color: #ccc;
  border: 1px solid #e0e0e0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-delete:hover { background: #fff0f0; color: var(--error); border-color: #f5c6c6; }
.btn-edit {
  padding: 6px 8px; border-radius: 5px;
  background: transparent; color: #bbb;
  border: 1px solid #e0e0e0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-edit:hover { background: #f0f4ff; color: var(--dark); border-color: #c0cff8; }

/* ===== CARD GRID VIEW ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.card-img {
  position: relative; aspect-ratio: 3/4; background: #f5f5f5; overflow: hidden;
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover; cursor: zoom-in;
}
.card-img .no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.card-badge {
  position: absolute; top: 8px; left: 8px;
}
.card-body {
  padding: 10px 12px; flex: 1;
}
.card-name {
  font-weight: bold; font-size: 13px; color: var(--dark);
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta { font-size: 11px; color: #999; }
.card-actions {
  padding: 8px 10px; border-top: 1px solid #f0f0f0;
  display: flex; gap: 5px; justify-content: flex-end; align-items: center;
}
.card-actions .btn-status { font-size: 11px; padding: 5px 10px; flex: 1; text-align: center; }

/* ===== EDIT MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.45);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 12px;
  width: 100%; max-width: 460px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25); overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: bold; flex-shrink: 0;
}
.modal-close {
  background: none; border: none; cursor: pointer; color: #aaa;
  padding: 4px; border-radius: 4px; display: flex; align-items: center;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--dark); }
.modal-body {
  padding: 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; flex: 1;
}
.edit-photo-wrap {
  width: 100%; height: 200px; border-radius: 8px; overflow: hidden;
  position: relative; cursor: pointer; background: #f0f0f0;
  flex-shrink: 0;
}
.edit-photo-wrap img {
  width: 100%; height: 100%; object-fit: contain; background: #f5f5f5;
}
.edit-photo-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.32);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #fff; font-size: 13px; font-weight: bold;
  opacity: 0; transition: opacity 0.2s;
}
.edit-photo-wrap:hover .edit-photo-overlay { opacity: 1; }
.edit-photo-wrap.no-photo .edit-photo-overlay {
  opacity: 1; background: rgba(0,0,0,0.08); color: #999;
}
.edit-photo-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.55); border: none; border-radius: 50%;
  width: 28px; height: 28px; color: #fff; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 2;
}
.edit-photo-delete:hover { background: var(--error); }
.edit-photo-wrap:hover .edit-photo-delete:not([hidden]) { display: flex; }
.edit-photo-wrap:not(.no-photo):hover .edit-photo-delete { display: flex; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.btn-modal-cancel {
  padding: 10px 20px; border-radius: 6px;
  background: var(--white); color: var(--dark);
  border: 1px solid var(--border); font-size: 14px;
  cursor: pointer; transition: background 0.2s;
}
.btn-modal-cancel:hover { background: #f5f5f5; }
.modal-save { width: auto !important; padding: 10px 24px !important; }
#edit-name { text-transform: uppercase; }

/* keep old class for any cached references */
.btn-publish { display: none; }
.empty-state { text-align: center; padding: 48px; color: #999; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 20px 0 4px;
}
.btn-page {
  padding: 7px 18px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--dark); font-size: 13px; font-weight: bold;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn-page:hover:not(:disabled) { background: #f0f0f0; border-color: #ccc; }
.btn-page:disabled { color: #ccc; border-color: #eee; cursor: default; }
.page-info { font-size: 13px; color: #888; }

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.88);
  align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 88vh;
  object-fit: contain; border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15); border: none;
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

.product-thumb img { cursor: zoom-in; }

/* ===== COMPRA / EXCEL ===== */
.compra-content { flex: 1; padding: 24px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; }

.compra-toolbar { display: flex; justify-content: flex-end; }
.btn-template {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--dark); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.btn-template:hover { background: #f5f5f5; border-color: #ccc; }

.excel-drop-zone {
  border: 2px dashed #ddd; border-radius: 10px;
  background: var(--white); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.excel-drop-zone.drag-over { border-color: var(--dark); background: #f8f8f8; }

#excel-placeholder {
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
#excel-placeholder p { font-size: 14px; color: #888; margin: 0; }
#excel-placeholder small { font-size: 12px; color: #bbb; }
.btn-excel-select {
  padding: 9px 22px; border-radius: 6px;
  background: var(--dark); color: var(--white);
  border: none; font-size: 13px; font-weight: bold; cursor: pointer;
  transition: background 0.2s;
}
.btn-excel-select:hover { background: #2d2d4e; }

#excel-file-info {
  padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
}
#excel-filename { flex: 1; font-size: 14px; font-weight: 500; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-excel-clear {
  background: none; border: none; color: #aaa; cursor: pointer;
  padding: 4px; border-radius: 4px; display: flex;
  transition: color 0.2s;
}
.btn-excel-clear:hover { color: var(--error); }

.preview-header {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
}
.preview-title { font-size: 15px; font-weight: bold; }
.preview-count { font-size: 12px; color: #999; }

.preview-table-wrap {
  overflow-x: auto; border-radius: 8px;
  border: 1px solid var(--border);
}
.preview-table {
  width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px;
}
.preview-table thead th {
  padding: 10px 16px; background: #f5f5f5;
  font-size: 11px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 0.5px; color: #777; text-align: left;
  border-bottom: 1px solid var(--border);
}
.preview-table tbody td {
  padding: 10px 16px; border-bottom: 1px solid #f5f5f5; color: var(--dark);
}
.preview-table tbody tr:last-child td { border-bottom: none; }
.preview-table tbody tr:hover { background: #fafafa; }
.preview-table td:nth-child(4),
.preview-table td:nth-child(5) { font-variant-numeric: tabular-nums; }
.status-ok    { color: var(--success); font-weight: bold; font-size: 12px; }
.status-warn  { color: #856404; font-size: 12px; }
.status-error { color: var(--error); font-size: 12px; }
.status-loading { color: #aaa; font-size: 12px; }

#import-actions {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.btn-import {
  padding: 11px 28px; border-radius: 6px;
  background: var(--dark); color: var(--white);
  border: none; font-size: 14px; font-weight: bold;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.btn-import:hover { background: #2d2d4e; }
.btn-import:disabled { background: #999; cursor: default; }
.import-summary { font-size: 13px; color: #666; }

/* ===== USUARIOS ===== */
.users-content {
  flex: 1; padding: 24px 28px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
}
.conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .conn-grid { grid-template-columns: 1fr; } }
.woo-panel { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; }
.woo-status-box { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; flex: 1; }
.woo-status-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.woo-label { color: #888; min-width: 140px; font-weight: 500; }
.woo-val { color: var(--dark); font-family: monospace; font-size: 13px; }
.woo-secret { letter-spacing: 1px; color: #999; }
.woo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: #f0f0f0; color: #888;
}
.woo-badge.ok { background: #e8f5e9; color: #2e7d32; }
.woo-badge.ok::before { content: '●'; font-size: 9px; }
.woo-badge.error { background: #fdecea; color: #c62828; }
.woo-badge.error::before { content: '●'; font-size: 9px; }
.btn-woo-test {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 7px; border: none;
  background: var(--gold); color: var(--dark);
  font-size: 13px; font-weight: bold; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-woo-test:hover { opacity: 0.85; }
.btn-woo-test:disabled { opacity: 0.5; cursor: not-allowed; }
.woo-result { font-size: 12px; color: #888; margin-top: 8px; min-height: 16px; }
.users-list {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px;
}
.user-row:last-child { border-bottom: none; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--dark); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: bold; flex-shrink: 0;
  text-transform: uppercase;
}
.user-name { flex: 1; font-weight: 500; color: var(--dark); }
.user-self { font-size: 11px; color: #999; }
.users-add { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.users-add h3 { font-size: 14px; font-weight: bold; margin-bottom: 16px; color: var(--dark); }
.users-add .row { display: flex; gap: 14px; }
.users-add .row .form-group { flex: 1; }

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 1024px) and (min-width: 641px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 640px) {

  /* Shell: vertical stack */
  .shell { flex-direction: column; height: 100dvh; }

  /* Sidebar → fixed bottom nav bar */
  .sidebar {
    width: 100%; height: 62px;
    flex-direction: row; align-items: center;
    padding: 0 8px; gap: 0;
    border-right: none; border-top: 1px solid #e8e8e8;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 200; order: 2;
  }
  .sidebar .logo { display: none; }
  .sidebar .nav-item {
    flex: 1; padding: 8px 4px;
    font-size: 10px; gap: 3px;
    border-radius: 8px;
  }
  .sidebar-bottom { margin-top: 0; flex-direction: row; flex-shrink: 0; }
  .sidebar .logout {
    flex-shrink: 0; width: 56px;
    margin-top: 0; border-top: none; padding-top: 0;
    border-left: 1px solid #eee; padding: 8px 6px;
    font-size: 10px; gap: 3px;
  }

  /* Main: full width, space for bottom nav */
  .main { flex: 1; order: 1; min-height: 0; padding-bottom: 62px; overflow: hidden; }

  /* Topbar */
  .topbar { padding: 12px 16px; font-size: 14px; }

  /* Form: vertical stack, scrollable */
  .form-content {
    flex-direction: column;
    padding: 16px; gap: 20px;
    overflow-y: auto; align-items: stretch;
  }

  /* Photo: full width, portrait for clothing */
  .photo-upload { width: 100%; aspect-ratio: 3/4; }

  /* Fields */
  .fields { gap: 14px; padding-top: 0; }
  .fields .row { flex-direction: column; gap: 14px; }

  /* Drafts */
  .drafts-content { padding: 16px; }
  .drafts-title { font-size: 14px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Product row: adapt for small screen */
  .product-row { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .product-info { min-width: 0; }
  .product-info .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .badge { font-size: 10px; }
  .btn-status { font-size: 11px; padding: 6px 10px; }
  .row-actions { gap: 4px; width: 168px; }
  .modal-box { max-height: 100dvh; border-radius: 12px; }
  .modal-overlay { padding: 12px; }

  /* Toast: above bottom nav */
  .toast { bottom: 78px; z-index: 300; max-width: calc(100% - 32px); }

  /* Login: full width */
  .login-box { width: calc(100% - 32px); padding: 32px 24px; margin: 16px; }
  .login-logo img { width: 90px; }

  /* Inputs: prevent iOS zoom (font-size >= 16px) */
  .form-group input,
  .form-group select { font-size: 16px; }
}
