:root {
  /* User defined theme variables */
  --theme-color: #ddffdd;
  --theme-title-color: #171d24;
  --theme-text-color: #6a737c;
  --theme-border-color: #dde1e5;
  --theme-dropshadow: 0 0.5px 1px 0 rgba(51, 77, 114, 0.1),
    0px 1.6px 3.6px 0 rgba(51, 77, 114, 0.15);
  --brand_color: #198754;
  --secondary_color: var(--theme-title-color);
  --p_color: #4c5267;
  --gradient_bg_color1: #fffbf2;
  --gradient_bg_color2: #edfffd;
  --border_on_white: #e6edf0;
  --border_on_highlight: #e6edf0;
  --body_bg: #fff;
  --bs-white: #fff;
  --black_25: #f9f9f9;
  --black_50: #ebebeb;
  --black_100: #d6d9dc;
  --black_150: #c8ccd0;
  --black_200: #bbc0c4;
  --black_300: #9fa6ad;
  --black_350: #9199a1;
  --black_400: #848d95;
  --black_500: #6a737c;
  --black_600: #535a60;
  --black_700: #3c4146;
  --black_750: #2f3337;
  --black_800: #242729;
  --black_850: #101010;
  --black_900: #0c0d0e;
  --font-color-white: #ffffff;
  --font-color-gray: #6b707f;
  --bs_sm: 0 1px 2px rgb(0 0 0 / 5%), 0 1px 4px rgb(0 0 0 / 5%), 0 2px 8px rgb(0 0 0 / 5%);
  --bs_md: 0 1px 3px rgb(0 0 0 / 6%), 0 2px 6px rgb(0 0 0 / 6%), 0 3px 8px rgb(0 0 0 / 9%);
  --bs_lg: 0 1px 4px rgb(0 0 0 / 9%), 0 3px 8px rgb(0 0 0 / 9%), 0 4px 13px rgb(0 0 0 / 13%);

  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--body_bg);
  background-image: linear-gradient(135deg, var(--gradient_bg_color1) 0%, var(--gradient_bg_color2) 100%);
  background-attachment: fixed;
  color: var(--p_color);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Auth Pages Styling */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border_on_white);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--bs_lg);
  transition: var(--transition-smooth);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  transition: var(--transition-smooth);
}

.auth-logo img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.auth-title {
  font-size: 22px;
  color: var(--theme-title-color);
  font-weight: 700;
}

.auth-subtitle {
  color: var(--theme-text-color);
  font-size: 14px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme-title-color);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font-sans);
  border: 1px solid var(--theme-border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--bs-white);
  color: var(--theme-title-color);
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand_color);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
}

.form-error {
  color: #dc3545;
  font-size: 13px;
  margin-top: 6px;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 8px;
}

.btn-primary {
  background-color: var(--brand_color);
  color: var(--font-color-white);
}

.btn-primary:hover {
  background-color: #146c43;
  transform: translateY(-1px);
  box-shadow: var(--bs_md);
}

.btn-block {
  width: 100%;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--theme-text-color);
}

.auth-footer a {
  color: var(--brand_color);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--theme-title-color);
  color: var(--font-color-white);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-brand {
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border-radius: var(--border-radius-md);
  padding: 10px;
  height: 75px;
  transition: var(--transition-smooth);
}

.sidebar-brand img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-menu-item a, .sidebar-menu-item button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  font-size: 15px;
  color: var(--black_300);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sidebar-menu-item.active a, .sidebar-menu-item a:hover {
  color: var(--theme-title-color);
  background-color: var(--theme-color);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--black_700);
  padding-top: 20px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px;
}

/* Top Header Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--theme-title-color);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border_on_white);
  box-shadow: var(--theme-dropshadow);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--brand_color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.profile-info {
  font-size: 14px;
}

.profile-name {
  font-weight: 700;
  color: var(--theme-title-color);
}

.profile-role {
  font-size: 11px;
  color: var(--brand_color);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  box-shadow: var(--bs_sm);
}

.alert-success {
  background-color: #d1e7dd;
  border: 1px solid #badbcc;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
}

/* Grid Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 35px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border_on_white);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--theme-dropshadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--bs_md);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--theme-text-color);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--theme-title-color);
}

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

.stat-icon.investment {
  background-color: var(--theme-color);
  color: var(--brand_color);
}

.stat-icon.loan {
  background-color: #fff3cd;
  color: #856404;
}

.stat-icon.earnings {
  background-color: #cff4fc;
  color: #055160;
}

/* Sections and Tabs */
.dashboard-tabs {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--theme-border-color);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--theme-text-color);
  padding: 8px 16px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--brand_color);
}

.tab-btn.active {
  color: var(--brand_color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--brand_color);
  border-radius: 3px 3px 0 0;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

/* Main Dashboard Panels Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.dashboard-panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border_on_white);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--theme-dropshadow);
  margin-bottom: 30px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--theme-title-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chart containers */
.chart-container {
  position: relative;
  height: 250px;
  margin-bottom: 20px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--theme-text-color);
  border-bottom: 1px solid var(--theme-border-color);
}

.data-table td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border_on_white);
  color: var(--theme-title-color);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--black_25);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pending {
  background-color: #fff3cd;
  color: #856404;
}

.badge-active, .badge-approved {
  background-color: var(--theme-color);
  color: var(--brand_color);
}

.badge-completed {
  background-color: #d1e7dd;
  color: #0f5132;
}

.badge-rejected {
  background-color: #f8d7da;
  color: #842029;
}

/* Admin Dashboard Table Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--border-radius-sm);
}

.btn-success {
  background-color: var(--brand_color);
  color: white;
}

.btn-success:hover {
  background-color: #146c43;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #b02a37;
}

/* Form panel styles for user investment/loan inputs */
.calculator-preview {
  margin-top: 15px;
  padding: 15px;
  border-radius: var(--border-radius-md);
  background-color: var(--theme-color);
  border: 1px solid rgba(25, 135, 84, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calculator-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.calculator-val {
  font-weight: 700;
  color: var(--brand_color);
}

/* Responsive utilities */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 70px;
    padding: 20px 10px;
  }

  .sidebar-brand {
    height: 50px;
    padding: 5px;
    margin-bottom: 25px;
  }

  .sidebar-brand span, .sidebar-menu-item span {
    display: none;
  }

  .main-content {
    margin-left: 70px;
    padding: 20px;
  }

  .auth-card {
    padding: 24px;
  }
}
