/*
 * Codigomantra Accounting System – Main Stylesheet
 * Built on top of Bootstrap 5
 */

/* ── Variables ── */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 0px;
  --sidebar-bg: #0d1b2a;
  --topbar-height: 56px;
  --primary-gradient: linear-gradient(135deg, #0d6efd, #0dcaf0);
}

/* ── Layout ── */
#wrapper {
  min-height: 100vh;
}

#sidebar-wrapper {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  min-height: 100vh;
  background-color: var(--sidebar-bg);
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
}

#page-content-wrapper {
  min-width: 0;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar-brand {
  min-height: var(--topbar-height);
  white-space: nowrap;
}

.sidebar-nav .nav-link {
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.sidebar-nav .nav-link.active {
  background: var(--primary-gradient);
  color: #fff !important;
  font-weight: 600;
}

/* ── Cards ── */
.card {
  border-radius: 12px;
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  padding: 0.85rem 1.25rem;
}

/* ── Tables ── */
.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  font-weight: 600;
  border-top: none;
}

/* ── Buttons ── */
.btn {
  border-radius: 8px;
}

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

/* Ensure soft/neutral badges stay readable on white backgrounds */
.badge.bg-secondary-subtle {
  color: var(--bs-secondary-text-emphasis, #495057) !important;
}

.badge.bg-warning-subtle {
  color: var(--bs-warning-text-emphasis, #664d03) !important;
}

/* ── Forms ── */
.form-control, .form-select {
  border-radius: 8px;
}

.form-control:focus, .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ── Page Title ── */
h4.fw-bold {
  font-size: 1.25rem;
}

/* ── Collapsed Sidebar (mobile) ── */
@media (max-width: 991.98px) {
  #sidebar-wrapper {
    position: fixed;
    z-index: 1040;
    left: calc(-1 * var(--sidebar-width));
    transition: left 0.25s ease;
  }

  #sidebar-wrapper.open {
    left: 0;
  }

  #page-content-wrapper {
    width: 100%;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* ── Utility ── */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
