[x-cloak] { display: none !important; }

/* Sidebar */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: all 200ms;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item:hover { background-color: rgba(255,255,255,0.15); }
.sidebar-item.active {
  background-color: #fff;
  color: #4338ca;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #4f46e5;
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  transition: all 200ms;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}
.btn-primary:hover { background-color: #4338ca; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #fff;
  color: #374151;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  transition: all 200ms;
}
.btn-secondary:hover { background-color: #f9fafb; border-color: #d1d5db; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #ef4444;
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  transition: all 200ms;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}
.btn-danger:hover { background-color: #dc2626; }

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #10b981;
  color: #fff;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  transition: all 200ms;
}
.btn-success:hover { background-color: #059669; }

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  border-radius: 0.5rem;
}

/* Cards */
.card {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
  padding: 1.5rem;
}
.stat-card {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 200ms;
  cursor: default;
}
.stat-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  border-color: #e0e7ff;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
}
.table-wrap table { width: 100%; font-size: 0.875rem; line-height: 1.25rem; }
.table-wrap thead { position: sticky; top: 0; z-index: 10; }
.table-wrap th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  line-height: 1rem;
  background-color: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}
.table-wrap td {
  padding: 0.875rem 1rem;
  border-top: 1px solid #f3f4f6;
  vertical-align: middle;
}
.table-wrap tbody tr { transition: all 150ms; }
.table-wrap tbody tr:hover { background-color: rgba(238, 242, 255, 0.6); }
.table-wrap tbody tr:nth-child(even) { background-color: rgba(249, 250, 251, 0.5); }
.table-wrap tbody tr:nth-child(even):hover { background-color: rgba(238, 242, 255, 0.6); }
.table-wrap tbody tr:last-child td { border-bottom: none; }

/* Forms */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 200ms;
  background-color: #fff;
  outline: none;
}
.form-input:focus { border-color: #818cf8; box-shadow: 0 0 0 2px #e0e7ff; }
.form-input::placeholder { color: #9ca3af; }

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 200ms;
  background-color: #fff;
  outline: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 1.25rem;
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
}
.form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 2px #e0e7ff; }

.form-label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

/* Badges */
.badge {
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.badge-success { background-color: #d1fae5; color: #047857; }
.badge-warning { background-color: #fef3c7; color: #b45309; }
.badge-danger { background-color: #fee2e2; color: #b91c1c; }
.badge-primary { background-color: #dbeafe; color: #1d4ed8; }
.badge-info { background-color: #e0f2fe; color: #0369a1; }
.badge-gray { background-color: #f3f4f6; color: #6b7280; }

/* Toast */
.toast-enter {
  animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s forwards;
}
@keyframes slideIn {
  from { transform: translateX(100%) translateY(-50%); opacity: 0; }
  to { transform: translateX(0) translateY(-50%); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Skeleton */
.skeleton {
  background-color: #e5e7eb;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 40;
  transition: opacity 200ms;
}
.modal-content {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transition: all 200ms;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #e5e7eb; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background-color: #d1d5db; }
.sidebar-scroll::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.1); }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,0.2); }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }

/* Page transitions */
.page-enter {
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Icon picker */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.5rem;
}
.icon-picker div {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 200ms;
}
.icon-picker div:hover { border-color: #a5b4fc; color: #6366f1; }

/* Filter tab */
.filter-tab {
  padding: 0.375rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  transition: all 200ms;
  cursor: pointer;
}

/* Responsive table */
@media (max-width: 768px) {
  .table-wrap {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ===== DARK MODE ===== */
html.dark { background-color: #0f172a; }
html.dark body { background-color: #0f172a; }
.dark .bg-gray-50,
.dark .bg-gray-100 { background-color: #0f172a !important; }
.dark .card,
.dark .stat-card,
.dark .modal-box { background-color: #1e293b; border-color: #334155; }
.dark .stat-card:hover { border-color: #6366f1; }
.dark .text-gray-800 { color: #e2e8f0 !important; }
.dark .text-gray-700 { color: #cbd5e1 !important; }
.dark .text-gray-500 { color: #94a3b8 !important; }
.dark .text-gray-400 { color: #64748b !important; }
.dark .text-gray-300 { color: #475569 !important; }
.dark .table-wrap { border-color: #334155; }
.dark .table-wrap th { background-color: #0f172a; color: #64748b; border-bottom-color: #334155; }
.dark .table-wrap td { border-top-color: #1e293b; color: #cbd5e1; }
.dark .table-wrap tbody tr:nth-child(even) { background-color: rgba(30, 41, 59, 0.5); }
.dark .table-wrap tbody tr:hover { background-color: rgba(51, 65, 85, 0.6); }
.dark .table-wrap tbody tr:nth-child(even):hover { background-color: rgba(51, 65, 85, 0.6); }
.dark .form-input,
.dark .form-select { background-color: #1e293b; border-color: #475569; color: #e2e8f0; }
.dark .form-input:focus,
.dark .form-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.dark .form-label { color: #94a3b8; }
.dark .btn-secondary { background-color: #1e293b; border-color: #475569; color: #cbd5e1; }
.dark .btn-secondary:hover { background-color: #334155; border-color: #64748b; }
.dark .badge-success { background-color: rgba(4,120,87,0.2); color: #34d399; }
.dark .badge-warning { background-color: rgba(180,83,9,0.2); color: #fbbf24; }
.dark .badge-danger { background-color: rgba(185,28,28,0.2); color: #f87171; }
.dark .badge-primary { background-color: rgba(29,78,216,0.2); color: #60a5fa; }
.dark .badge-info { background-color: rgba(3,105,161,0.2); color: #38bdf8; }
.dark .badge-gray { background-color: rgba(107,114,128,0.2); color: #9ca3af; }
.dark .skeleton { background-color: #1e293b; }
.dark .filter-tab { color: #64748b; }
.dark .filter-tab.bg-white { background-color: #334155 !important; color: #e2e8f0 !important; }
.dark .border-gray-100 { border-color: #1e293b !important; }
.dark .border-gray-200 { border-color: #334155 !important; }
.dark .divide-gray-100 { border-color: #1e293b; }
.dark header.bg-white { background-color: #1e293b !important; border-color: #334155 !important; }
.dark .shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3); }
.dark .icon-picker div { border-color: #475569; }
.dark .icon-picker div:hover { border-color: #818cf8; color: #a5b4fc; }
.dark ::-webkit-scrollbar-thumb { background-color: #475569; }
.dark .bg-indigo-100 { background-color: rgba(99,102,241,0.15) !important; }
.dark .text-indigo-600 { color: #818cf8 !important; }
.dark .text-indigo-500 { color: #818cf8 !important; }
.dark .bg-emerald-100 { background-color: rgba(16,185,129,0.15) !important; }
.dark .text-emerald-600 { color: #34d399 !important; }
.dark .bg-amber-100 { background-color: rgba(245,158,11,0.15) !important; }
.dark .text-amber-600 { color: #fbbf24 !important; }
.dark .bg-rose-100 { background-color: rgba(244,63,94,0.15) !important; }
.dark .text-rose-600 { color: #fb7185 !important; }
.dark .bg-gray-50\/80 { background-color: #0f172a !important; }
.dark .bg-gray-50\/30 { background-color: rgba(15,23,42,0.5) !important; }
.dark .hover\:text-gray-700:hover { color: #cbd5e1 !important; }
.dark .hover\:text-gray-600:hover { color: #94a3b8 !important; }
.dark .text-indigo-200 { color: rgba(199,210,254,0.6) !important; }

