/* =========================================================
   VOGA – Admin Dashboard Stylesheet
   admin.css
   ========================================================= */

:root {
  --bg-color: #f5f5f7;          /* Apple space gray background */
  --card-bg: #ffffff;
  --text-primary: #1d1d1f;      /* Apple deep text */
  --text-secondary: #86868b;    /* Apple secondary/muted label */
  --border-color: rgba(0, 0, 0, 0.05);
  --caramel: #0071e3;           /* Apple Accent Blue */
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text-primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.65rem 1.4rem;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-primary:hover {
  background: #333336;
  transform: scale(1.02);
}
.btn-full { width: 100%; }

.btn-action {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-action:hover {
  background: #e8e8ed;
  border-color: rgba(0,0,0,0.15);
}
.btn-danger {
  color: #e30000;
}
.btn-danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
}

.btn-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  background: transparent;
  color: #e30000;
  border: 1px solid rgba(227, 0, 0, 0.15);
  padding: 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: #fee2e2;
  border-color: #e30000;
}

.btn-text {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--caramel);
  cursor: pointer;
}
.btn-text:hover {
  text-decoration: underline;
}

/* ===== LOGIN WRAPPER ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-color);
}
.login-card {
  background: var(--card-bg);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border-color);
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-header .logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
  display: block;
}
.login-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.login-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.login-form .form-group {
  margin-bottom: 1.25rem;
}
.login-error-msg {
  color: #e30000;
  font-size: 0.78rem;
  margin-bottom: 1rem;
  min-height: 1.2em;
  text-align: center;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  font-family: var(--font-sans);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fbfbfd;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--caramel);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 10;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
}
.sidebar-brand .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.badge-admin {
  background: var(--text-primary);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-item svg {
  color: var(--text-secondary);
  transition: color var(--transition);
}
.nav-item:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--bg-color);
  color: var(--text-primary);
  font-weight: 600;
}
.nav-item.active svg {
  color: var(--caramel);
}
.nav-store {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  border-radius: 0;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-width: 0; /* Prevents flex items from breaking layout on scroll */
}

.topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.current-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}
.user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.content-body {
  padding: 2.5rem 3rem;
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* ===== OVERVIEW TAB ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.metric-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}
.metric-info span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.metric-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.25rem 0;
  letter-spacing: -0.02em;
}
.metric-trend {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.metric-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 2rem;
}
.overview-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.overview-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.overview-card .card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}
.badge-accent {
  background: rgba(0, 113, 227, 0.08);
  color: var(--caramel);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* CSS BAR CHART */
.bar-chart-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 180px;
  padding: 1rem 0;
  margin-bottom: 1rem;
}
.chart-bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
}
.chart-bar-wrap {
  width: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}
.chart-bar-fill {
  width: 100%;
  background: var(--text-primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  min-height: 2px;
}
.chart-bar-column:hover .chart-bar-fill {
  background: var(--caramel);
}
.chart-bar-value {
  position: absolute;
  top: -1.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.chart-bar-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-transform: capitalize;
}

/* ===== DATA TABLES CARD ===== */
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-controls {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-color);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  flex: 1;
  max-width: 400px;
}
.search-box svg {
  color: var(--text-secondary);
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 100%;
}
.filter-box select {
  font-family: var(--font-sans);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--card-bg);
  outline: none;
  cursor: pointer;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.data-table th {
  background: #fbfbfd;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover td {
  background: #fbfbfd;
}
.td-empty {
  text-align: center;
  padding: 3rem !important;
  color: var(--text-secondary);
}

/* STATUS BADGES */
.status-badge {
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 980px;
  text-transform: capitalize;
}
.status-badge.pendente {
  background: #fef3c7;
  color: #b45309;
}
.status-badge.aprovado {
  background: #dcfce7;
  color: #15803d;
}
.status-badge.entregue {
  background: #dbeafe;
  color: #1d4ed8;
}
.status-badge.cancelado {
  background: #fee2e2;
  color: #b91c1c;
}

/* MINI VISUAL OUTLINE FOR PRODUCTS */
.product-mini-preview {
  width: 32px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.sizes-pills {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.sizes-pills span {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--bg-color);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

/* ===== MODAL DIALOGS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(20px);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.admin-modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 760px;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-overlay.open .admin-modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  background: var(--bg-color);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition);
  z-index: 2;
}
.modal-close:hover {
  background: #e8e8ed;
}

.admin-modal .modal-header {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border-color);
}
.admin-modal .modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
.modal-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  display: block;
}

.modal-body-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  flex: 1;
  overflow: hidden;
}

.modal-main-details {
  padding: 2rem;
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
}
.modal-sidebar-details {
  padding: 2rem;
  background: #fbfbfd;
  overflow-y: auto;
}

.modal-main-details h3,
.modal-sidebar-details h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

/* ORDER ITEMS ROW */
.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.order-item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.order-item-row:last-child {
  border-bottom: none;
}
.item-mini-img {
  width: 44px;
  height: 56px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.item-details {
  flex: 1;
}
.item-name {
  font-size: 0.85rem;
  font-weight: 600;
}
.item-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.item-price-block {
  text-align: right;
}
.item-price-block strong {
  display: block;
  font-size: 0.85rem;
}

.order-total-block {
  background: var(--bg-color);
  padding: 1.25rem;
  border-radius: var(--radius);
}
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}
.total-row:last-child {
  margin-bottom: 0;
}
.total-row.final-total {
  font-weight: 700;
  font-size: 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.detail-section {
  margin-bottom: 2rem;
  font-size: 0.85rem;
}
.detail-section:last-child {
  margin-bottom: 0;
}
.detail-section p {
  margin-bottom: 0.25rem;
}
.status-update-section select {
  font-family: var(--font-sans);
  padding: 0.5rem;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #ffffff;
  outline: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* PRODUCT/CUSTOMER MODAL FORM */
.admin-form {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}
.admin-form .form-group {
  margin-bottom: 1.25rem;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.8rem;
  background: #fbfbfd;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

/* ===== TOAST MESSAGE ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.75rem 1.75rem;
  border-radius: 980px;
  z-index: 500;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 70px;
    padding: 1.5rem 0.5rem;
    align-items: center;
  }
  .sidebar-brand {
    padding-left: 0;
    justify-content: center;
  }
  .sidebar-brand .logo,
  .sidebar-brand .badge-admin,
  .nav-item span,
  .btn-logout span {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 0.75rem;
  }
  .btn-logout {
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
  }
  .btn-logout svg {
    margin: 0;
  }
  .main-content {
    margin-left: 70px;
  }
  .topbar {
    padding: 1.5rem 2rem;
  }
  .content-body {
    padding: 2rem;
  }
  .modal-body-split {
    grid-template-columns: 1fr;
  }
  .modal-main-details {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

@media (max-width: 600px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
  }
  .content-body {
    padding: 1.25rem 1.5rem;
  }
  .table-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: none;
  }
  .form-row {
    grid-template-columns: 1fr;
    margin-bottom: 0;
  }
  .form-row .form-group {
    margin-bottom: 1.25rem;
  }
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== MEDIA UPLOADERS ===== */
.media-slot {
  transition: all var(--transition);
}
.media-slot:hover {
  border-color: var(--caramel) !important;
  background: #f0f7ff !important;
}
.media-slot .remove-btn {
  transition: background var(--transition);
}
.media-slot .remove-btn:hover {
  background: #ff3b30 !important; /* Apple Red alert */
}
