/* admin.css - Admin Panel Styles
   Contents:
   1. Core & Layout
   2. Typography & Utilities
   3. Buttons & Actions
   4. Forms & Inputs
   5. Tables & Lists
   6. Cards & Containers
   7. Sidebar & Navigation
   8. Dashboard Widgets
   9. Modals & Overlays
   10. Accordions & Collapsibles
   11. Toasts & Notifications
   12. Authentication Pages
   13. Misc & Maintenance
*/

/* -------------------------------------------------------------------------- */
/*                            1. CORE & LAYOUT                                */
/* -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 25%);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden !important;
}

/* Shell */
.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}


/* -------------------------------------------------------------------------- */
/*                         2. TYPOGRAPHY & UTILITIES                          */
/* -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

/* Text Colors */
.text-success {
  color: var(--success);
}

.text-error,
.text-danger,
.text-danger-subtle {
  color: var(--error);
}

.text-muted {
  color: var(--text-muted);
}

.text-dim {
  color: var(--text-dim);
}

.text-primary {
  color: var(--primary);
}

.label-highlight {
  color: var(--primary) !important;
}

/* Font Weights & Styles */
.fw-500 {
  font-weight: 500;
}

.fw-600 {
  font-weight: 600;
}

.font-mono {
  font-family: monospace;
}

