@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   AXEVIA PLATFORM — ENTERPRISE DESIGN SYSTEM
   Modern, Executive-Tier Design for Multitenant Platform Management
   ========================================================================== */

:root {
  /* Brand Palette */
  --brand-primary: #3b82f6;
  --brand-primary-hover: #2563eb;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
  --brand-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #4338ca 50%, #6d28d9 100%);
  --brand-gradient-glow: 0 8px 25px -4px rgba(79, 70, 229, 0.45);
  --brand-subtle: #eff6ff;

  /* Surfaces & Backgrounds */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-muted: #f1f5f9;
  --bg-surface-subtle: #f8fafc;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-inverse: #ffffff;

  /* Borders & Dividers */
  --border-subtle: #f1f5f9;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #3b82f6;

  /* Status Colors */
  --status-active-bg: #ecfdf5;
  --status-active-text: #065f46;
  --status-active-border: #a7f3d0;
  --status-active-dot: #10b981;

  --status-suspended-bg: #fffbeb;
  --status-suspended-text: #92400e;
  --status-suspended-border: #fde68a;
  --status-suspended-dot: #f59e0b;

  --status-disabled-bg: #fef2f2;
  --status-disabled-text: #991b1b;
  --status-disabled-border: #fecaca;
  --status-disabled-dot: #ef4444;

  --status-archived-bg: #f1f5f9;
  --status-archived-text: #475569;
  --status-archived-border: #e2e8f0;
  --status-archived-dot: #64748b;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 30px -8px rgba(15, 23, 42, 0.1), 0 8px 12px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.16);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Fonts */
  --font-arabic: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-latin: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */

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

html {
  font-family: var(--font-arabic);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.05), transparent 40%),
    var(--bg-app);
}

[hidden] {
  display: none !important;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 80px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100% - 1340px) / 2));
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03);
  transition: all var(--transition-normal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.brand:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.brand-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
}

.brand img {
  width: 52px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--border-strong);
  opacity: 0.6;
}

.brand-caption {
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
}

.brand-caption small {
  font-family: var(--font-latin);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 3px;
  text-transform: uppercase;
}

.account {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
}

.account-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}

.account-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.account-role {
  font-size: 11px;
  color: var(--text-muted);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--brand-gradient);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  flex-shrink: 0;
}

.header-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  box-shadow: var(--shadow-xs);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--status-active-dot);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   Main Layout & Shell
   ========================================================================== */

main {
  width: 100%;
  max-width: 1340px;
  margin: 32px auto;
  padding: 0 24px;
  flex: 1;
}

/* Flash Alerts */
.alert {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  animation: slide-down 0.3s ease-out;
}

.alert:not(.errors) {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-right: 5px solid #22c55e;
}

.alert.errors {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-right: 5px solid #ef4444;
  align-items: flex-start;
  flex-direction: column;
}

.alert.errors strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.alert.errors ul {
  margin: 8px 24px 0 0;
  font-size: 13px;
  font-weight: 500;
}

.alert.errors li {
  margin-top: 4px;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Cards, Badges & Interactive Elements
   ========================================================================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.toolbar-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.25;
}

h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.muted {
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

/* Buttons */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  background: var(--brand-gradient);
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all var(--transition-fast);
}

.button:hover, button:hover {
  background: var(--brand-gradient-hover);
  box-shadow: var(--brand-gradient-glow);
  transform: translateY(-1px);
  text-decoration: none;
}

.button:active, button:active {
  transform: translateY(0);
}

.button.secondary, button.secondary {
  background: #f1f5f9;
  color: var(--text-body);
  box-shadow: none;
  border: 1px solid var(--border-default);
}

.button.secondary:hover, button.secondary:hover {
  background: #e2e8f0;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.button.danger, button.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.button.danger:hover, button.danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   KPI Stats Grid (Dashboard Cards)
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat {
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.stat::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--brand-gradient);
  opacity: 0.85;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-muted);
  color: var(--brand-primary);
  font-size: 16px;
}

