:root {
  --primary: #044f27;
  --primary-dark: #03381a;
  --primary-light: rgba(4, 79, 39, 0.1);
  --sidebar-width: 260px;
  --header-height: 70px;
  --text: #2d3748;
  --text-light: #718096;
  --bg: #f8fbf9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: #ffffff;
  box-shadow: 2px 0 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar.collapsed { width: 70px; }

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo i { font-size: 30px; }
.logo img { max-height: 36px; width: auto; vertical-align: middle; }

.logo span,
.sidebar.collapsed .nav-text {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-menu { padding: 20px 0; }

.nav-item {
  margin: 6px 15px;
  border-radius: 12px;
  overflow: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 12px;
  position: relative;
}

.nav-link i { font-size: 20px; width: 36px; text-align: center; }

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-link.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 5px;
  background: var(--primary-dark);
}

/* Dropdown Styles */
.nav-item.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.dropdown-icon {
  font-size: 12px;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.nav-item.dropdown.active .dropdown-icon {
  transform: rotate(180deg);
}

.nav-item.dropdown.active #usersDropdown .dropdown-icon {
  transform: rotate(180deg);
}

.nav-item.dropdown.active #settingsDropdown .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: static;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  margin-top: 4px;
  z-index: 1000;
  min-width: 200px;
  margin-left: 20px;
  margin-right: 10px;
}

.dropdown-menu.show {
  display: block;
  animation: dropdownFadeIn 0.3s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 4px 8px;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.dropdown-item.active {
  background: var(--primary);
  color: white;
}

.dropdown-item i {
  font-size: 16px;
  width: 24px;
  text-align: center;
  margin-right: 12px;
}

/* Sidebar collapsed state for dropdowns */
.sidebar.collapsed .dropdown-menu {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 8px;
  margin-top: 0;
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .nav-item.dropdown {
  position: relative;
}

/* Sidebar collapsed state for dropdown */
.sidebar.collapsed .dropdown-menu {
  position: fixed;
  left: 70px;
  top: auto;
  margin-top: 0;
  border-radius: 0 12px 12px 0;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  transition: all 0.3s ease;
  min-height: 100vh;
}

.main-content.expanded { margin-left: 70px; }

.header {
  height: var(--header-height);
  background: white;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 15px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 999;
}

.menu-toggle {
  font-size: 26px;
  cursor: pointer;
  color: var(--text);
  padding: 10px;
  border-radius: 10px;
  transition: all 0.3s;
}

.menu-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-name {
  font-weight: 600;
  color: var(--text);
}

.user-email {
  font-size: 13px;
  color: var(--text-light);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 19px;
}

.dashboard-grid {
  padding: 40px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 30px;
}

.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.07);
  transition: all 0.3s ease;
  border: 1px solid rgba(4, 79, 39, 0.08);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(4, 79, 39, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.bg-primary { background: var(--primary); }
.bg-blue { background: #2b6cb0; }
.bg-purple { background: #6b46c1; }
.bg-orange { background: #dd6b20; }

.card-value {
  font-size: 38px;
  font-weight: 700;
  margin: 12px 0;
  color: var(--text);
}

.card-change {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.positive { color: #2f855a; }
.negative { color: #c53030; }

/* Responsive */
@media (max-width: 992px) {
  .dashboard-grid { padding: 30px 20px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .header { padding: 0 20px; }
}

/* Tables */
.page { padding: 30px; }
.page-title { font-size: 1.8rem; color: var(--primary); margin-bottom: 8px; }
.breadcrumb { color: var(--text-light); margin-bottom: 18px; }
.breadcrumb-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.filters { display:flex; align-items:center; gap:10px; }
.filters select { padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); }
.table-card { background:#fff; border-radius:12px; box-shadow:0 6px 18px rgba(0,0,0,0.08); overflow:hidden; border:1px solid var(--border); }
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; display:block; }
.table-scroll table { min-width: 960px; }
.table-card table { width:100%; border-collapse: collapse; }
.table-card thead { background:#f7f9fb; }
.table-card th, .table-card td { padding: 12px 14px; border-bottom: 1px solid #eee; text-align:left; }
.table-card th { font-weight:700; color:#333; }
.table-card tbody tr:hover { background:#fafafa; }
.status { padding:6px 10px; border-radius:16px; font-weight:600; font-size:.85rem; display:inline-block; }
.status.pending { background:#fff3cd; color:#856404; }
.status.active { background:#d1ecf1; color:#0c5460; }
.status.completed { background:#d4edda; color:#155724; }

/* Modal */
.btn { padding:8px 12px; border:none; border-radius:8px; cursor:pointer; font-weight:600; }
.btn-primary { background: var(--primary); color:#fff; }
.btn-secondary { background:#eee; color:#333; }
.btn-danger { background:#c53030; color:#fff; }

/* Enhanced Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 20px;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 24px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  padding: 8px 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.modal-close:hover {
  background: #e9ecef;
  color: #dc3545;
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  max-height: 60vh;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) #f1f1f1;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.modal-footer {
  padding: 24px 30px;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8f9fa;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
  color: #adb5bd;
}

/* Freelancer Modal Specific Styles */
.modal-body .form-group {
  margin-bottom: 20px;
}

.modal-body .form-group:last-child {
  margin-bottom: 0;
}

.modal-body .form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
  font-size: 0.9rem;
  display: block;
}

.modal-body .form-control {
  padding: 14px 16px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fff;
  width: 100%;
  font-family: inherit;
}

.modal-body .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(4, 79, 39, 0.15);
  transform: translateY(-1px);
}

.modal-body .form-control::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* Button enhancements */
.modal-footer .btn {
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  min-width: 100px;
}

.modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(4, 79, 39, 0.3);
}

.modal-footer .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(4, 79, 39, 0.4);
}

.modal-footer .btn-secondary {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px solid #e9ecef;
}

.modal-footer .btn-secondary:hover {
  background: #e9ecef;
  color: #495057;
  transform: translateY(-1px);
}

.form-control {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  background: #fff;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
  color: #adb5bd;
}

.form-row { display:grid; gap:6px; margin:8px 0; }
.form-row label { color:#444; font-size:14px; }
.form-row input, .form-row select { padding:8px 10px; border:1px solid var(--border); border-radius:8px; }

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin: 10px 0;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.toggle-label:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
  background-color: var(--primary);
}

.toggle-input:checked + .toggle-label:before {
  transform: translateX(26px);
}

/* 2FA Status Text */
#tfaStatusText {
  font-size: 16px;
  font-weight: 600;
  transition: color 0.3s ease;
  min-width: 60px;
  text-align: center;
}

#tfaStatusText.enabled {
  color: var(--primary) !important;
}

#tfaStatusText.disabled {
  color: #e53e3e !important;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.form-text {
  display: block;
  margin-top: 5px;
  font-size: 0.875rem;
  color: var(--text-light);
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.mt-3 {
  margin-top: 1rem;
}

.content {
  padding: 30px;
}

.card-header h3 {
  color: var(--primary);
  margin: 0;
  font-size: 1.5rem;
}

.card-body {
  padding: 20px 0;
}
