/*
  safibiz Theme - Bootstrap 5.3.3 Custom Styles
  Colors: Deep Blue (#0B3C5D) + Lime Green (#7ED321)
  Supports: Light & Dark themes via data-bs-theme
*/

/* ========================
   ROOT VARIABLES
   ======================== */
:root {
  --sf-primary: #0B3C5D;
  --sf-primary-dark: #062A40;
  --sf-primary-light: #145A8A;
  --sf-accent: #7ED321;
  --sf-accent-hover: #6CC11A;
  --sf-accent-light: #A8E65C;
  --sf-accent-glow: rgba(126, 211, 33, 0.12);
  --sf-text-main: #1A1A2E;
  --sf-text-muted: #6B7280;
  --sf-bg-body: #F8FAFC;
  --sf-bg-card: #FFFFFF;
  --sf-bg-input: #FFFFFF;
  --sf-sidebar-bg: #EDF2F7;
  --sf-border: #E2E8F0;
  --sf-border-focus: #7ED321;
  --sf-shadow: 0 4px 20px rgba(11, 60, 93, 0.08);
  --sf-shadow-hover: 0 8px 30px rgba(11, 60, 93, 0.15);
  --sf-radius: 12px;
  --sf-radius-sm: 8px;
  --sf-transition: all 0.25s ease-in-out;
  --sf-font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --sf-font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-bs-theme="dark"] {
  --sf-primary: #1A5276;
  --sf-primary-dark: #0B3C5D;
  --sf-primary-light: #2980B9;
  --sf-accent: #82E0AA;
  --sf-accent-hover: #6CC11A;
  --sf-accent-light: #A8E65C;
  --sf-accent-glow: rgba(130, 224, 170, 0.15);
  --sf-text-main: #E8E8EE;
  --sf-text-muted: #9CA3AF;
  --sf-bg-body: #0F172A;
  --sf-bg-card: #1E293B;
  --sf-bg-input: #334155;
  --sf-sidebar-bg: #1E293B;
  --sf-border: #475569;
  --sf-border-focus: #82E0AA;
  --sf-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --sf-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ========================
   BASE & TYPOGRAPHY
   ======================== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--sf-font-body);
  background-color: var(--sf-bg-body);
  color: var(--sf-text-main);
  transition: var(--sf-transition);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sf-font-heading);
  font-weight: 700;
  color: var(--sf-text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--sf-primary-light);
  text-decoration: none;
  transition: var(--sf-transition);
}

a:hover {
  color: var(--sf-accent);
}

/* ========================
   THEME TOGGLE
   ======================== */
.theme-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1050;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--sf-border);
    background: var(--sf-bg-card);
    color: var(--sf-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--sf-transition);
    box-shadow: var(--sf-shadow);
}

.theme-toggle:hover {
  border-color: var(--sf-accent);
  color: var(--sf-accent);
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  border-radius: var(--sf-radius-sm);
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  transition: var(--sf-transition);
  letter-spacing: 0.02em;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--sf-primary-dark);
  border-color: var(--sf-primary-dark);
  box-shadow: 0 4px 14px rgba(11, 60, 93, 0.25);
  transform: translateY(-1px);
}

.btn-accent {
  background-color: var(--sf-accent);
  border-color: var(--sf-accent);
  color: #fff;
}

.btn-accent:hover,
.btn-accent:focus {
  background-color: var(--sf-accent-hover);
  border-color: var(--sf-accent-hover);
  box-shadow: 0 4px 14px rgba(126, 211, 33, 0.25);
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: var(--sf-primary);
  color: var(--sf-primary);
  background: transparent;
}

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

.btn-outline-accent {
  border-color: var(--sf-accent);
  color: var(--sf-accent);
  background: transparent;
}

.btn-outline-accent:hover {
  background-color: var(--sf-accent);
  color: #fff;
}

/* ========================
   CARDS
   ======================== */
.card {
  background-color: var(--sf-bg-card);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow);
  transition: var(--sf-transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--sf-shadow-hover);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--sf-border);
  font-weight: 700;
  color: var(--sf-primary);
  padding: 1.25rem;
}

[data-bs-theme="dark"] .card-header {
  color: var(--sf-accent-light);
}

/* ========================
   FORMS
   ======================== */
.form-control, .form-select {
  background-color: var(--sf-bg-input);
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-sm);
  color: var(--sf-text-main);
  padding: 0.75rem 1rem;
  transition: var(--sf-transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--sf-border-focus);
  box-shadow: 0 0 0 3px var(--sf-accent-glow);
  background-color: var(--sf-bg-input);
  color: var(--sf-text-main);
}

