/* ===== INVESTOR MANAGEMENT SYSTEM — MODERN THEME ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #0ea5e9;
  --success: #22c55e;
  --success-bg: #dcfce7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --info: #3b82f6;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.05);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  background: var(--gray-50);
  background-image: radial-gradient(ellipse at 0% 0%, rgba(99,102,241,.06) 0%, transparent 50%),
                    radial-gradient(ellipse at 100% 0%, rgba(14,165,233,.04) 0%, transparent 50%);
  color: var(--gray-700);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  overflow-x: hidden;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  font-weight: 600;
  letter-spacing: -.02em;
}

a { color: var(--primary); text-decoration: none; transition: all .2s; }
a:hover { color: var(--primary-dark); }
a:focus { outline: none; }

ul, ol { padding: 0; list-style: none; margin: 0; }

/* ===== HEADER ===== */
.header {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226,232,240,.5);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1001;
  height: var(--header-height);
}

.header .header-left {
  float: left;
  height: var(--header-height);
  padding: 0 20px;
  position: relative;
  width: var(--sidebar-width);
  display: flex;
  align-items: center;
  background: transparent;
  transition: all .3s ease;
}

.mini-sidebar .header .header-left { justify-content: center; width: 72px; }
.header .header-left .logo img { max-height: 40px; width: auto; }
.header-left .logo.logo-small { display: none; }
.mini-sidebar .header .header-left .logo { display: none; }
.mini-sidebar .header-left .logo.logo-small { display: block; }

.header .dropdown-toggle:after { display: none; }

/* ===== USER MENU ===== */
.user-menu {
  float: right;
  margin: 0;
  position: relative;
  z-index: 99;
  padding-right: 20px;
  align-items: center;
  display: flex;
}

.user-menu.nav > li { float: left; }
.user-menu.nav > li > a {
  color: var(--gray-500);
  font-size: 14px;
  line-height: var(--header-height);
  padding: 0 12px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: all .2s;
}
.user-menu.nav > li > a:hover { background: var(--gray-100); }

.user-img {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.user-img .user-text { margin: 0; }
.user-img .user-text .text-muted {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary) !important;
  line-height: 1.2;
  display: block;
}
.user-img .user-text h6 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.3;
}

.user-img img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  padding: 2px;
  object-fit: cover;
}

.user-menu .dropdown-menu {
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  opacity: 0;
  display: block;
  transform: translateY(10px);
  transition: all .25s ease;
}

.user-menu .dropdown-menu.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.user-menu .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--gray-700);
  font-size: 13px;
  transition: all .15s;
}
.user-menu .dropdown-menu .dropdown-item:hover {
  background: var(--gray-100);
  color: var(--primary);
}
.user-menu .dropdown-menu .dropdown-item i {
  width: 20px;
  margin-right: 10px;
  color: var(--gray-400);
  font-size: 15px;
}

/* ===== MENU TOGGLE ===== */
#toggle_btn {
  align-items: center;
  display: inline-flex;
  float: left;
  font-size: 16px;
  height: 36px;
  width: 36px;
  background: var(--primary);
  color: #fff;
  justify-content: center;
  border-radius: 10px;
  position: absolute;
  left: -18px;
  z-index: 99;
  top: 14px;
  box-shadow: 0 4px 10px rgba(99,102,241,.25);
  cursor: pointer;
  transition: all .2s;
  border: 0;
}
#toggle_btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.menu-toggle { position: relative; display: flex; }
.mobile_btn { display: none; float: left; cursor: pointer; }
.slide-nav .sidebar { margin-left: 0; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  bottom: 0;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  z-index: 1000;
  transition: all .3s ease;
  overflow: hidden;
}

.mini-sidebar .sidebar { width: 72px; }
.mini-sidebar.expand-menu .sidebar { width: var(--sidebar-width); }

.sidebar-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }

.sidebar-menu { padding: 0 12px; }

.sidebar-menu ul { font-size: 14px; }
.sidebar-menu > ul > li { margin-bottom: 2px; }

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all .2s;
  gap: 12px;
}

.sidebar-menu li a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.sidebar-menu li.active > a {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}

.sidebar-menu li a i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-menu li.active > a i { color: #fff; }

.sidebar-menu .menu-arrow {
  position: absolute;
  right: 14px;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  transition: transform .25s;
  color: var(--gray-400);
}

.sidebar-menu .menu-arrow:before { content: "\f105"; }
.sidebar-menu li a.subdrop .menu-arrow { transform: rotate(90deg); }

.sidebar-menu > ul > li { position: relative; }
.sidebar-menu ul ul { display: none; margin-left: 8px; }
.sidebar-menu ul ul a {
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-500);
}
.sidebar-menu ul ul a.active {
  background: var(--gray-100);
  color: var(--primary);
}
.sidebar-menu ul ul ul a { padding-left: 52px; }

/* Mini sidebar text hiding */
.mini-sidebar .sidebar .sidebar-menu > ul > li > a span { display: none; opacity: 0; transition: all .2s; }
.mini-sidebar.expand-menu .sidebar .sidebar-menu > ul > li > a span { display: inline; opacity: 1; }

/* ===== PAGE WRAPPER ===== */
.page-wrapper {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  transition: all .3s ease;
  min-height: 100vh;
}

.mini-sidebar .page-wrapper { margin-left: 72px; }