/* Text Sizes */
.text-sm {
  font-size: 0.85rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-09 {
  font-size: 0.9rem;
}

/* Alignment */
.text-right {
  text-align: right;
}

/* Text Truncate */
.text-truncate-200 {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flexbox Helpers */
.d-flex,
.flex-center-gap {
  display: flex;
}

.d-inline,
.inline-form,
.form-inline {
  display: inline;
}

.d-none {
  display: none !important;
}

.flex-column {
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.flex-center-gap {
  align-items: center;
  gap: 8px;
}

.flex-justify-center {
  display: flex;
  justify-content: center;
}

.align-items-end {
  align-items: flex-end;
}

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

.flex-between-center,
.justify-content-between,
.justify-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Spacing Helpers (Margins) */
.m-0 {
  margin: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

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

.mb-15 {
  margin-bottom: 15px !important;
}

.mb-24 {
  margin-bottom: 24px;
}

.mt-2 {
  margin-top: 0.5rem;
}

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

.mt-5 {
  margin-top: 5px !important;
}

.mt-15 {
  margin-top: 15px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-30 {
  margin-top: 30px !important;
}

.mr-6 {
  margin-right: 6px;
}

.mr-10 {
  margin-right: 10px;
}

.ml-10 {
  margin-left: 10px;
}

/* Spacing Helpers (Gaps & Padding) */
.gap-2 {
  gap: 0.75rem;
}

.gap-8 {
  gap: 8px;
}

.gap-10 {
  gap: 10px;
}

.p-badge {
  padding: 4px 8px;
}

.p-3 {
  padding: 1rem;
}

/* Sizing */
.w-auto {
  width: auto !important;
}

.w-50 {
  width: 50px;
}

.w-150 {
  width: 150px;
}

.min-h-100 {
  min-height: 100px !important;
}

/* Dividers */
.admin-hr {
  border: 0;
  border-top: 1px solid var(--glass-border);
  margin: 30px 0;
}

.admin-separator {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--glass-border);
}

.admin-section-divider {
  margin: 20px 0 15px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 5px;
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 600;
}


/* -------------------------------------------------------------------------- */
/*                          3. BUTTONS & ACTIONS                              */
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  margin-top: 5px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  gap: 0.5rem;
}

.btn:active {
  transform: translateY(1px);
}

/* Sizes */
.btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
}

/* Variants */
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  margin-bottom: 5px;
  border-color: var(--glass-border);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-cancel {
  margin-left: 10px;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

/* Icon Buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  transition: all 0.2s;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-icon-danger {
  color: var(--error);
  cursor: pointer;
}

.btn-icon-danger:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--error);
}

/* File Upload Button wrapper */
.btn-file-upload {
  width: 100%;
  display: block;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

/* Action Links */
.btn-edit {
  color: var(--primary);
  display: inline-block;
  margin-right: 5px;
}

.btn-delete {
  color: var(--error);
  background: none;
  border: none;
  cursor: pointer;
}

/* Status Badges */
.badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}

.badge-success,
.bg-success,
.admin-status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning,
.bg-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger,
.badge-danger-subtle,
.text-error,
.bg-error,
.admin-status-disabled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-muted,
.bg-secondary {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

.flag-sm {
  border-radius: 2px;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  border: none;
}


/* -------------------------------------------------------------------------- */
/*                           4. FORMS & INPUTS                                */
/* -------------------------------------------------------------------------- */

.admin-form-group {
  margin-bottom: 1.25rem;
}

.admin-form-group label,
.settings-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea,
.settings-input,
.settings-textarea,
.settings-select,
.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
  width: 100%;
  padding: 10px 14px;
  margin-top: 5px;
  font-size: 0.9rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.settings-input:focus,
.settings-textarea:focus,
.settings-select:focus,
.admin-form-group input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.admin-form-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.admin-form-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
}

/* Checkboxes */
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}

.admin-checkbox-input,
.file-input-hidden {
  display: none;
}

.admin-checkbox-custom {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: transparent;
  font-size: 0.8rem;
}

.admin-checkbox-label:hover .admin-checkbox-custom {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.admin-checkbox-input:checked+.admin-checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

.admin-checkbox-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.admin-checkbox-input:checked~.admin-checkbox-text {
  color: var(--text-main);
}

/* Switches / Toggles */
.admin-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 16px;
  transition: all 0.3s;
  user-select: none;
  width: 100%;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.admin-switch .slider {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 34px;
  transition: all 0.4s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.admin-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #cbd5e1;
  border-radius: 50%;
  transition: all 0.4s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.admin-switch input:checked+.slider {
  background-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.admin-switch input:checked+.slider:before {
  transform: translateX(22px);
  background-color: #ffffff;
}

.admin-switch .label-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.admin-switch input:checked~.label-text {
  color: var(--text-main);
}


/* -------------------------------------------------------------------------- */
/*                           5. TABLES & LISTS                                */
/* -------------------------------------------------------------------------- */

.admin-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table th:last-child,
.admin-table td:last-child {
  text-align: center;
  width: 1%;
  white-space: nowrap;
}

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

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-link {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

/* Column Utilities */
.col-width-50 {
  width: 50px;
}

.col-width-140 {
  width: 140px;
}

.col-width-150 {
  width: 150px;
}

.col-actions,
.th-actions,
.td-actions {
  width: 120px;
  text-align: right;
}

.th-code {
  width: 60px;
}

.feedback-table th:first-child {
  width: 50px;
}

/* -------------------------------------------------------------------------- */
/*                           12. BLOG EDITOR                                  */
/* -------------------------------------------------------------------------- */

/* Source Editor Styles */
#source-editor {
  display: none;
  width: 100%;
  height: 500px;
  background: #1e1e2e;
  color: #a6accd;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  padding: 15px;
  border: 1px solid var(--glass-border);
  border-top: none;
  resize: none;
  line-height: 1.5;
}

.ql-toolbar .ql-source {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.ql-toolbar .ql-source:hover {
  color: var(--primary);
}

/* Admin Item List (Card-based alternative) */
.admin-item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-item,
.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.admin-list-item {
  padding: 12px 15px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-item:hover,
.admin-list-item:hover {
  transform: translateX(4px);
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(255, 255, 255, 0.04);
}

.admin-item-info,
.admin-list-item .item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-list-item .item-info {
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.admin-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 15px;
  align-items: center;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-list-item .item-code {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--primary);
  font-size: 0.9rem;
}

.admin-item.empty {
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
  transform: none !important;
  background: transparent;
  border: 1px dashed var(--glass-border);
}


/* -------------------------------------------------------------------------- */
/*                         6. CARDS & CONTAINERS                              */
/* -------------------------------------------------------------------------- */

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}

.admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0.5;
}

.admin-card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.admin-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.admin-title,
.custom-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-sub-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}

/* Grids */

.admin-grid-1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px));
  gap: 1.5rem;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.admin-grid-3,
.repeater-item-row.admin-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  align-items: center;
}

.admin-grid-4 {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 24px;
}

@media (min-width: 1024px) {
  .admin-grid-4 {
    grid-template-columns: 2fr 1fr !important;
    align-items: start;
  }
}

.admin-grid-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.admin-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.admin-grid-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.admin-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.col-span-2 {
  grid-column: span 2;
}

.admin-card-compact {
  max-width: 600px;
}

@media (max-width: 900px) {

  .admin-grid-split,
  .admin-grid-half,
  .admin-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.admin-disabled-section {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(1);
  position: relative;
  user-select: none;
}


/* -------------------------------------------------------------------------- */
/*                        7. SIDEBAR & NAVIGATION                             */
/* -------------------------------------------------------------------------- */

.admin-sidebar {
  width: 230px;
  background: rgba(15, 23, 42, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--glass-border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.admin-sidebar.sidebar-loading {
  visibility: hidden;
}

.admin-sidebar-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.admin-sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, white, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Minimal Sidebar (Glass Theme) */
.admin-nav-section-label {
  padding: 1.25rem 1rem 0.5rem 0.75rem;
  /* Compact spacing */
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  pointer-events: none;
  opacity: 0.6;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  /* Clean, minimal padding */
  border-radius: 8px;
  /* Standard mild radius */
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.admin-nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.admin-nav-link:hover i {
  color: var(--text-main);
}

.admin-nav-link-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
  /* Glassy gradient */
  color: var(--primary);
  border-left: 3px solid var(--primary);
  /* Minimal left indicator */
  border-radius: 4px 8px 8px 4px;
  /* Slight adjustment for left border */
  box-shadow: none;
}

.admin-nav-link-active i {
  color: var(--primary);
}

.nav-notification-badge {
  background-color: #ef4444;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

/* Sidebar Dropdowns */
.admin-nav-item {
  position: relative;
}

.admin-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 1rem;
  opacity: 0.8;
}

.admin-nav-item.is-open .admin-submenu {
  max-height: 500px;
  /* Arbitrary large height */
}

.submenu-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.admin-nav-item.is-open .submenu-arrow {
  transform: rotate(180deg);
}

/* Hide sidebar until JS restores state (prevents blinking) */
.admin-sidebar.sidebar-loading {
  opacity: 0;
  visibility: hidden;
}

/* Optional: smooth show */
.admin-sidebar {
  transition: opacity .12s ease;
}

/* Disable transitions while restoring (avoid flash/jump animation) */

.admin-sidebar.sidebar-loading {
  opacity: 0;
  visibility: hidden;
}

.admin-sidebar.no-transition,
.admin-sidebar.no-transition * {
  transition: none !important;

}

/* Mobile Sidebar */
.admin-mobile-topbar {
  display: none;
  background: var(--bg-panel);
  padding: 1rem;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.admin-mobile-toggle {
  order: -1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.25rem;
  cursor: pointer;
}

.admin-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.admin-sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 50;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .admin-sidebar.is-open {
    left: 0;
  }

  .admin-mobile-topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}


/* -------------------------------------------------------------------------- */
/*                         8. DASHBOARD WIDGETS                               */
/* -------------------------------------------------------------------------- */

.admin-dashboard-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.admin-metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.admin-metric-card,
.admin-stat-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.admin-stat-card {
  background: var(--bg-card);
  padding: 24px;
}

.admin-metric-label,
.admin-stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.admin-metric-value,
.admin-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.admin-metric-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-metric-foot i {
  margin-right: 4px;
  color: #10b981;
}

.admin-stat-diff {
  font-size: 0.85rem;
  color: var(--success);
  margin-top: 4px;
}

.admin-stat-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-stat-card-input {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 10px;
  height: auto;
  background: rgba(0, 0, 0, 0.2);
  border-color: transparent;
}

.admin-stat-card-input:focus {
  background: rgba(0, 0, 0, 0.4);
}

.admin-chart-container,
.admin-chart-pie {
  height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* -------------------------------------------------------------------------- */
/*                            9. MODALS & OVERLAYS                            */
/* -------------------------------------------------------------------------- */

.admin-modal-backdrop,
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-modal-backdrop.show,
.custom-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.admin-modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: auto;
  max-width: 600px;
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.msg-modal {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(10px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  display: flex;
  flex-direction: column;
}

.custom-modal {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
}

.admin-modal-backdrop.show .admin-modal,
.custom-modal-overlay.is-visible .custom-modal {
  transform: scale(1) translateY(0);
}

.admin-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.admin-modal-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.admin-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  transition: color 0.2s;
}

.admin-modal-close:hover {
  color: var(--text-main);
}

.admin-modal-icon {
  width: 60px;
  height: 60px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem auto;
}

.admin-modal-title,
.custom-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.admin-modal-text,
.custom-modal-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.admin-modal-actions,
.custom-modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.custom-modal-actions {
  justify-content: flex-end;
}

.admin-modal-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  font-weight: 500;
  cursor: pointer;
}

.admin-modal-btn-confirm {
  background: #ef4444;
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.admin-modal-btn-confirm:hover {
  background: #dc2626;
}

.admin-modal-btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.admin-modal-btn-primary:hover {
  background: #4338ca;
}

.admin-modal-icon.primary {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}


/* -------------------------------------------------------------------------- */
/*                       10. ACCORDIONS & COLLAPSIBLES                        */
/* -------------------------------------------------------------------------- */

.admin-accordion,
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.accordion-item.is-open,
.admin-accordion.is-open {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.accordion-header {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.accordion-title {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-icon {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.accordion-item.is-open .accordion-icon,
.admin-accordion.is-open .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.1);
}

.accordion-item.is-open .accordion-body,
.admin-accordion.is-open .accordion-body {
  max-height: 3000px;
  border-top: 1px solid var(--glass-border);
}

.accordion-inner {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Repeater Items */
.repeater-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.repeater-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-remove {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ Lists */
.faq-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  cursor: pointer;
}

.faq-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.faq-body {
  padding: 10px;
  border-top: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.faq-item-wrapper.collapsed-item .faq-body {
  display: none;
}

.btn-card-toggle {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-card-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.collapsible-card.collapsed .btn-card-toggle {
  transform: rotate(180deg);
}

.collapsible-card.collapsed .card-content {
  display: none;
}


/* -------------------------------------------------------------------------- */
/*                         11. TOASTS & NOTIFICATIONS                         */
/* -------------------------------------------------------------------------- */

.flash-message,
.toast-container {
  display: none !important;
}

#admin-notification-area {
  all: initial;
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 2147483647 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  pointer-events: none !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

#admin-notification-area * {
  box-sizing: border-box;
}

.admin-toast {
  pointer-events: auto;
  position: relative;
  background: #fff;
  color: #334155;
  padding: 16px 16px 16px 24px;
  border-radius: 8px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f1f5f9;
}

.admin-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.admin-toast-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}

.admin-toast-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 2px;
}

.admin-toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.3;
}

.admin-toast-message {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.admin-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  margin-top: -4px;
  transition: color 0.2s;
}

.admin-toast-close:hover {
  color: #64748b;
}

.admin-toast-success .admin-toast-strip,
.admin-toast-success .admin-toast-icon-box {
  background-color: #22c55e;
  color: #fff;
}

.admin-toast-error .admin-toast-strip,
.admin-toast-error .admin-toast-icon-box {
  background-color: #ef4444;
  color: #fff;
}

.admin-toast-info .admin-toast-strip,
.admin-toast-info .admin-toast-icon-box {
  background-color: #3b82f6;
  color: #fff;
}


/* -------------------------------------------------------------------------- */
/*                         12. AUTHENTICATION PAGES                           */
/* -------------------------------------------------------------------------- */

.admin-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-blob {
  position: absolute;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.4;
  animation: float 20s infinite alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: #4f46e5;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: #a855f7;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 40%;
  width: 300px;
  height: 300px;
  background: #06b6d4;
  border-radius: 50%;
  opacity: 0.2;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    transform: translate(50px, 50px) rotate(10deg);
  }
}

.admin-auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: var(--auth-glass, rgba(15, 23, 42, 0.6));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.admin-auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.auth-brand-icon {
  width: auto;
  height: auto;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin-bottom: 50px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-form-group {
  margin-bottom: 20px;
  text-align: left;
}

.auth-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
}

.auth-input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4);
}

.auth-alert {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-footer-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-footer-link:hover {
  color: var(--text-main);
}

.cf-turnstile {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}


/* -------------------------------------------------------------------------- */
/*                        13. MISC & MAINTENANCE                              */
/* -------------------------------------------------------------------------- */

.img-preview-box {
  width: 100%;
  height: 120px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px dashed var(--glass-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
  transition: all 0.2s;
}

.img-preview-box:hover {
  border-color: var(--primary);
  background: rgba(2, 6, 23, 0.8);
}

.img-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 10px;
}

.img-preview-box.light-bg {
  background: #f8fafc;
}

.img-user {
  width: 24px;
  display: block;
}

.placeholder-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.preview-favicon-img,
.preview-favicon {
  height: 32px;
  width: 32px;
  object-fit: contain;
}

/* Maintenance Page */
.maintenance-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

.maintenance-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  transition: background 0.5s ease;
}

.maintenance-glow.active {
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
}

.maintenance-icon-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
  position: relative;
  z-index: 2;
  transition: all 0.5s ease;
}

.maintenance-icon-ring.active {
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.2);
}

.maintenance-icon-ring i {
  font-size: 2.5rem;
  color: var(--success);
  transition: color 0.5s ease;
}

.maintenance-icon-ring.active i {
  color: var(--warning);
}

.maintenance-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  position: relative;
  z-index: 2;
}

