/* ==========================================================================
   BAOBAB RISE - Global Stylesheet & Design System
   ========================================================================== */

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

:root {
  /* Brand Palette */
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --admin-blue-header: #0284c7;
  
  --brand-green: #15803d;
  --brand-green-light: #dcfce7;
  --brand-green-dark: #14532d;
  --principal-green-header: #14532d;
  --trainer-green-header: #064e3b;
  --parent-green-header: #14532d;

  --accent-amber: #f59e0b;
  --accent-orange: #ea580c;
  --accent-rose: #e11d48;
  --accent-purple: #7c3aed;
  --accent-teal: #0d9488;

  /* Neutrals */
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0a4d8c;
  --sidebar-hover: #073b6d;
  --sidebar-active: #0284c7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Status Colors */
  --status-good: #22c55e;
  --status-good-bg: #ecfdf5;
  --status-warning: #f59e0b;
  --status-warning-bg: #fffbeb;
  --status-danger: #ef4444;
  --status-danger-bg: #fef2f2;
  --status-info: #0ea5e9;
  --status-info-bg: #f0f9ff;

  /* Elevations */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-phone: 0 25px 50px -12px rgba(15, 23, 42, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #0f172a;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   TOP ROLE SWITCHER BAR (Antigravity Portal Navigation)
   ========================================================================== */
.top-role-bar {
  background: #0b1329;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mini-logo {
  height: 38px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-tag {
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.role-switcher-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.role-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.role-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.role-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

.role-btn.active[data-role="principal"] {
  background: #15803d;
  box-shadow: 0 2px 10px rgba(21, 128, 61, 0.45);
}

.role-btn.active[data-role="trainer"] {
  background: #0d9488;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.45);
}

.role-btn.active[data-role="parent"] {
  background: #166534;
  box-shadow: 0 2px 10px rgba(22, 101, 52, 0.45);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.device-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.device-toggle-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
}

/* ==========================================================================
   APP WORKSPACE CONTAINER
   ========================================================================== */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #0f172a;
}

.view-panel {
  display: none;
  width: 100%;
  min-height: calc(100vh - 65px);
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Return to Website Home Button */
.btn-return-home {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-return-home:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

@media (max-width: 860px) {
  .top-role-bar {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }
  .brand-section {
    gap: 8px;
  }
  .brand-mini-logo {
    height: 30px;
  }
  .role-switcher-group {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 4px;
    margin-top: 4px;
  }
  .role-btn {
    padding: 6px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }
  .view-controls {
    gap: 6px;
  }
  .device-toggle-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }
  .hide-on-mobile {
    display: none !important;
  }
}
