/* ============================================================
   JETRANS ERP — Main Stylesheet
   ============================================================ */

/* --- Variables --- */
:root {
  --primary:      #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light:#e0f2fe;
  --accent:       #38bdf8;
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #3b82f6;

  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --border:       #e2e8f0;

  --text:         #0f172a;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);

  --font:         'Plus Jakarta Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
input, button, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }


/* ============================================================
   LOGIN PAGE — Full-screen background + Glassmorphism card
   ============================================================ */
.page-login {
  min-height: 100vh;
  overflow: hidden;
}

/* Full-screen background image from the live site */
.login-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0c1a2e;
  z-index: 0;
}

/* Dark overlay for readability */
.login-bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 20, 40, 0.65) 0%,
    rgba(5, 15, 30, 0.50) 100%
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1;
}

/* Centered layout wrapper */
.login-root {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 440px;
}

/* Glassmorphism card */
.login-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Logo row */
.login-logo {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.login-logo-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.login-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -.3px;
  line-height: 1.2;
}

.login-brand-sub {
  font-size: .72rem;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .3px;
  text-transform: uppercase;
  font-weight: 500;
}

.login-divider {
  height: 1px;
  background: rgba(255, 255, 255, .12);
  margin: -.4rem 0;
}

/* Header */
.login-header h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -.5px;
  line-height: 1.2;
}
.login-header p {
  color: rgba(255, 255, 255, .55);
  font-size: .875rem;
  margin-top: .3rem;
}

/* --- Forms --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .7);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-link {
  font-weight: 500;
  color: var(--accent);
  font-size: .8rem;
  transition: color .2s;
}
.forgot-link:hover { color: #7dd3fc; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: .9rem;
  color: rgba(255, 255, 255, .4);
  font-size: 1rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: .78rem 1rem .78rem 2.5rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
}

.form-input:focus {
  border-color: rgba(14, 165, 233, .7);
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .2);
}

.form-input::placeholder { color: rgba(255, 255, 255, .28); }

.toggle-pw {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, .35);
  padding: .25rem;
  transition: color .2s;
}
.toggle-pw:hover { color: rgba(255, 255, 255, .7); }

/* Checkbox */
.form-row { display: flex; align-items: center; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .83rem;
  color: rgba(255, 255, 255, .6);
  user-select: none;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
  width: 17px; height: 17px;
  border: 1.5px solid rgba(255, 255, 255, .25);
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  flex-shrink: 0;
  position: relative;
  transition: all .2s;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* Login Button */
.btn-login {
  width: 100%;
  padding: .85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: all .25s;
  box-shadow: 0 4px 20px rgba(14, 165, 233, .4);
  margin-top: .15rem;
}

.btn-login:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0369a1 100%);
  box-shadow: 0 6px 28px rgba(14, 165, 233, .55);
  transform: translateY(-1px);
}

.btn-login:disabled {
  opacity: .8;
  cursor: not-allowed;
  transform: none;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Info badges */
.login-info {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: .6rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.info-badge {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .73rem;
  color: rgba(255, 255, 255, .45);
}

.info-badge i { color: rgba(34, 197, 94, .8); }

/* Version bar */
.login-version {
  font-size: .73rem;
  color: rgba(255, 255, 255, .3);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dot { font-size: .4rem; }

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.alert-danger  { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.alert-warning { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.alert-success { background: rgba(34,197,94,.15);  color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.alert-info    { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
}
.modal-box {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  animation: popIn .25s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
.modal-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.modal-box h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; color: #fff; }
.modal-box p { color: rgba(255,255,255,.55); font-size: .9rem; margin-bottom: 1rem; }
.modal-contact a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 1.25rem;
}
.btn-close-modal {
  padding: .6rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: .875rem;
  transition: background .2s;
}
.btn-close-modal:hover { background: var(--primary-dark); }

/* Mobile */
.mobile-logo { display: none; }

@media (max-width: 480px) {
  .login-box {
    padding: 1.75rem 1.4rem;
    border-radius: 16px;
  }
  .login-header h2 { font-size: 1.45rem; }
}

   APP LAYOUT (Post-Login)
   ============================================================ */
.page-app { display: flex; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width .3s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: 72px; }

.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  overflow: hidden;
}

.sidebar-brand {
  font-size: .95rem;
  font-weight: 800;
  color: white;
  white-space: nowrap;
  transition: opacity .2s;
}

.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; overflow: hidden; }

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  font-size: 1.1rem;
  padding: .25rem;
  transition: color .2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: white; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.25);
  padding: 1rem 1.25rem .4rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.55);
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
  position: relative;
  cursor: pointer;
}

.nav-item i {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-item:hover:not(.disabled) {
  background: rgba(255,255,255,.06);
  color: white;
}

.nav-item.active {
  background: rgba(14,165,233,.15);
  color: var(--accent);
  border-right: 3px solid var(--primary);
}

.nav-item.disabled { opacity: .4; cursor: not-allowed; }

.nav-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 99px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-badge.soon {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.4);
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge { display: none; }

/* Sidebar user */
.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name {
  font-size: .8rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: .7rem;
  color: rgba(255,255,255,.4);
}

.logout-btn {
  color: rgba(255,255,255,.35);
  font-size: 1rem;
  transition: color .2s;
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--danger); }

.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn { display: none; }

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  transition: margin-left .3s ease;
}
.main-content.expanded { margin-left: 72px; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-2);
  cursor: pointer;
  padding: .25rem;
  transition: color .2s;
}
.menu-toggle:hover { color: var(--text); }