.maintenance-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
}

.maintenance-card-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

/* Inline Edit Toggles */
.admin-table tr:not(.is-editing) .edit-mode {
  display: none !important;
}

.admin-table tr.is-editing .view-mode {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/*                           8. PLANS GRID UI                                 */
/* -------------------------------------------------------------------------- */

.admin-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.plan-card.is-disabled {
  opacity: 0.7;
  filter: grayscale(0.8);
}

.plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.plan-slug {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.plan-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.plan-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.plan-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.plan-stat-item {
  display: flex;
  flex-direction: column;
}

.plan-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.plan-stat-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: monospace;
}

.plan-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.plan-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.plan-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.plan-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}


/* -------------------------------------------------------------------------- */
/*                         14. API & PAYMENT SETTINGS                         */
/* -------------------------------------------------------------------------- */

.section-live {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.section-sandbox {
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.section-live h4,
.section-sandbox h4 {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.section-live h4 {
  color: #10b981;
}

.section-sandbox h4 {
  color: #fbbf24;
}

.section-live input {
  border-color: rgba(16, 185, 129, 0.3);
}

.section-sandbox input {
  border-color: rgba(245, 158, 11, 0.3);
}

.section-live input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.section-sandbox input:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* -------------------------------------------------------------------------- */
/*                            FILE UPLOAD UI                                  */
/* -------------------------------------------------------------------------- */
.admin-file-upload {
  position: relative;
  width: 100%;
  min-height: 200px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.admin-file-upload:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.file-preview {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.upload-content {
  z-index: 2;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

.upload-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-file-upload.has-file:hover .upload-controls,
.admin-file-upload.has-file .upload-controls {
  opacity: 1;
}

.file-input-hidden {
  opacity: 0;
  position: absolute;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Custom Color Inputs for Home Editor */
.admin-input-color-box {
  height: 38px;
  width: 60px;
  padding: 0;
}

.admin-input-color-text {
  max-width: 90px;
}

/* Custom Select Wrapper for API Page */
.admin-select-wrapper {
  position: relative;
}

.admin-select-icon {
  position: absolute;
  left: 14px;
  top: 14px;
  color: var(--text-muted);
}

.admin-select-padded {
  padding-left: 40px;
}

/* Custom Widths */
.w-30p {
  width: 30%;
}

.mw-100 {
  max-width: 100px;
}