/* ===== LE SOMMELIER DE POCHE - Restaurant Back-office Layout Styles ===== */

/* ===== Layout Structure ===== */
.bo-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.bo-sidebar {
  width: var(--sidebar-width);
  background: var(--bo-surface);
  border-right: 1px solid var(--bo-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.3s ease;
}

.bo-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--bo-border);
}

.bo-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.bo-logo-img {
  height: 32px;
  width: auto;
}

.bo-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.bo-nav-section {
  margin-bottom: 24px;
}

.bo-nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bo-text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.bo-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  color: var(--bo-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.bo-nav-item:hover {
  background: var(--bo-bg);
  color: var(--bo-text);
}

.bo-nav-item.active {
  background: linear-gradient(135deg, rgba(107, 63, 160, 0.1), rgba(255, 107, 91, 0.1));
  color: var(--victor-grape);
}

.bo-nav-item.active .bo-nav-icon {
  color: var(--victor-grape);
}

.bo-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bo-nav-badge {
  margin-left: auto;
  background: var(--victor-coral);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.bo-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--bo-border);
}

.bo-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bo-bg);
  border-radius: 12px;
}

.bo-user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--victor-grape), var(--victor-wine));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.bo-user-info {
  flex: 1;
  min-width: 0;
}

.bo-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--bo-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-user-role {
  font-size: 12px;
  color: var(--bo-text-muted);
}

.bo-logout-btn {
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--bo-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.bo-logout-btn:hover {
  background: rgba(255, 107, 91, 0.1);
  color: var(--victor-coral);
}

/* ===== Main Content Area ===== */
.bo-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.bo-header {
  background: var(--bo-surface);
  border-bottom: 1px solid var(--bo-border);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.bo-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bo-mobile-menu-btn {
  display: none;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--bo-text);
  cursor: pointer;
  border-radius: 8px;
}

.bo-header-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bo-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bo-text-muted);
}

.bo-breadcrumb a {
  color: var(--bo-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bo-breadcrumb a:hover {
  color: var(--victor-grape);
}

.bo-breadcrumb-separator {
  color: var(--bo-border);
}

.bo-page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--bo-text);
  margin: 0;
}

.bo-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Content Area ===== */
.bo-content {
  flex: 1;
  padding: 32px;
  overflow-x: hidden;
  max-width: 100%;
}

/* ===== Button Utilities ===== */
.btn-primary-bo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--victor-grape), var(--victor-grape-light));
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary-bo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-button-grape);
}

.btn-secondary-bo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--bo-text);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary-bo:hover {
  border-color: var(--bo-border-hover);
  background: var(--bo-bg);
}

/* ===== Card Utilities ===== */
.card-bo {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: 16px;
  padding: 24px;
}

.card-bo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-bo-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--bo-text);
}

/* ===== Stats Card ===== */
.stat-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--bo-border-hover);
  box-shadow: var(--shadow-card);
}

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

.stat-icon.grape {
  background: rgba(107, 63, 160, 0.1);
  color: var(--victor-grape);
}

.stat-icon.coral {
  background: rgba(255, 107, 91, 0.1);
  color: var(--victor-coral);
}

.stat-icon.wine {
  background: rgba(139, 34, 82, 0.1);
  color: var(--victor-wine);
}

.stat-icon.gold {
  background: rgba(212, 175, 55, 0.1);
  color: var(--victor-gold);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--bo-text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--bo-text-secondary);
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  margin-top: 12px;
}

.stat-trend.positive {
  color: var(--status-success);
}

.stat-trend.negative {
  color: var(--status-error);
}

/* ===== Flash Messages ===== */
.flash-message {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.flash-message.notice {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-darker);
}

.flash-message.alert {
  background: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  color: var(--status-error-darker);
}

.flash-message svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ===== Mobile Overlay ===== */
.bo-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
}

.bo-sidebar-overlay.open {
  display: block;
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--victor-coral), var(--victor-grape));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Floating Action Button ===== */
.restaurant-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--victor-grape), var(--victor-grape-light));
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(107, 63, 160, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  text-decoration: none;
}

.restaurant-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(107, 63, 160, 0.5);
}

.restaurant-fab-extended {
  width: auto;
  padding: 0 20px;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

/* Content with FAB - add padding for scroll */
.bo-content.has-fab {
  padding-bottom: 100px;
}

/* ===== Pagination ===== */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
  margin-top: 16px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--bo-text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  border-color: var(--victor-grape);
  color: var(--victor-grape);
  background: rgba(107, 63, 160, 0.05);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--victor-grape), var(--victor-grape-light));
  border-color: var(--victor-grape);
  color: white;
  font-weight: 600;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 14px;
  color: var(--bo-text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .bo-sidebar {
    transform: translateX(-100%);
  }

  .bo-sidebar.open {
    transform: translateX(0);
  }

  .bo-main {
    margin-left: 0;
  }

  .bo-mobile-menu-btn {
    display: flex;
  }

  .bo-header {
    padding: 0 20px;
  }

  .bo-content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .bo-header {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    padding: 12px 20px;
    gap: 12px;
  }

  .bo-header-left {
    flex: 1;
    min-width: 0;
  }

  .bo-header-title {
    min-width: 0;
    flex: 1;
  }

  .bo-page-title {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bo-header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .bo-header-actions .btn-primary-bo,
  .bo-header-actions .btn-secondary-bo {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Hide text on very small screens, keep only icon */
  .bo-header-actions .btn-secondary-bo span,
  .bo-header-actions .btn-secondary-bo:not(:has(svg)) {
    display: inline;
  }
}

@media (max-width: 640px) {
  .bo-header {
    padding: 12px 16px;
  }

  .bo-page-title {
    font-size: 16px;
  }

  .bo-breadcrumb {
    display: none;
  }

  .bo-content {
    padding: 16px;
  }

  .card-bo {
    padding: 16px;
    border-radius: 12px;
  }

  /* Header actions: stack or icon-only on very small screens */
  .bo-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .bo-header-actions .btn-secondary-bo {
    padding: 8px 12px;
  }

  .bo-header-actions .btn-primary-bo {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .bo-header-left {
    width: 100%;
  }

  .bo-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .bo-header-actions > * {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .restaurant-fab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .restaurant-fab-extended {
    padding: 0 16px;
    font-size: 14px;
  }
}