.form-label {
  font-weight: 600;
  color: var(--sf-text-main);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-check-input {
  border-color: var(--sf-border);
  background-color: var(--sf-bg-input);
  width: 1.25em;
  height: 1.25em;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--sf-accent);
  border-color: var(--sf-accent);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--sf-accent-glow);
}

.input-group-text {
  background-color: var(--sf-primary);
  border-color: var(--sf-primary);
  color: #fff;
  border-radius: var(--sf-radius-sm);
}

/* Password toggle button */
.password-toggle {
  background-color: var(--sf-bg-input);
  border-color: var(--sf-border);
  color: var(--sf-text-muted);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  border-color: var(--sf-accent);
  color: var(--sf-accent);
  background-color: var(--sf-bg-input);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* ========================
   NAVBAR
   ======================== */
.navbar {
  background-color: var(--sf-bg-card) !important;
  border-bottom: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow);
  padding: 0.75rem 1rem;
  transition: var(--sf-transition);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--sf-primary) !important;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-bs-theme="dark"] .navbar-brand {
  color: var(--sf-accent-light) !important;
}

.navbar-brand .brand-dot {
  color: var(--sf-accent);
}

.nav-link {
  color: var(--sf-text-muted) !important;
  font-weight: 600;
  padding: 0.5rem 1rem !important;
  border-radius: var(--sf-radius-sm);
  transition: var(--sf-transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--sf-primary) !important;
  background-color: var(--sf-bg-body);
}

[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active {
  color: var(--sf-accent) !important;
  background-color: var(--sf-bg-body);
}

/* ========================
   BADGES & ALERTS
   ======================== */
.badge {
  font-weight: 600;
  padding: 0.5em 0.75em;
  border-radius: 6px;
}

.badge-primary {
  background-color: var(--sf-primary);
  color: #fff;
}

.badge-accent {
  background-color: var(--sf-accent);
  color: #fff;
}

.alert {
  border-radius: var(--sf-radius-sm);
  border: none;
}

.alert-success {
  background-color: rgba(126, 211, 33, 0.12);
  color: var(--sf-accent-hover);
  border-left: 4px solid var(--sf-accent);
}

.alert-info {
  background-color: rgba(11, 60, 93, 0.1);
  color: var(--sf-primary);
  border-left: 4px solid var(--sf-primary);
}

/* ========================
   TABLES
   ======================== */
.table {
  color: var(--sf-text-main);
}

.table thead th {
  background-color: var(--sf-primary);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 1rem;
}

.table tbody td {
  border-color: var(--sf-border);
  padding: 1rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: var(--sf-bg-body);
}

/* ========================
   PROGRESS & STATS
   ======================== */
.progress {
  background-color: var(--sf-border);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  background-color: var(--sf-accent);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.stat-card {
  padding: 1.5rem;
  border-radius: var(--sf-radius);
  background: var(--sf-bg-card);
  border: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow);
  transition: var(--sf-transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sf-shadow-hover);
  border-color: var(--sf-border-focus);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: rgba(126, 211, 33, 0.12);
  color: var(--sf-accent);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--sf-primary);
  margin-bottom: 0.25rem;
  line-height: 1;
}

[data-bs-theme="dark"] .stat-value {
  color: var(--sf-accent-light);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--sf-text-muted);
  font-weight: 600;
}

/* ========================
   SPLIT LAYOUT (Auth pages)
   ======================== */
.split-layout {
  min-height: 100vh;
  display: flex;
}

.split-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  background: var(--sf-bg-card);
  position: relative;
}

.split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  background: linear-gradient(135deg, var(--sf-primary) 0%, var(--sf-primary-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.split-right::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--sf-accent-glow) 0%, transparent 70%);
  opacity: 0.3;
}

.split-right .brand-mark {
  font-size: 6rem;
  font-weight: 900;
  opacity: 0.08;
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  letter-spacing: -0.05em;
  user-select: none;
}

.split-right-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
  text-align: center;
}

.split-right h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.split-right p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  line-height: 1.6;
}

.auth-form {
  width: 100%;
  max-width: 420px;
}

.auth-form .form-control {
  padding: 0.875rem 1rem;
  font-size: 1rem;
}

.auth-form .btn {
  padding: 0.875rem;
  font-size: 1rem;
  width: 100%;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sf-primary);
  margin-bottom: 2rem;
  text-decoration: none;
}

