/* ======================================
   Smartden Stock Manager - Custom Styles
   ====================================== */

:root {
  --sidebar-width: 250px;
  --bg-sidebar: #1a1d23;
  --transition: all 0.25s ease;
}

body {
  font-size: 0.9rem;
  background-color: #f4f6f9;
}

/* ── Wrapper layout ── */
#wrapper {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--bg-sidebar) !important;
  transition: var(--transition);
  flex-shrink: 0;
  /* Fara height fix - se intinde cu flex pana la fundul paginii */
}

/* Meniul din interior ramane vizibil la scroll (sticky) */
.sidebar-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-sticky::-webkit-scrollbar { width: 4px; }
.sidebar-sticky::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.sidebar-brand {
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  background-color: rgba(0,0,0,0.2);
}

.sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 0 0.75rem;
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.875rem;
  margin: 1px 0;
  transition: var(--transition);
  white-space: nowrap;
}

.sidebar-link:hover {
  background-color: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-link.active {
  background-color: #0d6efd;
  color: #fff;
  font-weight: 600;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.sidebar-link.active i { opacity: 1; }

/* ── Desktop: sidebar collapsed cu butonul toggle ── */
#wrapper.sidebar-collapsed #sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

/* ── Content wrapper ── */
#page-content-wrapper {
  flex: 1;
  min-width: 0;
  transition: var(--transition);
}

/* ── Top navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Overlay mobil ── */
#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

#sidebarOverlay.active {
  display: block;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 0;
    min-width: 0;
    overflow: hidden;
    z-index: 1000;
  }

  #sidebar .sidebar-sticky {
    height: 100vh;
    width: var(--sidebar-width);
  }

  /* Deschis pe mobil */
  #wrapper.sidebar-open #sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }

  /* Continutul ocupa tot ecranul pe mobil */
  #page-content-wrapper {
    width: 100%;
    min-width: 0;
  }

  /* Ascunde badge-ul de rol pe ecrane mici */
  .navbar .badge .opacity-75 {
    display: none;
  }

  /* Padding mai mic pe mobil */
  .container-fluid.py-4.px-4 {
    padding: 1rem !important;
  }
}

/* ── Cards ── */
.card { border-radius: 0.6rem; }
.card-header { border-radius: 0.6rem 0.6rem 0 0 !important; }

/* ── Stats cards ── */
.stat-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.table td { vertical-align: middle; }

/* ── Badges ── */
.badge { font-weight: 500; }

/* ── Alerts ── */
.alert { border-radius: 0.5rem; }

/* ── Login page ── */
.login-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #0d6efd22, #0d6efd11);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ── Smooth table hover ── */
.table-hover tbody tr {
  transition: background-color 0.1s ease;
}

/* ── Print styles ── */
@media print {
  body { background: white; font-size: 11px; }
  #sidebar, #sidebarOverlay, .navbar, .btn, form, .alert-auto-dismiss { display: none !important; }
  #wrapper { display: block !important; }
  #page-content-wrapper { margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
  .container-fluid { padding: 0 !important; }
}
