:root {
  --sidebar-width: 240px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #0a0a0f;
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: #12121a;
  border-right: 1px solid rgba(255,255,255,0.05);
  z-index: 1000;
  overflow-y: auto;
}

.sidebar .nav-link {
  border-radius: 8px;
  margin: 2px 0;
  padding: 10px 14px;
  color: #8a8a9a;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar .nav-link i {
  margin-right: 10px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: #e0e0e0;
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, #6c5ce7, #a855f7);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}

.topbar {
  background: #12121a;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-card {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

.stat-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.5rem;
}

.card {
  border-radius: 12px;
}

.table th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

.table td {
  vertical-align: middle;
}

.btn {
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 500;
}

.btn-sm {
  padding: 5px 12px;
}

.form-control, .form-select {
  border-radius: 8px;
  background: #1a1a25;
  border: 1px solid #2a2a3a;
  color: #e0e0e0;
}

.form-control:focus, .form-select:focus {
  background: #1a1a25;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
  color: #e0e0e0;
}

.badge {
  padding: 5px 10px;
  font-weight: 500;
  border-radius: 6px;
}

/* PDV styles */
.pdv-container {
  height: calc(100vh - 60px);
}

.pdv-products {
  height: calc(100vh - 200px);
  overflow-y: auto;
}

.pdv-cart {
  height: calc(100vh - 60px);
  position: sticky;
  top: 0;
}

.pdv-cart-items {
  max-height: calc(100vh - 380px);
  overflow-y: auto;
}

.product-card {
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.product-card:hover {
  border-color: #6c5ce7;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(108,92,231,0.2);
}

/* Print styles */
@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a2a3a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a4a;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating menu */
#floatingMenu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1050;
  min-width: 240px;
  background: #1a1a25;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  padding: 8px 0;
  display: none;
  margin-top: 4px;
}

#floatingMenu.show {
  display: block;
}

#floatingMenu .dropdown-item {
  color: #c0c0d0;
  padding: 10px 20px;
  font-size: 0.9rem;
  transition: all 0.15s;
}

#floatingMenu .dropdown-item:hover {
  background: rgba(108,92,231,0.15);
  color: #fff;
}

#floatingMenu .dropdown-item i {
  width: 20px;
  text-align: center;
}

#floatingMenu .dropdown-divider {
  border-color: rgba(255,255,255,0.08);
}

/* PDV fullscreen */
.pdv-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #0a0a0f;
}

.pdv-fullscreen .main-content {
  margin-left: 0 !important;
}

/* Sidebar toggle */
.sidebar-hidden .sidebar {
  display: none;
}

.sidebar-hidden .main-content {
  margin-left: 0 !important;
}

/* Menu toggle button */
#menuToggle {
  border-radius: 10px;
  padding: 6px 12px;
}

/* Product image thumbnail in tables */
.product-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: #1a1a25;
}

/* Product image preview in form */
.product-image-preview {
  transition: border-color 0.2s;
}

.product-image-preview:hover {
  border-color: var(--bs-primary) !important;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .sidebar .nav-link span:not(.badge),
  .sidebar .sidebar-header h5,
  .sidebar .sidebar-footer {
    display: none;
  }
  .main-content {
    margin-left: 60px;
  }
}
