/* ─── VFin Admin Panel ─── */
/* Brand: Primary #1a5c3a (dark green) | Secondary #1a2332 (navy) | Accent #f0a500 (gold) */

:root {
  --vf-primary: #1a5c3a;
  --vf-primary-dark: #144a2e;
  --vf-primary-light: #e8f5ee;
  --vf-secondary: #1a2332;
  --vf-accent: #f0a500;
  --vf-accent-light: #fff8e6;
  --vf-sidebar-width: 260px;
  --vf-header-height: 60px;
  --vf-bg: #f5f7fa;
  --vf-card-radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--vf-bg);
  color: #2d3748;
  font-size: 14px;
}

/* ─── Auth Layout ─── */
.auth-body {
  background: linear-gradient(135deg, var(--vf-primary) 0%, #0f2e1e 50%, var(--vf-secondary) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.auth-card {
  background: #fff;
  border-radius: var(--vf-card-radius);
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-footer { text-align: center; margin-top: 1.5rem; }

/* ─── Admin Layout ─── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.admin-sidebar {
  width: var(--vf-sidebar-width);
  background: var(--vf-secondary);
  color: #a0aec0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--vf-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.brand-icon-lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 20px;
}

.brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.nav-section {
  margin-bottom: 0.5rem;
}

.nav-section-title {
  display: block;
  padding: 0.75rem 1.5rem 0.375rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #4a5568;
  text-transform: uppercase;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  color: #a0aec0;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 22px;
  margin-right: 12px;
  text-align: center;
}

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

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(26, 92, 58, 0.25);
  border-left-color: var(--vf-accent);
}

.sidebar-nav .nav-link.active i {
  color: var(--vf-accent);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0;
}

/* ─── Main Content ─── */
.admin-main {
  flex: 1;
  margin-left: var(--vf-sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─── Header ─── */
.admin-header {
  height: var(--vf-header-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.admin-header .breadcrumb {
  font-size: 13px;
}

/* ─── Content Area ─── */
.admin-content {
  flex: 1;
  overflow-x: hidden;
}

/* ─── Cards ─── */
.card {
  border-radius: var(--vf-card-radius);
}

.card-header {
  border-radius: var(--vf-card-radius) var(--vf-card-radius) 0 0 !important;
}

/* ─── Stat Cards ─── */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

/* ─── Avatar ─── */
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

/* ─── Tables ─── */
.table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table td {
  font-size: 13px;
  vertical-align: middle;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.table-hover tbody tr:hover {
  background-color: rgba(26, 92, 58, 0.03);
}

/* ─── Badges ─── */
.badge {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
  padding: 0.35em 0.65em;
}

/* ─── Forms ─── */
.form-control:focus, .form-select:focus {
  border-color: var(--vf-primary);
  box-shadow: 0 0 0 0.2rem rgba(26, 92, 58, 0.15);
}

.form-label {
  font-size: 13px;
  margin-bottom: 0.375rem;
}

/* ─── Buttons - Green primary ─── */
.btn-primary {
  background-color: var(--vf-primary);
  border-color: var(--vf-primary);
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
  background-color: var(--vf-primary-dark);
  border-color: var(--vf-primary-dark);
}

.btn-outline-primary {
  color: var(--vf-primary);
  border-color: var(--vf-primary);
}

.btn-outline-primary:hover {
  background-color: var(--vf-primary);
  border-color: var(--vf-primary);
  color: #fff;
}

/* Primary subtle overrides to green */
.bg-primary-subtle { background-color: var(--vf-primary-light) !important; }
.text-primary { color: var(--vf-primary) !important; }

.text-primary a, a.text-primary { color: var(--vf-primary) !important; }
a.text-primary:hover { color: var(--vf-primary-dark) !important; }

/* ─── Autocomplete ─── */
.autocomplete-results {
  position: absolute;
  z-index: 1050;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  max-height: 250px;
  overflow-y: auto;
  width: calc(100% - 2rem);
}

.autocomplete-item {
  padding: 0.625rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.autocomplete-item:hover {
  background: #f8fafc;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

/* ─── Pagination ─── */
.page-link {
  font-size: 13px;
  color: var(--vf-primary);
  border-radius: 6px !important;
  margin: 0 2px;
}

.page-item.active .page-link {
  background-color: var(--vf-primary);
  border-color: var(--vf-primary);
}

/* ─── Scrollbar ─── */
.admin-sidebar::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
  }
}

/* ─── Print ─── */
@media print {
  .admin-sidebar, .admin-header { display: none !important; }
  .admin-main { margin-left: 0 !important; }
  .btn, .pagination { display: none !important; }
}