.breadcrumb {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-right { display: flex; align-items: center; gap: 1.25rem; }

.topbar-time {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-3);
  background: var(--bg);
  padding: .3rem .7rem;
  border-radius: 6px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
}

/* Page content */
.page-content {
  padding: 1.75rem;
  max-width: 1280px;
}

/* Welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, #0c1a2e 0%, #0f2748 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}

.welcome-text h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  letter-spacing: -.3px;
}
.welcome-text p { color: rgba(255,255,255,.65); font-size: .875rem; margin-top: .35rem; }
.welcome-text strong { color: var(--accent); }

.welcome-badge {
  font-size: 2.5rem;
  opacity: .4;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #e0f2fe; color: var(--primary); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.orange { background: #fffbeb; color: var(--warning); }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: .78rem;
  color: var(--text-3);
  margin-top: .25rem;
  font-weight: 500;
}

/* Section title */
.section-title {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}

/* Module grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.module-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .2s;
}
.module-card:hover { box-shadow: var(--shadow); }

.module-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.module-card.done .module-icon   { background: #f0fdf4; color: var(--success); }
.module-card.wip .module-icon    { background: #fffbeb; color: var(--warning); }
.module-card.pending .module-icon{ background: var(--bg); color: var(--text-3); }

.module-info { flex: 1; }
.module-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.module-status {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: .15rem;
}
.module-card.done .module-status   { color: var(--success); }
.module-card.wip .module-status    { color: var(--warning); }

.module-pct {
  font-size: .8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-3);
  flex-shrink: 0;
}
.module-card.done .module-pct { color: var(--success); }
.module-card.wip .module-pct  { color: var(--warning); }

/* Session info */
.session-info {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-3);
  padding: .75rem 1rem;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .login-brand { display: none; }
  .login-panel { width: 100%; padding: 2rem 1.5rem; }
  .mobile-logo { display: flex; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 1rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .welcome-badge { display: none; }
}


/* ============================================================
   MODULE PORTAL (Post-login home)
   ============================================================ */
.page-portal {
  background: #f0f4f8;
  min-height: 100vh;
}

/* --- Top Nav --- */
.portal-nav {
  background: #0f172a;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.portal-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.portal-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  letter-spacing: -.3px;
}
.portal-logo-text span { color: var(--accent); }

.portal-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.portal-user-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  padding: .3rem .75rem .3rem .35rem;
}
.portal-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: .7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-username {
  font-size: .85rem;
  font-weight: 600;
  color: white;
}
.portal-role-badge {
  font-size: .65rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
  padding: .15rem .5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.portal-logout {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  transition: color .2s;
  padding: .4rem .6rem;
  border-radius: 8px;
}
.portal-logout:hover { color: white; background: rgba(255,255,255,.08); }

/* --- Body --- */
.portal-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}
.portal-alerts { margin-bottom: 1rem; }

/* --- Welcome --- */
.portal-welcome {
  background: linear-gradient(130deg, #0c1a2e 0%, #0f2d52 60%, #0c3a6b 100%);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 24px rgba(14,165,233,.15);
}
.portal-welcome-left h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  letter-spacing: -.4px;
}
.portal-welcome-left p {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  margin-top: .3rem;
}
.portal-welcome-right {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.portal-meta-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  font-size: .8rem;
  font-weight: 500;
  padding: .4rem .85rem;
  border-radius: 99px;
  white-space: nowrap;
}
.portal-meta-badge i { color: var(--accent); font-size: .85rem; }

/* --- Section label --- */
.portal-section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* --- Module tiles --- */
.portal-modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.module-tile {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.module-tile:not(.coming):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
}
.module-tile.coming { opacity: .75; cursor: default; }

