@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #1a2744;
  --bg-soft: #112038;
  --maroon: #1a2744;
  --surface: #ffffff;
  --page: #f5f7fb;
  --primary: #e8542e;
  --primary-dark: #c43d1e;
  --green: #7fba00;
  --blue: #00a4ef;
  --amber: #ffa70b;
  --ink: #1a2030;
  --muted: #6b7a99;
  --line: #e2e8f0;
  --danger: #c0392b;
  --danger-soft: #fbeae7;
  --success: #4a9a00;
  --radius: 10px;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-code: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------------------------------------------------------------------- */
/* Login layout                                                            */
/* ---------------------------------------------------------------------- */

/* ---------------------------------------------------------------------- */
/* Login layout (STAGE 1 Refinement)                                       */
/* ---------------------------------------------------------------------- */

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

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

.auth-brand {
  background: radial-gradient(circle at 20% 20%, var(--bg-soft), var(--bg) 70%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
  animation: authEntrance 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-brand__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.auth-brand__mark span { color: var(--primary); }

.logo-badge {
  width: 88px;
  height: 88px;
  background: #ffffff;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  margin-bottom: 32px;
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-badge.small {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 0;
  box-shadow: none;
  border: 1px solid var(--line);
}

.auth-brand__body h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 440px;
  margin: 0 0 16px;
}

.auth-brand__body p {
  color: #d6b6b0;
  max-width: 400px;
  line-height: 1.6;
  font-size: 15px;
  margin: 0;
}

.auth-brand__foot {
  color: #a9807c;
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Signature element: an abstract org-chart lattice representing the
   Board -> Department -> Unit -> Group structure of the club. */
.org-lattice {
  position: absolute;
  right: -60px;
  bottom: -40px;
  width: 460px;
  height: 460px;
  opacity: 0.9;
  pointer-events: none;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  animation: authEntrance 600ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-brand,
  .auth-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 32px;
}

.field {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: var(--font-body);
  background: #fbfcfe;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 84, 46, 0.15);
  background: #ffffff;
}

.btn-primary {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232, 84, 46, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  background: #a9bce8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 18px;
}

.form-error.visible { display: block; }

/* ---------------------------------------------------------------------- */
/* Dashboard layout                                                        */
/* ---------------------------------------------------------------------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    z-index: 900;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-smooth);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 36px rgba(0, 0, 0, 0.35);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 50, 0.5);
    z-index: 899;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-smooth);
  }
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 800;
    border-bottom: 1px solid var(--line);
  }
  body.dark-theme .admin-mobile-bar {
    background: var(--surface);
  }
  .admin-mobile-bar .brand-label {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
  }
  body.dark-theme .admin-mobile-bar .brand-label {
    color: var(--ink);
  }
  .admin-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
  }
  .admin-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: transform 0.25s var(--ease-smooth), opacity 0.25s var(--ease-smooth);
  }
  body.dark-theme .admin-hamburger span {
    background: var(--ink);
  }
}

.sidebar {
  background: var(--bg);
  color: #ffffff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
}

.sidebar__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__mark span { color: var(--primary); }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid #243a5e;
  margin-bottom: 20px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar__user-name {
  font-size: 14px;
  font-weight: 600;
}

.sidebar__user-email {
  font-size: 12px;
  color: #8fafd8;
}

.sidebar__nav {
  flex: 1;
}

.sidebar__nav-item {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #b8d0ef;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.sidebar__nav-item.active {
  background: var(--bg-soft);
  color: #ffffff;
}

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.btn-logout:hover { border-color: rgba(232,84,46,0.6); color: #ff8a8a; background: rgba(232,84,46,0.08); }

.main {
  padding: 36px 44px;
}

.main__header {
  margin-bottom: 28px;
}

.main__header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 4px;
}

.main__header p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.info-grid dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.info-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

table.roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.roles-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

table.roles-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #f0f2f7;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #eaf0fe;
  color: var(--primary-dark);
}

.badge.scope-global { background: #fdf1e2; color: #a2620b; }

.scope-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
}

.loading-state {
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------------- */
/* Organization screen                                                     */
/* ---------------------------------------------------------------------- */

.toolbar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-secondary {
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); }

.btn-small {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, color 0.15s;
}

.btn-small:hover { border-color: var(--primary); color: var(--primary-dark); background: #ffffff; }

.btn-small.danger { color: var(--danger); }
.btn-small.danger:hover { border-color: var(--danger); color: var(--danger); }

.tree-node { margin-bottom: 14px; }

.node-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}

.node-card.level-1 { border-left: 3px solid var(--primary); }
.node-card.level-2 { margin-left: 26px; border-left: 3px solid var(--amber); }
.node-card.level-3 { margin-left: 52px; border-left: 3px solid #cbb; }

.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.node-title-row { display: flex; align-items: center; gap: 10px; }

.node-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 2px 6px;
}

.node-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.node-subtitle { color: var(--muted); font-size: 12px; margin-top: 2px; }
.node-code { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.node-actions { display: flex; gap: 8px; flex-shrink: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f6f1ee;
  font-size: 12px;
  color: var(--ink);
}

.chip .chip-role { color: var(--primary-dark); font-weight: 600; font-size: 11px; }
.chip .chip-remove { cursor: pointer; color: var(--muted); font-weight: 700; }
.chip .chip-remove:hover { color: var(--danger); }

.node-children { margin-top: 14px; }

.node-empty { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 28, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 18px;
}

.modal .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: var(--font-body);
  background: #fbfcfe;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.modal-error.visible { display: block; }

.search-result-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 160px;
  overflow-y: auto;
  margin-top: 6px;
}

.search-result-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f7;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f6f1ee; }
.search-result-item.selected { background: #eee3dd; }

.hint-text { font-size: 12px; color: var(--muted); margin-top: 4px; }

.node-card.node-inactive {
  opacity: 0.65;
  background: #faf8f7;
  border-style: dashed;
}

/* Portal Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(74, 22, 32, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--green) 33%, var(--blue) 66%, var(--amber) 100%);
  border-radius: 16px 16px 0 0;
}
.stat-card dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.stat-card dd {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
  margin: 8px 0 6px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-card .stat-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-top: auto;
}
.meeting-banner {
  background: #e6f4ea;
  border: 1px solid #ceead6;
  color: #137333;
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.meeting-banner a {
  background: #137333;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.meeting-banner a:hover {
  background: #0f5c29;
}
.portal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.portal-card h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--maroon);
}
.task-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.task-item:last-child {
  border-bottom: none;
}
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.task-title {
  font-weight: 700;
  font-size: 15px;
}
.task-due {
  font-size: 12px;
  color: var(--muted);
}
.task-desc {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 12px;
}
.grade-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.grade-tag.graded {
  background: #eef7e2;
  color: var(--success);
}
.grade-tag.pending {
  background: #fff3cd;
  color: #856404;
}
.grade-tag.missing {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Status Badges */
.status-badge, .user-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.status-badge.status-pending, .user-badge.status-suspended {
  background: #fff3cd;
  color: #856404;
}

.status-badge.status-accepted, .user-badge.status-active {
  background: #eef7e2;
  color: var(--success);
}

.status-badge.status-rejected, .user-badge.status-disabled {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
  background: transparent;
  border: none;
  color: currentColor;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: scale(1.05);
}

body.dark-theme .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Dark Mode Color Palette */
body.dark-theme {
  --page: #0f1623;
  --bg: #1a2744;
  --bg-soft: #112038;
  --surface: #1a2236;
  --surface-elevated: #212d45;
  --ink: #e8edf8;
  --muted: #7a90b8;
  --line: #2a3a5c;
  --maroon: #1a2744;
  --primary: #e8552e;
  --primary-dark: #c43d1e;
  --blue: #3b9ef5;
  --green: #6ab310;
  --amber: #f5b318;
  --danger: #e04838;
  --danger-soft: #2a1520;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #1a2236;
  color: #e8edf8;
  border-color: #2a3a5c;
}

body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 84, 46, 0.18);
  background: #1f2d48;
}

