/* CRM Academy of Asia — SXEI Platform Brand Layer */

:root {
  --crmaa-navy:   #0a1628;
  --crmaa-blue:   #102a52;
  --crmaa-gold:   #c9a227;
  --crmaa-gold-light: #e8c65a;
  --crmaa-gold-dark:  #a07d10;
  --crmaa-red:    #c0392b;
  --crmaa-gradient: linear-gradient(135deg, #0a1628 0%, #102a52 60%, #1a3a6e 100%);
  --crmaa-gradient-gold: linear-gradient(135deg, #c9a227 0%, #e8c65a 100%);
}

/* CRMAA Top Bar */
.crmaa-topbar {
  background: var(--crmaa-navy);
  padding: 6px 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color:rgba(255,255,255,0.72);
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--crmaa-gold);
}

.crmaa-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--crmaa-gold);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.crmaa-topbar-brand .crmaa-logo-sm {
  width: 22px;
  height: 22px;
  background: var(--crmaa-gradient-gold);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--crmaa-navy);
}

.crmaa-topbar-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.crmaa-topbar-links a {
  color:rgba(255,255,255,0.72);
  text-decoration: none;
  transition: color 0.2s;
}

.crmaa-topbar-links a:hover { color: var(--crmaa-gold); }

.crmaa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--crmaa-gradient-gold);
  color: var(--crmaa-navy);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* CRMAA Footer */
.crmaa-footer {
  background: var(--crmaa-navy);
  color:rgba(255,255,255,0.72);
  padding: 2.5rem 2rem 1.5rem;
  border-top: 3px solid var(--crmaa-gold);
}

.crmaa-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto 2rem;
}

@media (max-width: 900px) {
  .crmaa-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .crmaa-footer-grid { grid-template-columns: 1fr; }
}

.crmaa-footer-brand h3 {
  color: var(--crmaa-gold);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.crmaa-footer-brand p {
  font-size: 0.82rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.crmaa-footer-col h4 {
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.crmaa-footer-col a {
  display: block;
  color:rgba(255,255,255,0.72);
  text-decoration: none;
  font-size: 0.82rem;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.crmaa-footer-col a:hover { color: var(--crmaa-gold); }

.crmaa-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.crmaa-footer-bottom .tm { color: var(--crmaa-gold); font-weight: 700; }

/* Admin-specific styles */
.admin-hero {
  background: var(--crmaa-gradient);
  color: white;
  padding: 2rem;
  border-bottom: 3px solid var(--crmaa-gold);
  position: relative;
  overflow: hidden;
}

.admin-hero::before {
  content: 'CRMAA';
  position: absolute;
  right: -20px; top: -20px;
  font-size: 8rem;
  font-weight: 900;
  color: rgba(201,162,39,0.06);
  letter-spacing: -0.05em;
  pointer-events: none;
}

.admin-hero h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.admin-hero p { opacity: 0.75; font-size: 0.88rem; }

.super-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--crmaa-gradient-gold);
  color: var(--crmaa-navy);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* Institution status badges */
.inst-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
}

.inst-active   { background: #e0f2f1; color: #00695c; }
.inst-pending  { background: #fff8e1; color: #e65100; }
.inst-suspended{ background: #fce4ec; color: #c62828; }
.inst-trial    { background: #e8eaf6; color: #3949ab; }

/* Stat cards with gold accent */
.admin-stat {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--crmaa-gold);
  box-shadow: var(--shadow);
}

.admin-stat .val {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--crmaa-navy);
}

.admin-stat .lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* Permission & role chips */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid;
}

.role-superadmin { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.role-national   { background: #e8eaf6; color: #3949ab; border-color: #9fa8da; }
.role-institution{ background: #e0f2f1; color: #00695c; border-color: #80cbc4; }
.role-faculty    { background: #f3e5f5; color: #7b1fa2; border-color: #ce93d8; }
.role-student    { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.role-readonly   { background: #f5f5f5; color: #616161; border-color: #bdbdbd; }

/* CRMAA sidebar override */
.crmaa-sidebar {
  background: var(--crmaa-navy);
  border-right: 1px solid rgba(201,162,39,0.3);
}

.crmaa-sidebar .sidebar-label {
  color: rgba(201,162,39,0.7);
}

.crmaa-sidebar .sidebar-link {
  color:rgba(255,255,255,0.72);
}

.crmaa-sidebar .sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.crmaa-sidebar .sidebar-link.active {
  background: rgba(201,162,39,0.15);
  color: var(--crmaa-gold);
  border-left: 3px solid var(--crmaa-gold);
}

/* Approval workflow */
.approval-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.2s;
}

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

.approval-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Watermark */
.crmaa-watermark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color:rgba(255,255,255,0.72);
}

.crmaa-watermark img, .crmaa-watermark .wm-logo {
  width: 18px;
  height: 18px;
  background: var(--crmaa-gradient-gold);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--crmaa-navy);
}

/* Locked sections */
.locked-overlay {
  position: relative;
}

.locked-overlay::after {
  content: '🔒 CRMAA Control — Institution cannot modify';
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crmaa-gold);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* Gold divider */
.gold-divider {
  height: 2px;
  background: var(--crmaa-gradient-gold);
  border-radius: 100px;
  margin: 1.5rem 0;
}

/* Control panel toggle */
.control-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 100px;
  transition: 0.3s;
}

.toggle-switch input:checked ~ .toggle-track {
  background: var(--crmaa-gold);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked ~ .toggle-track ~ .toggle-thumb,
.toggle-switch input:checked + .toggle-track + .toggle-thumb {
  left: 23px;
}