.module-tile-top {
  height: 8px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 1rem;
}
.module-tile-top.blue   { background: var(--primary); }
.module-tile-top.green  { background: var(--success); }
.module-tile-top.purple { background: #7c3aed; }
.module-tile-top.red    { background: var(--danger); }
.module-tile-top.orange { background: var(--warning); }
.module-tile-top.teal   { background: #0d9488; }

.module-tile-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  position: absolute;
  bottom: -24px;
  left: 1.25rem;
}
.module-tile-top.blue   .module-tile-icon { color: var(--primary); }
.module-tile-top.green  .module-tile-icon { color: var(--success); }
.module-tile-top.purple .module-tile-icon { color: #7c3aed; }
.module-tile-top.red    .module-tile-icon { color: var(--danger); }
.module-tile-top.orange .module-tile-icon { color: var(--warning); }
.module-tile-top.teal   .module-tile-icon { color: #0d9488; }

.coming-badge {
  background: rgba(0,0,0,.25);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  letter-spacing: .5px;
  text-transform: uppercase;
  position: absolute;
  right: 1rem;
  bottom: -12px;
}

.module-tile-body {
  padding: 2.25rem 1.25rem 1.5rem;
}
.module-tile-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}
.module-tile-body p {
  font-size: .8rem;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 1rem;
  min-height: 2.5rem;
}
.module-open-link {
  font-size: .82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: gap .2s;
}
.module-open-link:not(.disabled) { color: var(--primary); }
.module-open-link.disabled { color: var(--text-3); cursor: default; font-style: italic; font-weight: 500; }
.module-tile:not(.coming):hover .module-open-link { gap: .55rem; }

/* Color-specific link colors */
.module-tile[data-color="green"]:not(.coming) .module-open-link { color: var(--success); }
.module-tile[data-color="purple"]:not(.coming) .module-open-link { color: #7c3aed; }
.module-tile[data-color="red"]:not(.coming) .module-open-link { color: var(--danger); }

/* --- Admin bar --- */
.portal-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-top: .5rem;
}
.portal-admin-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-2);
}
.portal-admin-info i { color: var(--primary); font-size: 1rem; }
.portal-admin-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: #0f172a;
  color: white;
  font-size: .85rem;
  font-weight: 700;
  padding: .6rem 1.25rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .2s;
}
.portal-admin-btn:hover { background: #1e293b; }

/* Responsive */
@media (max-width: 900px) {
  .portal-modules { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .portal-modules { grid-template-columns: 1fr; }
  .portal-welcome { flex-direction: column; align-items: flex-start; }
  .portal-welcome-right { justify-content: flex-start; }
  .portal-body { padding: 1.5rem 1rem 3rem; }
  .portal-admin-bar { flex-direction: column; align-items: flex-start; }
}

/* --- Ground Handling Module --- */
.page-gh, .page-gh-form, .page-gh-view {
  background: #f8fafc;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}

.page-header p {
  color: #64748b;
  font-size: 0.95rem;
}

.btn-primary {
  background: #0ea5e9;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

.gh-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.gh-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.gh-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.gh-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  outline: none;
}

.gh-filter-pills {
  display: flex;
  gap: 0.5rem;
}

.filter-pill {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill.active {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
}

.gh-table-container {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gh-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.gh-table th {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

.gh-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  color: #334155;
}

.gh-table tr:last-child td {
  border-bottom: none;
}

.gh-table tbody tr {
  cursor: pointer;
  transition: background 0.2s;
}

.gh-table tbody tr:hover {
  background: #f8fafc;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-planned { background: #e0f2fe; color: #0369a1; }
.status-in-progress { background: #fef9c3; color: #854d0e; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.cell-strong { font-weight: 700; color: #0f172a; }
.cell-sub { font-size: 0.8rem; color: #64748b; margin-top: 2px; }

/* Form Card */
.form-card {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 2.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.form-header { margin-bottom: 2rem; }
.form-header h1 { font-size: 1.5rem; font-weight: 800; color: #0f172a; }
.form-header p { color: #64748b; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0ea5e9;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f1f5f9;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.gh-form input, .gh-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.gh-form input:focus, .gh-form select:focus {
  border-color: #0ea5e9;
  background: white;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* View Flight Layout */
.gh-view-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

.gh-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.gh-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gh-card-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gh-card-body { padding: 1.5rem; }

.checklist-pills { display: flex; flex-direction: column; gap: 0.75rem; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 10px;
  transition: all 0.2s;
  color: #475569;
  font-weight: 600;
  font-size: 0.9rem;
}

.checklist-item:hover {
  background: #f1f5f9;
  color: #0ea5e9;
}

.checklist-item i:first-child { font-size: 1.25rem; color: #94a3b8; }
.checklist-item i:last-child { margin-left: auto; font-size: 0.8rem; }
@media (max-width: 1024px) {
  .gh-view-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}