body.dark-theme .card,
body.dark-theme .portal-card,
body.dark-theme .node-card {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-theme .tree-node .node-card {
  background: var(--surface);
}

body.dark-theme .sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
}

body.dark-theme .btn-small {
  background: #212d45;
  color: var(--ink);
  border-color: var(--line);
}

body.dark-theme .modal,
body.dark-theme .search-result-item {
  background: var(--surface-elevated);
  color: var(--ink);
}

body.dark-theme table.roles-table td,
body.dark-theme table.roles-table th {
  border-color: var(--line);
}

body.dark-theme .landing-header {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-theme .status-card,
body.dark-theme .track-card {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-theme .chip {
  background: #34272a;
  color: var(--ink);
}

body.dark-theme .status-badge.status-pending,
body.dark-theme .user-badge.status-suspended {
  background: #3e2808;
  color: #f5b318;
}

body.dark-theme .status-badge.status-accepted,
body.dark-theme .user-badge.status-active {
  background: #12281a;
  color: #7cb310;
}

body.dark-theme .status-badge.status-rejected,
body.dark-theme .user-badge.status-disabled {
  background: #3e1616;
  color: #e04838;
}

/* ---------------------------------------------------------------------- */
/* Premium Motion & Animation Design System                              */
/* ---------------------------------------------------------------------- */

:root {
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-sm: 0 2px 8px rgba(74, 22, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(74, 22, 32, 0.08);
  --shadow-lg: 0 16px 40px rgba(74, 22, 32, 0.14);
}

/* Scroll Reveal Classes */
[data-reveal], .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
  will-change: opacity, transform;
}

[data-reveal="fade-in"] {
  transform: translateY(0);
}

[data-reveal="scale-up"] {
  transform: scale(0.95);
}

[data-reveal="slide-left"] {
  transform: translateX(-30px);
}

[data-reveal="slide-right"] {
  transform: translateX(30px);
}

[data-reveal].revealed, .reveal.revealed {
  opacity: 1;
  transform: translateY(0) scale(1) translateX(0);
}

/* Stagger Delays for Grid Children */
.stagger-group > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-group > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-group > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-group > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-group > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-group > *:nth-child(6) { transition-delay: 0.40s; }

/* Interactive Micro-Interactions */
button, .btn-hero-primary, .btn-hero-secondary, .btn-signin, .feature-card, .status-card, .faq-card {
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth), background-color 0.2s ease, border-color 0.2s ease;
}

/* Image LQIP Blur-Up Effect */
.blur-load {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border-radius: inherit;
}

.blur-load img {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  width: 100%;
  height: auto;
  display: block;
}

.blur-load.loaded img {
  opacity: 1;
}

/* Smooth Focus Rings */
:focus-visible {
  outline: 3px solid rgba(232, 84, 46, 0.4);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------- */
/* Agency-Level Visual Design System & Ambient Orbs                      */
/* ---------------------------------------------------------------------- */

/* Ambient Glowing Background Orbs */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #f25022 0%, rgba(242, 80, 34, 0) 70%);
  top: -100px;
  right: -80px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #02a4ef 0%, rgba(2, 164, 239, 0) 70%);
  bottom: -120px;
  left: -100px;
  animation-delay: -6s;
}

.orb-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #ffb902 0%, rgba(255, 185, 2, 0) 70%);
  top: 40%;
  left: 30%;
  opacity: 0.18;
  animation-delay: -12s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Microsoft Signature Ambient Lattice Grid */
.bg-grid-pattern {
  background-image: radial-gradient(rgba(74, 22, 32, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Asymmetric Grid Layout */
.grid-asymmetric {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
}

@media (max-width: 992px) {
  .grid-asymmetric { grid-template-columns: 1fr; }
}

.feature-card-featured {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 244, 241, 0.95) 100%);
  border: 1.5px solid rgba(232, 84, 46, 0.3);
  position: relative;
  overflow: hidden;
}

.feature-card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #f25022 0%, #02a4ef 50%, #80ba01 100%);
}

/* 3D Perspective Tilt Card Container */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
  will-change: transform;
}