.stat strong {
  font-family: var(--font-latin);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -1px;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.filters {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filters .field {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.filters-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Inputs, Selects, Labels */
.field {
  margin-bottom: 24px;
  position: relative;
}

label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
}

input::placeholder, textarea::placeholder {
  color: var(--text-dim);
  font-size: 13px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: #ffffff;
}

input[aria-invalid=true] {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

input:disabled {
  background: var(--bg-surface-muted);
  color: var(--text-dim);
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 16px;
  padding-left: 38px;
  cursor: pointer;
}

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 24px;
}

/* ==========================================================================
   Table & Badges
   ========================================================================== */

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-header {
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-default);
  background: #ffffff;
}

.table-header .table-badge {
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  white-space: nowrap;
}

th, td {
  text-align: right;
  padding: 16px 24px;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-bottom: 1px solid var(--border-default);
  text-transform: uppercase;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: #f8fafc;
}

tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border-subtle);
}

/* Academy Identity Cell */
.academy-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.academy-logo, .academy-initial {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #ffffff;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast);
}

.academy-identity:hover .academy-logo,
.academy-identity:hover .academy-initial {
  transform: scale(1.05);
}

.academy-initial {
  display: grid;
  place-items: center;
  color: var(--academy-color, var(--brand-primary));
  font-size: 20px;
  font-weight: 800;
  background: color-mix(in srgb, var(--academy-color, var(--brand-primary)) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--academy-color, var(--brand-primary)) 30%, transparent);
}

.academy-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.academy-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.academy-code-badge {
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  letter-spacing: 0.5px;
  width: fit-content;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  border: 1px solid transparent;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.badge.ACTIVE {
  background: var(--status-active-bg);
  color: var(--status-active-text);
  border-color: var(--status-active-border);
}
.badge.ACTIVE .badge-dot {
  background: var(--status-active-dot);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.badge.SUSPENDED {
  background: var(--status-suspended-bg);
  color: var(--status-suspended-text);
  border-color: var(--status-suspended-border);
}
.badge.SUSPENDED .badge-dot {
  background: var(--status-suspended-dot);
}

.badge.DISABLED {
  background: var(--status-disabled-bg);
  color: var(--status-disabled-text);
  border-color: var(--status-disabled-border);
}
.badge.DISABLED .badge-dot {
  background: var(--status-disabled-dot);
}

.badge.ARCHIVED {
  background: var(--status-archived-bg);
  color: var(--status-archived-text);
  border-color: var(--status-archived-border);
}
.badge.ARCHIVED .badge-dot {
  background: var(--status-archived-dot);
}

/* Readiness Badges */
.readiness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-body);
  border: 1px solid var(--border-default);
}

