/* =====================================================
   OFFICE — Admin Panel
   /public/assets/css/admin.css
   ===================================================== */

:root {
  --admin-primary: #0A0A0A;
  --admin-gold: #C9A55C;
  --admin-bg: #f5f5f2;
  --admin-card: #ffffff;
  --admin-text: #1A1A1A;
  --admin-muted: #6b6b6b;
  --admin-border: #e6e3dd;
  --admin-success: #27ae60;
  --admin-danger: #e74c3c;
  --admin-warning: #e67e22;
  --admin-info: #3498db;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body.admin-body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 14px;
}

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

.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--admin-primary);
  color: #d4d4d4;
  flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 50;
  transition: transform .3s;
}
.admin-sidebar__brand {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.admin-sidebar__brand .logo {
  color: #fff;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem; letter-spacing: .22em;
  font-weight: 500;
}
.admin-sidebar__brand small {
  display: block; color: var(--admin-gold);
  font-size: .65rem; letter-spacing: .3em; text-transform: uppercase;
  margin-top: 4px;
}
.admin-nav { padding: 16px 0; list-style: none; margin: 0; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  color: #c8c8c8; text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: .2s;
}
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.admin-nav a.active {
  color: #fff; border-left-color: var(--admin-gold);
  background: rgba(201,165,92,.08);
}
.admin-nav .section-label {
  padding: 16px 24px 8px;
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: #666;
}

.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.admin-topbar {
  background: var(--admin-card);
  padding: 16px 28px;
  border-bottom: 1px solid var(--admin-border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}
.admin-topbar__user {
  display: flex; align-items: center; gap: 12px;
  font-size: .9rem;
}
.admin-topbar__user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--admin-gold); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
}

.admin-content { padding: 28px; }

.admin-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; margin-right: 12px;
}

@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-toggle { display: block; }
}

/* ======= CARDS / BOXES ======= */
.card {
  background: var(--admin-card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.card h2, .card h3 { margin-top: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat {
  background: var(--admin-card);
  padding: 24px;
  border-radius: 8px;
  border-left: 4px solid var(--admin-gold);
}
.stat .label {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--admin-muted); margin-bottom: 8px;
}
.stat .value { font-size: 2rem; font-weight: 700; color: var(--admin-primary); line-height: 1; }

/* ======= BOTÕES ======= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  background: var(--admin-primary);
  color: #fff; border: 1px solid var(--admin-primary);
  border-radius: 6px;
  font-size: .85rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: .2s;
}
.btn:hover { background: var(--admin-gold); border-color: var(--admin-gold); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-outline { background: transparent; color: var(--admin-primary); }
.btn-outline:hover { background: var(--admin-primary); color: #fff; }
.btn-gold { background: var(--admin-gold); border-color: var(--admin-gold); }
.btn-danger { background: var(--admin-danger); border-color: var(--admin-danger); }
.btn-success { background: var(--admin-success); border-color: var(--admin-success); }
.btn-light { background: #fff; color: var(--admin-text); border-color: var(--admin-border); }
.btn-light:hover { background: var(--admin-bg); color: var(--admin-primary); }

/* ======= FORMS ======= */
.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .92rem;
  background: #fff;
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--admin-gold); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px; font-weight: 500;
  font-size: .82rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
.form-check {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
}
.form-check input { margin: 0; }
.form-hint { font-size: .78rem; color: var(--admin-muted); margin-top: 4px; }

/* ======= TABELAS ======= */
.table {
  width: 100%;
  background: var(--admin-card);
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.table th {
  background: #f9f7f3;
  padding: 14px;
  text-align: left;
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--admin-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
}
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--admin-border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafaf8; }

.table .thumb {
  width: 54px; height: 54px;
  object-fit: cover; border-radius: 4px;
  background: #eee;
}

/* ======= BADGES ======= */
.badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
}
.badge-success  { background: #e8f6ed; color: #186a3b; }
.badge-primary  { background: #e5e5e5; color: #0A0A0A; }
.badge-info     { background: #e8f2fa; color: #1d4e89; }
.badge-warning  { background: #fdf1dc; color: #7c4a03; }
.badge-secondary{ background: #eceae5; color: #555; }
.badge-danger   { background: #fceae7; color: #86251c; }

/* ======= FILTER BAR ======= */
.filter-bar {
  background: var(--admin-card);
  padding: 16px 20px; border-radius: 8px;
  margin-bottom: 20px;
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center;
}
.filter-bar .form-control, .filter-bar .form-select { max-width: 220px; }

/* ======= GALERIA IMAGENS ======= */
.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.img-gallery .item {
  position: relative;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.img-gallery .item.principal {
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 2px rgba(201,165,92,.2);
}
.img-gallery img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  display: block;
}
.img-gallery .actions {
  display: flex; justify-content: space-between;
  padding: 6px 8px;
  background: #fafaf8;
  font-size: .72rem;
}
.img-gallery .actions a { color: var(--admin-primary); text-decoration: none; }
.img-gallery .actions a.remove { color: var(--admin-danger); }
.img-gallery .tag-principal {
  position: absolute; top: 6px; left: 6px;
  background: var(--admin-gold); color: #fff;
  padding: 2px 8px; font-size: .65rem;
  border-radius: 4px; letter-spacing: .1em; text-transform: uppercase;
}

/* ======= FLASH ======= */
.flash {
  padding: 12px 16px; margin-bottom: 16px;
  border-radius: 6px; border-left: 4px solid;
}
.flash.success { background: #e8f6ed; border-color: var(--admin-success); }
.flash.error   { background: #fdecec; border-color: var(--admin-danger); }

/* ======= LOGIN ======= */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0A0A0A 0%, #1a1a1a 100%);
  padding: 24px;
}
.login-box {
  background: #fff;
  padding: 48px;
  width: 100%; max-width: 420px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-box h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  text-align: center; margin: 0 0 8px;
  letter-spacing: .22em;
}
.login-box p.subtitle {
  text-align: center; color: var(--admin-muted);
  font-size: .82rem; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 32px;
}

/* ======= PAGINAÇÃO ======= */
.pagination { display: flex; gap: 4px; margin-top: 20px; }
.pagination a, .pagination span {
  padding: 8px 12px; border: 1px solid var(--admin-border);
  background: #fff; color: var(--admin-text);
  text-decoration: none; font-size: .85rem;
  border-radius: 4px;
}
.pagination .current { background: var(--admin-primary); color: #fff; border-color: var(--admin-primary); }
.pagination a:hover { border-color: var(--admin-gold); }

/* ======= VARIAÇÕES / CHIPS ======= */
.variation-list { margin-top: 16px; }
.variation-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--admin-border);
  border-radius: 6px; margin-bottom: 8px;
  background: #fafaf8;
}
.color-dot { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
