:root { 
  --primary: #2563eb; 
  --primary-dark: #1d4ed8;
  --bg: #f8fafc; 
  --text: #0f172a; 
  --muted: #64748b; 
  --card: #ffffff; 
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body { 
  margin: 0; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji'; 
  background: var(--bg); 
  color: var(--text); 
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 16px; }

.navbar { 
  background: var(--card); 
  border-bottom: 1px solid var(--border); 
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.brand { 
  font-weight: 700; 
  font-size: 1.25rem;
  color: var(--primary);
}

.nav-actions { display: flex; gap: 12px; align-items: center; }
.welcome { color: var(--muted); font-size: 0.875rem; }

.card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 24px; 
  margin-top: 16px; 
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

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

.card.auth { 
  max-width: 400px; 
  margin: 60px auto; 
  text-align: center;
}

.card.auth h1 {
  margin: 0 0 24px 0;
  color: var(--text);
  font-size: 1.875rem;
  font-weight: 600;
}

.form-group { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-bottom: 16px; 
  text-align: left;
}
.form-group-section { 
  display: flex; 
  flex-direction: row; 
  gap: 16px; 
  margin-bottom: 10px; 
  text-align: center;
}

label { 
  color: var(--text); 
  font-size: 14px; 
  font-weight: 500;
}

input { 
  padding: 12px 16px; 
  border: 2px solid var(--border); 
  border-radius: 8px; 
  font-size: 16px; 
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: 8px; 
  padding: 12px 20px; 
  border: 2px solid var(--border); 
  background: var(--card); 
  border-radius: 8px; 
  text-decoration: none; 
  color: var(--text); 
  cursor: pointer; 
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 100px;
}

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

.btn.primary { 
  background: var(--primary); 
  color: #fff; 
  border-color: var(--primary);
  width: 80%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
}

.btn.samall { 
  background: var(--primary); 
  color: #fff; 
  border-color: var(--primary);
  width: 10%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
}

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

.flash-list { list-style: none; padding: 0; margin: 16px 0 0; }
.flash { 
  padding: 12px 16px; 
  border-radius: 8px; 
  margin-bottom: 12px; 
  font-size: 14px; 
  font-weight: 500;
}
.flash.success { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.flash.error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.flash.info { background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }

.hint { 
  color: var(--muted); 
  font-size: 13px; 
  margin-top: 16px; 
  padding: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Login page specific styling */
body.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-logo p {
  color: rgba(255,255,255,0.8);
  margin: 8px 0 0 0;
  font-size: 1rem;
}

/* Sidebar Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 20px 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 12px 20px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-left-color: var(--primary);
}

.nav-item-icon {
  margin-right: 12px;
  width: 16px;
  text-align: center;
}

.main-content {
  flex: 1;
  margin-left: 250px;
  background: var(--bg);
}

.top-navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.content-area {
  padding: 24px;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

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

.stat-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1;
}

.stat-change {
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 8px;
}

.stat-change.positive {
  color: #059669;
}

.stat-change.negative {
  color: #dc2626;
}

.stat-change.neutral {
  color: var(--muted);
}

/* Chart Container */
.chart-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px 0;
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table tbody tr:hover {
  background: rgba(37, 99, 235, 0.02);
}

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

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge.bg-primary {
  background: var(--primary);
  color: white;
}

.badge.bg-danger {
  background: #dc2626;
  color: white;
}

.badge.bg-success {
  background: #059669;
  color: white;
}

.badge.bg-secondary {
  background: var(--muted);
  color: white;
}

/* Button Group Styles */
.btn-group {
  display: flex;
  gap: 4px;
}

.btn-group .btn {
  min-width: auto;
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-group-sm .btn {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.btn-outline-warning {
  color: #d97706;
  border-color: #d97706;
  background: transparent;
}

.btn-outline-warning:hover {
  background: #d97706;
  color: white;
}

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

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

.btn-outline-danger {
  color: #dc2626;
  border-color: #dc2626;
  background: transparent;
}

.btn-outline-danger:hover {
  background: #dc2626;
  color: white;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle::after {
  content: "▼";
  margin-left: 4px;
  font-size: 0.75rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  margin: 4px 0 0 0;
  list-style: none;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content {
  padding: 0;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Styles */
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--card);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card);
  cursor: pointer;
}

.form-text {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Utility Classes */
.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.text-center {
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  table th,
  table td {
    padding: 8px 12px;
  }
  
  .btn-group {
    flex-direction: column;
    gap: 2px;
  }
}