.readiness-badge.READY {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.readiness-badge.PENDING,
.readiness-badge.CREATING_DATABASE,
.readiness-badge.RUNNING_MIGRATIONS,
.readiness-badge.RUNNING_SEEDERS {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.readiness-badge.FAILED {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Actions in Table */
.table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: var(--brand-primary);
  transition: all var(--transition-fast);
}

.action-link:hover {
  background: var(--brand-primary);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Status Change Popover Details */
details.status-dropdown {
  position: relative;
  display: inline-block;
}

details.status-dropdown summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-default);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

details.status-dropdown summary::-webkit-details-marker {
  display: none;
}

details.status-dropdown summary:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

details.status-dropdown[open] summary {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.status-form {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 20px;
  white-space: normal;
  animation: slide-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-form label {
  font-size: 12.5px;
  margin-bottom: 6px;
}

.status-form select,
.status-form input {
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 13px;
}

.status-form .danger-warning {
  font-size: 11.5px;
  color: #b91c1c;
  background: #fef2f2;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
  line-height: 1.5;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty State */
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--text-dim);
  opacity: 0.6;
}

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-text {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-default);
  background: #ffffff;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-body);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.pagination span {
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 14px;
  background: var(--bg-surface-muted);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Academy Form & Live Preview
   ========================================================================== */

.form-card {
  max-width: 900px;
  margin: 0 auto;
}

.form-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 28px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title:first-child {
  margin-top: 0;
}

/* Academy Live Preview Box */
.academy-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid var(--border-default);
  border-right: 6px solid var(--academy-color, var(--brand-primary));
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.academy-preview .academy-logo,
.academy-preview .academy-initial {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  font-size: 28px;
}

.academy-preview strong {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.academy-preview small {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Color Picker & Presets */
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 6px 14px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
}

.color-picker input[type=color] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.color-picker input[type=color]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker input[type=color]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
}

.color-picker output {
  font-family: var(--font-latin);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

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

.color-preset-dot {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border-default);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.color-preset-dot:hover {
  transform: scale(1.2);
}

/* File Upload & Checkboxes */
.file-upload-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  background: #f8fafc;
  text-align: center;
  transition: border-color var(--transition-fast);
}

.file-upload-box:hover {
  border-color: var(--brand-primary);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
}

.checkbox-label input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: #dc2626;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-default);
}

/* ==========================================================================
   Login Page (Executive Enterprise SaaS Redesign)
   ========================================================================== */

.login-page {
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
    #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-page main {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1180px;
  margin: auto;
  padding: 40px 24px;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  width: 100%;
  min-height: 640px;
  border-radius: var(--radius-xl);
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Login Story (Right side in Arabic) */
.login-story {
  direction: rtl;
  background: 
    linear-gradient(145deg, #090e1a 0%, #0f172a 60%, #1e1b4b 100%);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.login-story::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.35) 0%, transparent 70%);
  filter: blur(40px);
}

.login-story::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 260px;
  height: 260px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
  filter: blur(40px);
}

.story-header {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-latin);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.login-story h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.login-story h1 span {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-story p {
  color: #94a3b8;
  font-size: 14.5px;
  line-height: 1.8;
  max-width: 440px;
}

.story-features {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 32px 0;
}

.story-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.story-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  font-size: 14px;
}

.story-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  color: #64748b;
  font-size: 11px;
}

.story-bottom span:first-child {
  color: #94a3b8;
  font-weight: 600;
}

.brand-art {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.brand-art img {
  max-width: 220px;
  height: auto;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
}

/* Login Panel (Left side in Arabic) */
.login-panel {
  direction: rtl;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.login-heading {
  margin-bottom: 32px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--brand-primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.login-heading h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 8px;
}

.login-heading p {
  color: var(--text-muted);
  font-size: 14px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-left: 54px;
}

.password-toggle {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.password-toggle:hover {
  background: #f1f5f9;
  color: var(--text-main);
  box-shadow: none;
  transform: translateY(-50%);
}

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: 10px;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.login-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.login-note-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.login-note p {
  font-size: 12.5px;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
}

.login-note .muted {
  font-size: 11.5px;
}

.login-signature {
  margin-top: 32px;
  text-align: center;
  font-family: var(--font-latin);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.login-signature strong {
  color: var(--text-muted);
  font-weight: 800;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text-dim);
  padding: 24px;
  font-size: 12px;
  border-top: 1px solid var(--border-subtle);
}

.login-page footer {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #64748b;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 36px 32px;
  }
  .login-panel {
    padding: 36px 32px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 70px;
    padding: 0 16px;
  }
  .brand-logo-wrap img {
    width: 40px;
  }
  .brand-caption small,
  .brand-divider {
    display: none;
  }
  .account .account-info,
  .account .avatar {
    display: none;
  }
  main {
    padding: 0 16px;
    margin: 20px auto;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card {
    padding: 18px;
    border-radius: var(--radius-md);
  }
  h1 {
    font-size: 22px;
  }
  .login-story h1 {
    font-size: 26px;
  }
  .story-features,
  .brand-art {
    display: none;
  }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
