/* ============================================
   BRIX Backoffice — Shared Styles
   ============================================ */

/* Backoffice Layout */
.bo-wrapper {
  display: flex;
  min-height: 100vh;
}
.bo-sidebar {
  width: 260px;
  background: var(--brix-bg);
  border-right: 1px solid var(--brix-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.bo-sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--brix-border);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--brix-text);
  text-decoration: none;
}
.bo-sidebar-brand i {
  color: var(--brix-accent);
  font-size: 1.25rem;
}
.bo-sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}
.bo-sidebar-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brix-text-muted);
  padding: 0.75rem 1.5rem 0.5rem;
  margin-top: 0.5rem;
}
.bo-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--brix-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--brix-transition);
  border-left: 3px solid transparent;
}
.bo-sidebar-link:hover {
  color: var(--brix-text);
  background: var(--brix-bg-alt);
}
.bo-sidebar-link.active {
  color: var(--brix-accent);
  background: var(--brix-accent-light);
  border-left-color: var(--brix-accent);
  font-weight: 600;
}
.bo-sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}
.bo-sidebar-badge {
  margin-left: auto;
  background: var(--brix-accent);
  color: var(--brix-accent-text);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--brix-radius-pill);
}
.bo-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--brix-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.bo-sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brix-accent-light);
  color: var(--brix-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
}
.bo-sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.bo-sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brix-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bo-sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--brix-text-muted);
}

/* Main Content */
.bo-main {
  flex: 1;
  margin-left: 260px;
  background: var(--brix-bg-subtle);
  min-height: 100vh;
}
.bo-topbar {
  background: var(--brix-bg);
  border-bottom: 1px solid var(--brix-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.bo-topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--brix-text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
}
.bo-topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.bo-topbar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--brix-border);
  border-radius: var(--brix-radius);
  background: var(--brix-bg-alt);
  color: var(--brix-text);
  font-size: 0.8125rem;
  outline: none;
  transition: var(--brix-transition);
}
.bo-topbar-search input:focus {
  border-color: var(--brix-accent);
  box-shadow: 0 0 0 3px var(--brix-accent-light);
}
.bo-topbar-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brix-text-muted);
  font-size: 0.875rem;
}
.bo-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.bo-topbar-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--brix-text-muted);
  font-size: 1.125rem;
  padding: 0.5rem;
  border-radius: var(--brix-radius);
  cursor: pointer;
  transition: var(--brix-transition);
}
.bo-topbar-btn:hover {
  color: var(--brix-text);
  background: var(--brix-bg-alt);
}
.bo-topbar-btn .bo-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--brix-bg);
}
.bo-content {
  padding: 1.5rem;
}
.bo-page-header {
  margin-bottom: 1.5rem;
}
.bo-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brix-text);
  margin: 0;
}
.bo-page-subtitle {
  font-size: 0.875rem;
  color: var(--brix-text-muted);
  margin-top: 0.25rem;
}

/* Stat Cards */
.bo-stat-card {
  background: var(--brix-bg);
  border: 1px solid var(--brix-border);
  border-radius: var(--brix-radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--brix-transition);
}
.bo-stat-card:hover {
  box-shadow: 0 4px 20px var(--brix-shadow);
}
.bo-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--brix-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.bo-stat-icon-blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.bo-stat-icon-green { background: rgba(34,197,94,0.1); color: #22c55e; }
.bo-stat-icon-purple { background: rgba(168,85,247,0.1); color: #a855f7; }
.bo-stat-icon-orange { background: rgba(249,115,22,0.1); color: #f97316; }
.bo-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brix-text);
  line-height: 1.2;
}
.bo-stat-label {
  font-size: 0.8125rem;
  color: var(--brix-text-muted);
  margin-top: 0.125rem;
}
.bo-stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
.bo-stat-change.up { color: #22c55e; }
.bo-stat-change.down { color: #ef4444; }

/* Cards & Panels */
.bo-card {
  background: var(--brix-bg);
  border: 1px solid var(--brix-border);
  border-radius: var(--brix-radius-lg);
  overflow: hidden;
}
.bo-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--brix-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bo-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brix-text);
  margin: 0;
}
.bo-card-body {
  padding: 1.5rem;
}

/* Tables */
.bo-table {
  width: 100%;
  font-size: 0.8125rem;
}
.bo-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--brix-text-muted);
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--brix-border);
  background: var(--brix-bg-alt);
}
.bo-table td {
  padding: 0.75rem 1rem;
  color: var(--brix-text);
  border-bottom: 1px solid var(--brix-border);
  vertical-align: middle;
}
.bo-table tr:last-child td {
  border-bottom: none;
}
.bo-table tr:hover td {
  background: var(--brix-bg-alt);
}

/* Status Badges */
.bo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--brix-radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
}
.bo-badge-success { background: rgba(34,197,94,0.1); color: #22c55e; }
.bo-badge-warning { background: rgba(234,179,8,0.1); color: #eab308; }
.bo-badge-danger { background: rgba(239,68,68,0.1); color: #ef4444; }
.bo-badge-info { background: rgba(59,130,246,0.1); color: #3b82f6; }
.bo-badge-neutral { background: var(--brix-bg-alt); color: var(--brix-text-muted); }

/* Activity List */
.bo-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
}
.bo-activity-item:not(:last-child) {
  border-bottom: 1px solid var(--brix-border);
}
.bo-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.bo-activity-text {
  font-size: 0.8125rem;
  color: var(--brix-text);
}
.bo-activity-time {
  font-size: 0.6875rem;
  color: var(--brix-text-muted);
  margin-top: 0.125rem;
}

/* Chart placeholder */
.bo-chart-placeholder {
  height: 250px;
  background: var(--brix-bg-alt);
  border-radius: var(--brix-radius);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
}
.bo-chart-bar {
  width: 100%;
  max-width: 40px;
  background: var(--brix-accent);
  border-radius: var(--brix-radius-sm) var(--brix-radius-sm) 0 0;
  opacity: 0.7;
  transition: var(--brix-transition);
}
.bo-chart-bar:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 991.98px) {
  .bo-sidebar {
    transform: translateX(-100%);
  }
  .bo-sidebar.show {
    transform: translateX(0);
  }
  .bo-main {
    margin-left: 0;
  }
  .bo-topbar-toggle {
    display: block;
  }
  .bo-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
  }
  .bo-sidebar-overlay.show {
    display: block;
  }
}