[data-bs-theme="dark"] .auth-logo {
  color: var(--sf-accent-light);
}

.auth-logo svg {
  width: 40px;
  height: 40px;
  color: var(--sf-accent);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--sf-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sf-border);
}

/* ========================
   WELCOME / HERO
   ======================== */
.hero-section {
  padding: 5rem 0;
  text-align: center;
  background: linear-gradient(180deg, var(--sf-bg-card) 0%, var(--sf-bg-body) 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--sf-accent-glow) 0%, transparent 70%);
  opacity: 0.25;
  pointer-events: none;
}

.hero-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 2rem;
  color: var(--sf-accent);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--sf-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

[data-bs-theme="dark"] .hero-title {
  color: var(--sf-accent-light);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--sf-text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.feature-card {
  padding: 2rem;
  text-align: center;
  border-radius: var(--sf-radius);
  background: var(--sf-bg-card);
  border: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow);
  transition: var(--sf-transition);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sf-shadow-hover);
  border-color: var(--sf-accent);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  background: rgba(126, 211, 33, 0.12);
  color: var(--sf-accent);
  transition: var(--sf-transition);
}

.feature-card:hover .feature-icon {
  background: var(--sf-accent);
  color: #fff;
  transform: scale(1.05);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--sf-primary);
}

[data-bs-theme="dark"] .feature-title {
  color: var(--sf-accent-light);
}

.feature-desc {
  color: var(--sf-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ========================
   DASHBOARD
   ======================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--sf-sidebar-bg);
  border-right: 1px solid var(--sf-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  transition: var(--sf-transition);
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sf-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sf-primary);
  text-decoration: none;
}

[data-bs-theme="dark"] .sidebar-brand {
  color: var(--sf-accent-light);
}

.sidebar-brand svg {
  width: 32px;
  height: 32px;
  color: var(--sf-accent);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.sidebar-nav .nav-item {
  margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem !important;
  color: var(--sf-text-muted) !important;
  border-radius: var(--sf-radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--sf-transition);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(126, 211, 33, 0.1);
  color: var(--sf-accent) !important;
}

.sidebar-nav .nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sidebar dropdown */
.sidebar-dropdown-toggle {
  cursor: pointer;
}

.sidebar-dropdown-toggle .chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.sidebar-dropdown-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  padding-left: 2.75rem;
  list-style: none;
  margin: 0;
}

.sidebar-submenu .nav-link {
  padding: 0.5rem 1rem !important;
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-submenu .nav-link:hover,
.sidebar-submenu .nav-link.active {
  background: transparent;
  color: var(--sf-accent) !important;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sf-border);
  font-size: 0.875rem;
  color: var(--sf-text-muted);
  text-align: center;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  transition: var(--sf-transition);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.75rem;
  margin: 0;
}

.page-header .breadcrumb {
  margin: 0;
  font-size: 0.875rem;
}

.page-header .breadcrumb-item a {
  color: var(--sf-text-muted);
}

.page-header .breadcrumb-item.active {
  color: var(--sf-accent);
  font-weight: 600;
}

/* ========================
   CHART PLACEHOLDER
   ======================== */
.chart-placeholder {
  height: 300px;
  background: linear-gradient(135deg, var(--sf-primary) 0%, var(--sf-primary-dark) 100%);
  border-radius: var(--sf-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.chart-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.chart-placeholder h4 {
  color: #fff;
  position: relative;
  z-index: 1;
  margin-bottom: 0.5rem;
}

.chart-placeholder p {
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
}

/* ========================
   ACTIVITY LIST
   ======================== */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--sf-border);
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(126, 211, 33, 0.12);
  color: var(--sf-accent);
  font-size: 1.1rem;
}

.activity-content h6 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--sf-text-main);
}

.activity-content p {
  font-size: 0.875rem;
  color: var(--sf-text-muted);
  margin: 0;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--sf-text-muted);
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

/* ========================
   FOOTER
   ======================== */
.site-footer {
  background: var(--sf-bg-card);
  border-top: 1px solid var(--sf-border);
  padding: 2rem 0;
  text-align: center;
  color: var(--sf-text-muted);
  font-size: 0.875rem;
  margin-top: auto;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 991.98px) {
  .split-layout {
    flex-direction: column;
  }

  .split-right {
    min-height: 250px;
    padding: 2rem;
  }

  .split-left {
    padding: 2rem;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .hero-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 767.98px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
