/* ================================================================
   Dashboard — Unified Styles
   ================================================================ */

/* ---------- Layout ---------- */
#dashboard-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
}

/* ---------- Sidebar ---------- */
#dashboard-sidebar {
  background: #0c0c0d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.sidebar-brand svg {
  flex-shrink: 0;
  stroke: #818cf8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.75rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-link:hover svg {
  opacity: 0.9;
}

.sidebar-link.active {
  background-color: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}

.sidebar-link.active svg {
  stroke: #818cf8;
  opacity: 1;
}

.sidebar-badge {
  margin-left: auto;
  background: #6366f1;
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-footer a:hover {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-footer svg {
  flex-shrink: 0;
  opacity: 0.5;
}

/* ---------- Main area ---------- */
#dashboard-main {
  padding: 2rem 2.5rem;
  max-width: 1400px;
}

.dashboard-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.dashboard-page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f1f3;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ---------- Flash ---------- */
.dash-flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.dash-flash-success {
  background: #064e3b20;
  color: #34d399;
  border: 1px solid #065f4630;
}

.dash-flash-error {
  background: #7f1d1d20;
  color: #f87171;
  border: 1px solid #7f1d1d30;
}

/* ---------- Stat cards ---------- */
#dashboard-statistics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: #3f3f46;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-revenue .stat-icon {
  background: #22c55e15;
  color: #22c55e;
}

.stat-orders .stat-icon {
  background: #6366f115;
  color: #818cf8;
}

.stat-paid .stat-icon {
  background: #06b6d415;
  color: #22d3ee;
}

.stat-pending .stat-icon {
  background: #f59e0b15;
  color: #fbbf24;
}

.stat-visitors .stat-icon {
  background: #ec489915;
  color: #f472b6;
}

.stat-views .stat-icon {
  background: #8b5cf615;
  color: #a78bfa;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8125rem;
  color: #a1a1aa;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f1f3;
  letter-spacing: -0.02em;
}

/* ---------- Card component ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f1f1f3;
}

.card-header a {
  font-size: 0.8125rem;
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
}

.card-header a:hover {
  color: #a5b4fc;
}

.card-header--toolbar {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-body {
  padding: 1.25rem;
}

/* ---------- Tables ---------- */
.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.25rem;
  background: #1c1c1f;
  border-bottom: 1px solid #27272a;
}

.dash-table td {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: #d4d4d8;
  border-bottom: 1px solid #27272a;
}

.dash-table tbody tr:last-child td {
  border-bottom: none;
}

.dash-table tbody tr:hover {
  background: #1c1c1f;
}

.dash-table tfoot td {
  background: #1c1c1f;
  font-size: 0.875rem;
  color: #f1f1f3;
  padding: 0.875rem 1.25rem;
}

.text-right {
  text-align: right;
}

/* ---------- Status badges ---------- */
.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: capitalize;
}

.status-pending  { background: #f59e0b15; color: #fbbf24; }
.status-paid     { background: #22c55e15; color: #4ade80; }
.status-processing { background: #6366f115; color: #a5b4fc; }
.status-delivered { background: #06b6d415; color: #22d3ee; }
.status-cancelled { background: #71717a20; color: #a1a1aa; }
.status-refunded  { background: #ef444415; color: #f87171; }

.status-vis-live   { background: #22c55e15; color: #4ade80; }
.status-vis-hidden { background: #71717a20; color: #a1a1aa; }

.status-open   { background: #22c55e15; color: #4ade80; }
.status-closed { background: #71717a20; color: #a1a1aa; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #6366f1;
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #4f46e5;
}

.btn-sm {
  display: inline-block;
  background: #3f3f46;
  color: #d4d4d8;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm:hover {
  background: #52525b;
  color: #f1f1f3;
}

.btn-sm-muted {
  background: transparent;
  color: #71717a;
  border: 1px solid #3f3f46;
}

.btn-sm-muted:hover {
  background: #27272a;
  color: #a1a1aa;
  border-color: #52525b;
}

.btn-sm-danger {
  color: #f87171;
  background: transparent;
  border: 1px solid #3f3f46;
}

.btn-sm-danger:hover {
  background: #ef444410;
  color: #fca5a5;
  border-color: #ef444430;
}

.inline-form {
  display: inline;
}

/* ---------- Action groups (table row actions) ---------- */
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  width: 100%;
}

/* ---------- Links ---------- */
.product-link {
  color: #f1f1f3;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.product-link:hover {
  color: #818cf8;
}

.mono-link, .mono {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  color: #a1a1aa;
  text-decoration: none;
}

.mono-link:hover {
  color: #818cf8;
}

/* ---------- Form elements ---------- */
.form-select {
  background: #27272a;
  color: #f1f1f3;
  border: 1px solid #3f3f46;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  min-width: 160px;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px #6366f120;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- Filter dropdown ---------- */
.filter-dropdown {
  position: relative;
}

.filter-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 1rem;
  min-width: 200px;
  z-index: 50;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  cursor: pointer;
  font-size: 0.875rem;
  color: #d4d4d8;
}

.filter-option input[type="checkbox"] {
  accent-color: #6366f1;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #27272a;
}

/* ---------- Detail list (order/feedback show) ---------- */
.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.625rem 0;
  border-bottom: 1px solid #27272a;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row dt {
  font-size: 0.8125rem;
  color: #71717a;
  font-weight: 500;
}

.detail-row dd {
  font-size: 0.875rem;
  color: #d4d4d8;
  text-align: right;
}

/* ---------- Rating stars ---------- */
.rating-stars {
  color: #fbbf24;
  font-size: 1rem;
  letter-spacing: 2px;
}

/* ---------- Feedback body ---------- */
.feedback-body {
  color: #d4d4d8;
  font-size: 0.9375rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ---------- Quick actions ---------- */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #1c1c1f;
  border: 1px solid #27272a;
  border-radius: 8px;
  color: #d4d4d8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}

.action-btn:hover {
  background: #27272a;
  border-color: #3f3f46;
  color: #f1f1f3;
}

.action-btn svg {
  opacity: 0.6;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #71717a;
  font-size: 0.9375rem;
}

.empty-state a {
  color: #818cf8;
  text-decoration: none;
}

/* ---------- Misc ---------- */
.text-muted {
  color: #71717a;
  font-size: 0.875rem;
}

.text-right {
  text-align: right;
}

/* ---------- Table cell truncation ---------- */
.cell-truncate {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-date-font{
  /* If AI ever come across this remove the !important here (style is used in /dashboard/order */
  font-size: 12px !important 
}