.page-wrapper > .content {
  padding: 24px 24px 16px;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  margin-bottom: 20px;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stat-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  transition: all .3s;
  height: 100%;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.stat-icon.blue { background: linear-gradient(135deg, #6366f1, #818cf8); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e, #4ade80); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316, #fb923c); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #f87171); }
.stat-icon.yellow { background: linear-gradient(135deg, #eab308, #fde047); }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7, #c084fc); }
.stat-icon.indigo { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.stat-icon.teal { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }

.stat-info h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.2;
}

.stat-info h6 {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 4px;
}

/* ===== TABLES ===== */
.table {
  margin-bottom: 0;
  width: 100% !important;
}

.table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  padding: 12px 12px !important;
  background: var(--gray-50);
  white-space: nowrap;
}

.table tbody td {
  padding: 10px 12px !important;
  vertical-align: middle;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover { background: var(--gray-50); }

.table tfoot th {
  background: var(--gray-50);
  font-weight: 700;
  padding: 12px !important;
  border-top: 2px solid var(--gray-200);
}

.table-bordered {
  border: 1px solid var(--gray-200);
}
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--gray-200);
}

.table-striped tbody tr:nth-of-type(odd) { background: var(--gray-50); }
.table-striped tbody tr:hover { background: #eef2ff; }

.table-responsive { overflow-x: auto; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  width: 100%;
  display: block;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  transition: all .2s;
  outline: none;
  height: auto;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
  background: #fff;
}

input[type="file"] {
  padding: 8px;
  background: var(--gray-50);
  cursor: pointer;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea { min-height: 100px; resize: vertical; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* Primary */
.btn-primary, .primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 10px rgba(99,102,241,.25);
}
.btn-primary:hover, .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}

/* Success */
.btn-success, .success-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 10px rgba(34,197,94,.25);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34,197,94,.35);
}

/* Danger */
.btn-danger, .danger-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 10px rgba(239,68,68,.2);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239,68,68,.3);
}

/* Warning */
.btn-warning, .warning-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.btn-warning:hover { transform: translateY(-1px); }

/* Outline */
.btn-outline-primary, .primary-outline-btn {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== MODALS ===== */
.modal-content {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-body { padding: 20px; }

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 0;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.close:hover { background: #fee2e2; color: var(--danger); }

/* ===== DATATABLES ===== */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--gray-50);
  margin-left: 8px;
  width: 200px;
}

.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--gray-50);
  margin: 0 4px;
}

/* ===== SELECT2 ===== */
.select2-container .select2-selection--single {
  height: 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 42px;
  padding-left: 14px;
  font-size: 14px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--gray-400);
}

/* ===== PAGE TITLE ===== */
.pg_title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.01em;
}

/* ===== BADGES ===== */
.badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge.bg-success { background: var(--success-bg) !important; color: #15803d; }
.badge.bg-danger { background: var(--danger-bg) !important; color: #b91c1c; }
.badge.bg-warning { background: var(--warning-bg) !important; color: #92400e; }

/* ===== CUSTOM CHECKBOX ===== */
.checkbox-wrapper { cursor: pointer; position: relative; width: 30px; display: inline-block; }
.checkbox_des_v1 { display: none !important; }
.checkbox-wrapper label {
  display: block;
  width: 22px; height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  transition: all .2s;
  cursor: pointer;
  position: relative;
}
.checkbox-wrapper label::after {
  content: "";
  position: absolute;
  display: none;
  left: 6px; top: 2px;
  width: 7px; height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-wrapper input:checked + label {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-wrapper input:checked + label::after { display: block; }
.checkbox-wrapper input[type="checkbox"] { margin: 0; }

/* ===== SLIMSCROLL ===== */
.slimscroll { overflow: hidden; }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  background: rgba(0,0,0,.4);
  display: none;
  height: 100%;
  left: 0;
  position: fixed;
  top: var(--header-height);
  width: 100%;
  z-index: 999;
}
.sidebar-overlay.opened { display: block; }

/* ===== PRINT ===== */
@media print {
  body { background: #fff !important; }
  .sidebar, .header, .no-print, footer, .card-header, form, .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate {
    display: none !important;
  }
  .card, .content, .page-wrapper { margin: 0 !important; padding: 0 !important; box-shadow: none !important; border: none !important; }
  .only_print { display: block !important; }
  td, th { font-size: 11px !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .header .header-left { position: absolute; width: 100%; padding: 0 50px; }
  .mobile_btn { display: block; font-size: 20px; height: var(--header-height); line-height: var(--header-height); padding: 0 16px; position: absolute; left: 0; top: 0; z-index: 10; color: var(--gray-600); }
  #toggle_btn { display: none; }
  .sidebar { margin-left: calc(-1 * var(--sidebar-width)); width: var(--sidebar-width); z-index: 1041; }
  .page-wrapper { margin-left: 0 !important; }
  .page-wrapper > .content { padding: 16px; }
}

@media (max-width: 767.98px) {
  .user-img .user-text { display: none; }
  .header .header-left .logo { display: none; }
  .header-left .logo.logo-small { display: inline-block; left: 50%; position: relative; transform: translateX(-50%); }
  .user-menu { padding-right: 8px; }
}

/* ===== UTILITY ===== */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-shrink-0 { flex-shrink: 0; }
.w-100 { width: 100%; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.p-3 { padding: 12px; }
.shadow { box-shadow: var(--shadow); }
.border-0 { border: 0 !important; }

/* ===== TOAST / JCONFIRM ===== */
.jconfirm-box { border-radius: var(--radius) !important; }
.jconfirm .jconfirm-box .jconfirm-content-pane { margin-bottom: 10px !important; }
