/* ==================================================
   Professional Business Theme
   Main Color: Blue (#007bff)
   Light Background: #f8f9fa
   ================================================== */

/* ==================================================
   CSS Variables
   ================================================== */
:root {
  /* Primary Colors */
  --primary: #0056b3;
  --primary-light: #4a90e2;
  --primary-dark: #003d82;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Accent Colors */
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  
  /* Neutral Colors */
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Shadows */
  --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
  --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
  --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
  --shadow-card: 0 0 20px rgba(0,86,179,0.1);
  
  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* ==================================================
   Mobile Sidebar Toggle
   ================================================== */
.mobile-sidebar-toggle {
  display: none !important; /* Hidden by default, shown by pages with sidebars */
}

/* ==================================================
   Base Styles
   ================================================== */
html {
  position: relative;
  min-height: 100%;
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
}

/* ==================================================
   Typography
   ================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.display-1, .display-2, .display-3, .display-4 {
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-primary {
  color: var(--primary) !important;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

/* ==================================================
   Buttons
   ================================================== */
.btn {
  font-weight: 500;
  border-radius: 0.375rem;
  padding: 0.5rem 1.25rem;
  transition: var(--transition);
  border: none;
  box-shadow: var(--shadow-sm);
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
  border: none;
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #004494 0%, #003875 100%);
  border: none;
}

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

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

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.btn-info {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

/* Button Groups */
.btn-group .btn {
  box-shadow: none;
}

.btn-group {
  box-shadow: var(--shadow-sm);
}

/* ==================================================
   Cards
   ================================================== */
.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.card-header {
  font-weight: 600;
  border-bottom: 2px solid var(--gray-200);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.card-header.bg-primary {
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%) !important;
  border: none;
}

.card-title {
  color: var(--primary);
  font-weight: 600;
}

/* ==================================================
   Forms
   ================================================== */
.form-control, .form-select {
  border: 2px solid var(--gray-300);
  border-radius: 0.375rem;
  padding: 0.625rem 0.875rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

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

.form-switch .form-check-input:checked {
  background-color: var(--primary);
}

.input-group-text {
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
  font-weight: 600;
  color: var(--primary);
}

/* ==================================================
   Tables
   ================================================== */
.table {
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--primary);
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  padding: 1rem;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 86, 179, 0.05);
}

.table td {
  padding: 0.875rem;
  vertical-align: middle;
}

/* ==================================================
   Navigation
   ================================================== */
.navbar {
  background: white !important;
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  transition: var(--transition);
}

.navbar-nav .nav-link:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.navbar-nav .nav-link.active {
  background: var(--primary);
  color: white;
}

/* Breadcrumb */
.breadcrumb {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* Tabs */
.nav-tabs {
  border-bottom: 2px solid var(--gray-200);
}

.nav-tabs .nav-link {
  color: var(--gray-600);
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.25rem;
  transition: var(--transition);
}

.nav-tabs .nav-link:hover {
  color: var(--primary);
  border-bottom-color: var(--gray-300);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  background: none;
  border: none;
  border-bottom: 3px solid var(--primary);
}

/* Pills */
.nav-pills .nav-link {
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 2rem;
  transition: var(--transition);
}

.nav-pills .nav-link:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
}

/* ==================================================
   Badges
   ================================================== */
.badge {
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
}

.badge.rounded-pill {
  padding: 0.35rem 0.75rem;
}

.badge.bg-primary {
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%) !important;
}

.badge.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.badge.bg-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

/* ==================================================
   Alerts
   ================================================== */
.alert {
  border: none;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.alert-primary {
  background: linear-gradient(135deg, rgba(0, 86, 179, 0.1) 0%, rgba(0, 68, 148, 0.1) 100%);
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
}

.alert-success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
  color: #155724;
  border-left: 4px solid var(--success);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(253, 126, 20, 0.1) 100%);
  color: #856404;
  border-left: 4px solid var(--warning);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 35, 51, 0.1) 100%);
  color: #721c24;
  border-left: 4px solid var(--danger);
}

/* ==================================================
   Progress Bars
   ================================================== */
.progress {
  height: 1.25rem;
  border-radius: 0.5rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  background: var(--gray-200);
}

.progress-bar {
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar.bg-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* ==================================================
   Modals
   ================================================== */
.modal-content {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 2px solid var(--gray-200);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 0.75rem 0.75rem 0 0;
}

.modal-header.bg-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

.modal-title {
  font-weight: 600;
  color: var(--primary);
}

.modal-header.bg-danger .modal-title {
  color: white;
}

.modal-footer {
  border-top: 2px solid var(--gray-200);
  background: var(--gray-100);
  border-radius: 0 0 0.75rem 0.75rem;
}

/* ==================================================
   Lists
   ================================================== */
.list-group-item {
  border: none;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
  transition: var(--transition);
}

.list-group-item:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.list-group-item:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
  border-bottom: none;
}

.list-group-item:hover {
  background: var(--gray-100);
}

.list-group-item-action:hover {
  background: linear-gradient(135deg, rgba(0, 86, 179, 0.05) 0%, rgba(0, 68, 148, 0.05) 100%);
}

/* ==================================================
   Accordion
   ================================================== */
.accordion-button {
  font-weight: 600;
  color: var(--primary);
  background: var(--gray-100);
}

.accordion-button:not(.collapsed) {
  color: white;
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: var(--primary);
}

/* ==================================================
   Tooltips & Popovers
   ================================================== */
.tooltip {
  font-weight: 500;
}

.popover {
  border: none;
  box-shadow: var(--shadow-lg);
}

.popover-header {
  background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
  color: white;
  font-weight: 600;
  border: none;
}

/* ==================================================
   Spinners
   ================================================== */
.spinner-border, .spinner-grow {
  width: 2rem;
  height: 2rem;
}

.spinner-border-sm, .spinner-grow-sm {
  width: 1rem;
  height: 1rem;
}

/* ==================================================
   Footer
   ================================================== */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px;
  line-height: 60px;
  background: linear-gradient(135deg, #343a40 0%, #212529 100%);
  color: white;
}

/* ==================================================
   Utilities
   ================================================== */
.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow {
  box-shadow: var(--shadow) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

.border-0 {
  border: none !important;
}

.rounded {
  border-radius: 0.5rem !important;
}

.rounded-lg {
  border-radius: 0.75rem !important;
}

/* Hover Effects */
.hover-shadow:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
  transition: var(--transition);
}

/* Gradient Backgrounds */
.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-gradient-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%) !important;
}

.bg-gradient-info {
  background: linear-gradient(135deg, #00d2ff 0%, #3a47d5 100%) !important;
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ==================================================
   Responsive
   ================================================== */
@media (max-width: 768px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
}

/* ==================================================
   Container
   ================================================== */
.container {
  max-width: 1200px;
}

.container-fluid {
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ==================================================
   Scrollbar
   ================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 149, 237, 0.5);  /* 浅蓝色半透明 - Cornflower Blue */
  border-radius: 3px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 149, 237, 0.7);  /* 悬停时稍微深一点 */
}

/* ==================================================
   Page Header
   ================================================== */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-radius: 0 0 2rem 2rem;
}

.page-header h1 {
  color: white;
  font-weight: 700;
}

/* ==================================================
   Dashboard Stats
   ================================================== */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

/* ==================================================
   Bootstrap Icons
   ================================================== */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css");