/* SILVERTONE Platform Design System */

:root {
  --brand-primary: #2E3192;
  --brand-dark: #1F2478;
  --brand-gold: #00AEEF;
  --brand-gold-light: #5BCFF5;
  --brand-surface: #F5F7FA;
  --brand-text: #1F2937;
  --brand-muted: #6B7280;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary) transparent;
}

*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--brand-primary); border-radius: 3px; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-text);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: var(--brand-text);
  transition: all 0.2s;
}

.form-input::placeholder { color: rgba(107, 114, 128, 0.5); }

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(46, 49, 146, 0.15);
}

.form-error { margin-top: 0.25rem; font-size: 0.75rem; color: #dc2626; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(46, 49, 146, 0.08);
  text-decoration: none;
}

.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #fff;
  color: var(--brand-text);
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover { background: var(--brand-surface); border-color: #d1d5db; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary { background: rgba(46, 49, 146, 0.1); color: var(--brand-primary); }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #dc2626; }

.data-table { width: 100%; text-align: left; min-width: 36rem; }
.data-table thead { background: rgba(245, 247, 245, 0.5); }
.data-table th {
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-muted);
}
.data-table td { padding: 1rem 1.5rem; }

.dropzone {
  border: 2px dashed #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.dropzone:hover { border-color: rgba(46, 49, 146, 0.4); background: rgba(46, 49, 146, 0.05); }
.dropzone.dragover { border-color: var(--brand-primary); background: rgba(46, 49, 146, 0.1); }

.skeleton { animation: pulse 2s infinite; background: #e5e7eb; border-radius: 0.25rem; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast-enter { animation: slideInRight 0.3s ease-out; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media print {
  #sidebar, header, .no-print { display: none !important; }
  main { padding: 0 !important; }
}

/* Sidebar navigation groups */
.nav-group-toggle:focus-visible {
  outline: 2px solid rgba(46, 49, 146, 0.35);
  outline-offset: 2px;
}

.nav-submenu a {
  position: relative;
}

#admin-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

#admin-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(46, 49, 146, 0.15);
  border-radius: 4px;
}

/* Responsive admin tables */
.table-scroll,
.shadow-card.overflow-hidden:has(.data-table),
.bg-white.rounded-2xl.shadow-card.border.border-gray-50.overflow-hidden:has(.data-table) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Admin page headers & toolbars */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.admin-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(46, 49, 146, 0.06);
  box-shadow: 0 2px 16px rgba(31, 41, 55, 0.06);
}

@media (max-width: 639px) {
  .data-table th,
  .data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
  }

  form .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  form .flex.gap-3:has(.btn-primary) {
    flex-direction: column;
  }

  .admin-toolbar .btn-primary,
  .admin-toolbar .btn-secondary {
    width: auto;
  }

  #toast-container {
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: 1rem;
  }
}

/* Global responsive safeguards */
img,
video,
svg {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
}

@media (max-width: 639px) {
  .section-padding {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}
