/**
 * Admin Template — Custom Component CSS
 * Works alongside the Tailwind CDN (no build step needed)
 * For production: use the Tailwind CLI build instead (npm run build)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================
   BASE
============================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f1f5f9;
  color: #334155;
  margin: 0;
}

a { text-decoration: none; color: inherit; }

/* ============================
   BUTTONS
============================ */
.btn,
.btn-primary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border: none;
  user-select: none;
  white-space: nowrap;
}
.btn:hover,
.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover,
.btn-danger:hover,
.btn-secondary:hover,
.btn-outline:hover {
  transform: translateY(-1px);
}
.btn:active,
.btn-primary:active,
.btn-success:active,
.btn-warning:active,
.btn-danger:active,
.btn-secondary:active,
.btn-outline:active {
  transform: translateY(0) scale(0.97);
}
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-success:focus-visible,
.btn-warning:focus-visible,
.btn-danger:focus-visible,
.btn-secondary:focus-visible,
.btn-outline:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35), 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4), 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3); }

.btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3), 0 1px 2px rgba(22, 163, 74, 0.2);
}
.btn-success:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3), 0 1px 2px rgba(217, 119, 6, 0.2);
}
.btn-warning:hover {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3), 0 1px 2px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.btn-outline {
  background: transparent;
  color: #2563eb;
  border: 1.5px solid #2563eb;
}
.btn-outline:hover {
  background: #eff6ff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.75rem; border-radius: 0.55rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }

/* ============================
   CARDS
============================ */
.card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.card-sm {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ============================
   BADGES
============================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #cffafe; color: #0e7490; }
.badge-purple  { background: #ede9fe; color: #7c3aed; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ============================
   FORM CONTROLS
============================ */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  color: #334155;
  outline: none;
  transition: all 0.2s;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.form-input:disabled { background: #f8fafc; cursor: not-allowed; color: #94a3b8; }

.form-select {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.2em;
  font-family: inherit;
  font-size: 0.875rem;
  color: #334155;
  appearance: none;
  outline: none;
  transition: all 0.2s;
  cursor: pointer;
}
.form-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  color: #334155;
  outline: none;
  resize: vertical;
  transition: all 0.2s;
}
.form-textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

.form-checkbox {
  width: 1rem; height: 1rem;
  border-radius: 0.25rem;
  border: 1.5px solid #d1d5db;
  accent-color: #2563eb;
  cursor: pointer;
}
.form-radio {
  width: 1rem; height: 1rem;
  border: 1.5px solid #d1d5db;
  accent-color: #2563eb;
  cursor: pointer;
}
.form-group { margin-bottom: 1.25rem; }
.form-error { font-size: 0.75rem; color: #dc2626; margin-top: 0.25rem; }
.form-help  { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }

/* ============================
   SIDEBAR
============================ */
.sidebar-bg {
  background: linear-gradient(180deg, #1a2151 0%, #1b2572 100%);
}

.nav-section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
  color: rgba(148, 163, 184, 0.55);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: rgba(203, 213, 225, 0.85);
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 0.125rem;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.09); color: #ffffff; }
.nav-link.active { background: #2563eb; color: #ffffff; }

.submenu-arrow {
  margin-left: auto;
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: rgba(148, 163, 184, 0.5);
}
.nav-link.open .submenu-arrow { transform: rotate(90deg); }

.submenu-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-left: 2.25rem;
}
.submenu-panel.open { max-height: 600px; }

.submenu-panel a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.75);
  transition: all 0.2s;
  margin-bottom: 0.0625rem;
}
.submenu-panel a::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
}
.submenu-panel a:hover { color: #ffffff; background: rgba(255,255,255,0.07); }
.submenu-panel a.active { color: #93c5fd; }

/* Sidebar scrollbar */
#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 9999px; }

/* ============================
   AVATARS
============================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
}
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: 0.7rem; }
.avatar-md { width: 2.25rem; height: 2.25rem; font-size: 0.8rem; }
.avatar-lg { width: 3rem;    height: 3rem;    font-size: 1rem; }
.avatar-xl { width: 4rem;    height: 4rem;    font-size: 1.25rem; }

/* ============================
   DATA TABLE
============================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: #f8fafc; }
.data-table th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: #64748b;
}
.data-table tbody tr {
  border-bottom: 1px solid #f8fafc;
  transition: background 0.15s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(248,250,252,0.8); }

/* ============================
   ALERTS
============================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1.5px solid;
}
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ============================
   GRADIENT UTILITIES
============================ */
.banner-gradient {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #3b82f6 100%);
}
.visa-gradient {
  background: linear-gradient(135deg, #1abcfe 0%, #00c0ef 35%, #26c9a8 70%, #21d4fd 100%);
}

/* ============================
   SVG RING ANIMATION
============================ */
.ring-fill {
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   RESPONSIVE SIDEBAR
============================ */
.main-wrapper { transition: margin-left 0.3s; }

@media (max-width: 1023px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #sidebar.sidebar-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
}
