/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
  background: #f5f5f5; 
  color: #1a1a2e; 
  font-size: 14px;
  line-height: 1.5;
}

/* ===== LAYOUT ===== */
.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #ff6b35;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-logo i { font-size: 24px; }

.sidebar-section {
  padding: 15px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-menu { list-style: none; padding: 10px 12px; flex: 1; }

.sidebar-menu li { margin-bottom: 4px; }

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #555;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-menu a:hover { background: #f8f8f8; color: #333; }

.sidebar-menu a.active {
  background: #ff6b35;
  color: #fff;
}

.sidebar-menu a i { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 15px;
  border-top: 1px solid #f0f0f0;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  border-radius: 8px;
}

.sidebar-footer a:hover { background: #f5f5f5; }


/* ===== MAIN CONTENT ===== */
.main { margin-left: 240px; flex: 1; min-height: 100vh; }

/* ===== HEADER ===== */
.header {
  background: #fff;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 15px; }

.header-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #eee;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  cursor: pointer;
  text-decoration: none;
}

.header-back:hover { background: #f5f5f5; }

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}

.header-title i {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ff6b35, #ff8c5a);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f5f5f5;
  border-radius: 10px;
  border: 1px solid #eee;
  min-width: 250px;
}

.header-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  width: 100%;
}

.header-search i { color: #999; }

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #eee;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  cursor: pointer;
}

.header-btn:hover { background: #f5f5f5; }

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: #f8f8f8;
  border-radius: 25px;
}

.header-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.header-user-info { font-size: 13px; }
.header-user-name { font-weight: 600; color: #333; }
.header-user-balance { color: #16a34a; font-weight: 500; }

/* ===== CONTENT ===== */
.content { padding: 25px 30px; }

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #eee;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 15px;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-card-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-card-icon.orange { background: #fff3e0; color: #f57c00; }
.stat-card-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-card-icon.purple { background: #f3e5f5; color: #7b1fa2; }
.stat-card-icon.red { background: #ffebee; color: #d32f2f; }
.stat-card-icon.cyan { background: #e0f7fa; color: #0097a7; }

.stat-card-action {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
}

.stat-card-action:hover { background: #f5f5f5; }

.stat-card-title { font-size: 13px; color: #888; margin-bottom: 5px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.stat-card-sub { font-size: 12px; color: #999; margin-top: 10px; }


/* ===== CARDS & PANELS ===== */
.card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  overflow: hidden;
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-actions { display: flex; gap: 8px; }

.card-body { padding: 20px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: #ff6b35;
  color: #fff;
}
.btn-primary:hover { background: #e55a2b; }

.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
  background: #fff;
  border: 1px solid #ddd;
  color: #555;
}
.btn-outline:hover { background: #f5f5f5; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
}

.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-add {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font-size: 20px;
}
.btn-add:hover { background: #15803d; }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

table td {
  padding: 16px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

table tr:hover { background: #fafafa; }

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

/* ===== BADGES & STATUS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #e0f2fe; color: #0284c7; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control::placeholder { color: #aaa; }

select.form-control {
  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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}


/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-lg { max-width: 900px; }

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

.modal-title { font-size: 18px; font-weight: 600; }

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 18px;
  color: #666;
}

.modal-close:hover { background: #eee; }

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: 12px;
  background: #333;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state p { font-size: 16px; }

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #999;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #eee;
  border-top-color: #ff6b35;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PROGRESS BAR ===== */
.progress {
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 10px;
  transition: width 0.3s;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.pagination button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #eee;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.pagination button:hover { background: #f5f5f5; }
.pagination button.active { background: #ff6b35; color: #fff; border-color: #ff6b35; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== CHECKBOX ===== */
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox input { display: none; }

.checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checkbox input:checked + .checkbox-box {
  background: #ff6b35;
  border-color: #ff6b35;
  color: #fff;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  background: #f5f5f5;
  border-radius: 12px;
  width: fit-content;
}

.tab {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover { color: #333; }
.tab.active { background: #fff; color: #ff6b35; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ===== UTILITIES ===== */
.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }
.text-warning { color: #d97706; }
.text-muted { color: #999; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
