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

:root {
  --yellow:      #F0E89C;
  --rose:        #917878;
  --rose-dark:   #7A6060;
  --rose-pale:   #F5EDED;
  --sidebar-bg:  #1E1A1A;
  --sidebar-2:   #2A2424;
  --white:       #FFFFFF;
  --bg:          #F7F5F0;
  --border:      rgba(0,0,0,0.07);
  --text:        #2C2828;
  --text-muted:  #9B8E8E;
  --success:     #5B9B6A;
  --danger:      #C0504D;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,0.07);
}

body.admin-body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.1);
}

.brand-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 1.25rem 0.875rem;
  flex: 1;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav ul { list-style: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}

.nav-item.active {
  background: var(--yellow);
  color: var(--rose-dark);
  font-weight: 600;
}

.nav-icon {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
}

.nav-logout { color: rgba(192, 80, 77, 0.7); }
.nav-logout:hover { background: rgba(192,80,77,0.12); color: #C0504D; }

/* ===== MAIN ===== */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== HEADER ===== */
.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header h1 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--rose-dark);
}

/* ===== CONTENT ===== */
.admin-content { padding: 2rem; flex: 1; }

/* ===== FLASH ===== */
.flash {
  margin: 0 2rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}
.flash-notice { background: #EEF7F0; color: var(--success); border: 1px solid #C3E4CB; }
.flash-alert  { background: #FDECEA; color: var(--danger);  border: 1px solid #F5C6C5; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

.stat-icon {
  width: 52px;
  height: 52px;
  background: var(--yellow);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--rose-dark);
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== CARD ===== */
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* ===== TABLE ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--bg);
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

.text-muted { color: var(--text-muted); }

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--rose-pale);
  color: var(--rose);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.action-cell { display: flex; gap: 0.5rem; align-items: center; }

/* ===== BUTTONS ADMIN ===== */
.btn-admin {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.btn-admin:hover { background: var(--bg); border-color: #ccc; }

.btn-admin-primary {
  background: var(--rose);
  color: var(--white);
  border-color: var(--rose);
}
.btn-admin-primary:hover { background: var(--rose-dark); border-color: var(--rose-dark); }

.btn-admin-sm { padding: 0.35rem 0.8rem; font-size: 0.75rem; }

.btn-admin-danger {
  color: var(--danger);
  border-color: rgba(192,80,77,0.3);
}
.btn-admin-danger:hover { background: #FDECEA; border-color: var(--danger); }

.btn-admin-success {
  color: #2d6a4f;
  border-color: rgba(45,106,79,0.3);
}
.btn-admin-success:hover { background: #d8f3dc; border-color: #2d6a4f; }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #c0504d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
  margin-left: auto;
}

/* ===== COMMENTS MANAGE ===== */
.comments-manage-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comment-manage-item {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #F0EBE3;
}

.comment-manage-item:last-child { border-bottom: none; }

.comment-manage-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.comment-manage-article {
  color: #888;
  font-size: 0.82rem;
  font-style: italic;
}

.comment-manage-date {
  color: #aaa;
  font-size: 0.8rem;
  margin-left: auto;
}

.comment-manage-body {
  color: #444;
  font-size: 0.92rem;
  margin: 0 0 1rem;
  line-height: 1.6;
}

.reply-existing {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  background: #f9f6f1;
  border-left: 3px solid #C9A882;
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}

.reply-label {
  color: #8B5E3C;
  font-weight: 600;
  white-space: nowrap;
}

.reply-preview { color: #555; }

.reply-form { display: flex; flex-direction: column; gap: 0.5rem; }

.reply-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.reply-textarea {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #E0D5C8;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  color: #333;
  min-height: 56px;
}

.reply-textarea:focus {
  outline: none;
  border-color: #C9A882;
}

/* ===== FORM ===== */
.admin-form { padding: 1.5rem; }

.form-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rose);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.admin-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: all 0.2s;
  appearance: none;
}

.admin-input:focus {
  outline: none;
  border-color: var(--rose);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(145,120,120,0.1);
}

textarea.admin-input { resize: vertical; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.form-errors {
  background: #FDECEA;
  border: 1px solid #F5C6C5;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.form-errors p {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

/* ===== LOGIN PAGE ===== */
.session-layout {
  min-height: 100vh;
  background: linear-gradient(160deg, #FAF6D8 0%, #F0E89C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-card {
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(145,120,120,0.2);
  text-align: center;
}

.session-logo {
  width: 64px;
  height: 64px;
  background: var(--yellow);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--rose-dark);
  margin: 0 auto 1.5rem;
}

.session-card h1 {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.session-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.session-form .form-group { text-align: left; margin-bottom: 1rem; }

.session-form .admin-input { background: var(--bg); }

.session-submit {
  width: 100%;
  padding: 0.875rem;
  background: var(--rose);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
}

.session-submit:hover { background: var(--rose-dark); transform: translateY(-1px); }

/* ===== IMAGE UPLOAD ===== */
.image-preview {
  margin-bottom: 1rem;
}

.preview-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  display: block;
}

.image-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.extra-images-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.extra-thumb-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.extra-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-delete-thumb {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-delete-thumb:hover { background: var(--danger); }

.image-actions {
  margin-top: 0.5rem;
}

.file-input {
  display: none;
}

.file-upload-wrapper {
  position: relative;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem;
  border: 2px dashed rgba(145,120,120,0.3);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.file-upload-label:hover {
  border-color: var(--rose);
  background: var(--rose-pale);
}

.file-icon { font-size: 2rem; }

.file-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rose);
}

.file-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-name {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
}

/* ===== PASSWORD TOGGLE ===== */
.password-wrapper {
  position: relative;
}

.password-wrapper .admin-input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0;
  transition: color 0.2s;
}

.password-toggle:hover { color: var(--rose); }

/* ===== FOCAL POINT ADJUSTER ===== */
.focal-point-section { margin-bottom: 1.25rem; }

.focal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.focal-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.5rem;
  align-items: start;
}

.focal-sub-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.focal-canvas-wrapper { flex: 1; }

.focal-canvas {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: crosshair;
  border: 1.5px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
}

.focal-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.focal-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.focal-dot-inner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 3px solid var(--rose);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  position: relative;
}

.focal-dot-inner::before,
.focal-dot-inner::after {
  content: '';
  position: absolute;
  background: var(--rose);
}

.focal-dot-inner::before {
  width: 2px; height: 10px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.focal-dot-inner::after {
  width: 10px; height: 2px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.focal-preview-wrapper { text-align: center; }

.focal-preview-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(145,120,120,0.2);
  box-shadow: var(--shadow);
  margin: 0 auto 0.5rem;
}

.focal-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.focal-coord-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Product thumbnail in table */
.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