/* Section Curve / Wave Dividers */
.section-divider-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  fill: var(--surface);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------- */
/* Microsoft Signature 4-Color Mosaic Badge (Header Accent)              */
/* ---------------------------------------------------------------------- */
.ms-mosaic-badge {
  display: inline-grid;
  grid-template-columns: 13px 13px;
  grid-template-rows: 13px 13px;
  gap: 3px;
  width: 29px;
  height: 29px;
  flex-shrink: 0;
  vertical-align: middle;
}

.ms-mosaic-badge span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
}

.ms-mosaic-badge .sq-red { background-color: #f25022; }
.ms-mosaic-badge .sq-blue { background-color: #02a4ef; }
.ms-mosaic-badge .sq-green { background-color: #80ba01; }
.ms-mosaic-badge .sq-yellow { background-color: #ffb902; }

/* ---------------------------------------------------------------------- */
/* Single-Word H1 Accent Typography                                      */
/* ---------------------------------------------------------------------- */
.hero-word-accent {
  color: #f25022;
  font-weight: 800;
  background: linear-gradient(135deg, #f25022 0%, #ff7a59 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------------------------------------------------------------------- */
/* Subtle Architectural Hero Mosaic Backdrop                              */
/* ---------------------------------------------------------------------- */
.hero-mosaic-bg {
  position: absolute;
  top: 50px;
  right: 100px;
  display: grid;
  grid-template-columns: 56px 56px;
  grid-template-rows: 56px 56px;
  gap: 12px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.hero-mosaic-bg span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.hero-mosaic-bg .sq-red { background: #f25022; }
.hero-mosaic-bg .sq-blue { background: #02a4ef; }
.hero-mosaic-bg .sq-green { background: #80ba01; }
.hero-mosaic-bg .sq-yellow { background: #ffb902; }

/* ---------------------------------------------------------------------- */
/* Item 2: Floating Stat Card Enhanced Shadows & Hover Elevation          */
/* ---------------------------------------------------------------------- */
.floating-stat {
  box-shadow: 0 12px 32px rgba(74, 22, 32, 0.1), 0 2px 8px rgba(74, 22, 32, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.floating-stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(74, 22, 32, 0.14), 0 4px 12px rgba(74, 22, 32, 0.06);
}

/* ---------------------------------------------------------------------- */
/* Item 3: Primary CTA Button Gradient Hover Overlay                      */
/* ---------------------------------------------------------------------- */
.btn-hero-primary {
  position: relative;
  overflow: hidden;
}
.btn-hero-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f25022, #ffb902, #80ba01, #02a4ef);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-hero-primary:hover::after {
  opacity: 0.15;
}

/* ---------------------------------------------------------------------- */
/* Item 4: Top Border Accent for Feature & Status Cards                   */
/* ---------------------------------------------------------------------- */
.feature-card:not(.feature-card-featured), .status-card {
  position: relative;
  overflow: hidden;
}
.feature-card:not(.feature-card-featured)::before, .status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f25022, #02a4ef, #80ba01, #ffb902);
}

/* ---------------------------------------------------------------------- */
/* Item 5: Smooth Scroll Behavior Across Sections                         */
/* ---------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* ---------------------------------------------------------------------- */
/* Mobile Responsive System Fixes (Tablet & Mobile 360px - 768px)          */
/* ---------------------------------------------------------------------- */

@media (max-width: 768px) {
  .hero-mosaic-bg {
    display: none !important;
  }
  .landing-header {
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .landing-nav {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 13px;
  }
  .grid-3 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 50px 16px 40px;
  }
  .hero-content h1 {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }
  .section {
    padding: 52px 16px;
  }
  .about-banner {
    padding: 40px 20px;
  }
  .about-banner h2 {
    font-size: 26px;
  }
}

/* ---------------------------------------------------------------------- */
/* Item 1: Persistent Portal Application Status Bar Banner               */
/* ---------------------------------------------------------------------- */
.portal-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.portal-status-bar.open {
  background: #eef7e2;
  color: #27ae60;
  border-color: #ceead6;
}

.portal-status-bar.closed {
  background: #fde8e8;
  color: #c0392b;
  border-color: #f8b4b4;
}

.portal-status-bar .status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------- */
/* Item 2: Quick Action Buttons & Safety Undo Toast                       */
/* ---------------------------------------------------------------------- */
.table-row-pending {
  opacity: 0.55 !important;
  background: rgba(255, 185, 2, 0.08) !important;
  transition: opacity 0.25s ease;
}

.btn-quick-accept {
  background: #eef7e2 !important;
  color: #27ae60 !important;
  border: 1px solid #ceead6 !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  cursor: pointer;
}
.btn-quick-accept:hover {
  background: #27ae60 !important;
  color: #ffffff !important;
}

.btn-quick-reject {
  background: #fde8e8 !important;
  color: #c0392b !important;
  border: 1px solid #f8b4b4 !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  cursor: pointer;
}
.btn-quick-reject:hover {
  background: #c0392b !important;
  color: #ffffff !important;
}

.toast-undo-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #241a1c;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 10000;
  font-weight: 700;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.toast-undo-btn {
  background: #f25022;
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s ease;
}
.toast-undo-btn:hover {
  background: #d93d12;
}

/* ================================================================
   GLOBAL ANIMATIONS & TRANSITIONS — Modern UI Polish
   ================================================================ */

/* Keyframes */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Page entrance */
.main {
  animation: fadeIn 0.35s ease forwards;
}

/* Cards */
.card, .portal-card, .stat-card {
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: 0 8px 28px rgba(26,39,68,0.10);
}

/* Sidebar upgrade */
.sidebar {
  background: linear-gradient(180deg, #1a2744 0%, #112038 100%);
  transition: width 0.3s var(--ease-smooth);
  box-shadow: 2px 0 16px rgba(10,20,50,0.15);
}
.sidebar__mark {
  letter-spacing: -0.01em;
}
.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-bottom: 3px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  position: relative;
  overflow: hidden;
}
.sidebar__nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.sidebar__nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  transform: translateX(2px);
}
.sidebar__nav-item.active {
  background: rgba(232,84,46,0.18);
  color: #ffffff;
  font-weight: 600;
}
.sidebar__nav-item.active::before {
  opacity: 1;
}

/* Improved btn-primary */
.btn-primary {
  transition: all 0.22s var(--ease-smooth) !important;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232,84,46,0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

/* Table rows */
.roles-table tbody tr,
table tbody tr {
  transition: background 0.15s ease;
}
.roles-table tbody tr:hover,
table tbody tr:hover {
  background: rgba(26,39,68,0.04);
}

/* Modal entrance */
.modal {
  animation: scaleIn 0.25s var(--ease-smooth);
}

/* Stat cards */
.stat-card {
  border-radius: 14px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.stat-card:hover {
  box-shadow: 0 10px 32px rgba(26,39,68,0.12);
  transform: translateY(-2px);
}

/* Form inputs smooth focus */
input, select, textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* Smooth auth-brand gradient for login side panel */
.auth-brand {
  background: linear-gradient(135deg, #112038 0%, #1a2744 50%, #0d1f3c 100%);
}

/* Badge/tag animations */
.status-badge-inline {
  transition: opacity 0.2s ease;
}

/* Mobile sidebar slide */
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0; bottom: 0;
    width: 240px;
    z-index: 999;
    transition: left 0.3s var(--ease-smooth);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.open {
    left: 0;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 20px 16px;
  }
}

/* Responsive main content */
@media (max-width: 900px) {
  .main {
    padding: 24px 20px;
  }
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Selection color */
::selection { background: rgba(232,84,46,0.18); color: var(--ink); }

/* Focus visible outline */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}













