:root {
  --primary-navy: #083d71;
  --primary-navy-dark: #052647;
  --primary-navy-light: #0d549b;
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --bg-slate: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(8, 61, 113, 0.08);
  --shadow-lg: 0 12px 30px rgba(8, 61, 113, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-slate);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.portal-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.portal-brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.portal-brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-navy);
  line-height: 1.2;
}

.portal-brand-text span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.portal-user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge-group {
  text-align: right;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-navy);
}

.user-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 2px;
}

.btn-signout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-signout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.portal-hero {
  background: linear-gradient(135deg, var(--primary-navy-dark) 0%, var(--primary-navy) 60%, var(--primary-navy-light) 100%);
  color: #ffffff;
  padding: 48px 24px;
}

.portal-hero-container {
  max-width: 1280px;
  margin: 0 auto;
}

.portal-hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.portal-hero-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 680px;
  line-height: 1.6;
}

/* ==========================================================================
   Main Grid
   ========================================================================== */
.portal-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

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

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.app-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.app-card.featured {
  border: 2px solid var(--primary-navy);
  box-shadow: var(--shadow-md);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  color: var(--primary-navy);
}

.app-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
}

.app-badge.success {
  background: #dcfce7;
  color: #15803d;
}

.app-badge.neutral {
  background: #f1f5f9;
  color: #475569;
}

.app-category {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-gold-hover);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 8px;
}

.app-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
  flex: 1;
}

.btn-launch-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary-navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(8, 61, 113, 0.2);
}

.btn-launch-app:hover {
  background: var(--primary-navy-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(8, 61, 113, 0.28);
}

.btn-launch-app.secondary {
  background: #f8fafc;
  color: var(--primary-navy);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.btn-launch-app.secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ==========================================================================
   Login View Styling
   ========================================================================== */
.portal-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, #052647 0%, #083d71 50%, #0d549b 100%);
}

.portal-login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  padding: 40px;
  position: relative;
}

.portal-login-header {
  text-align: center;
  margin-bottom: 28px;
}

.portal-login-header img {
  height: 64px;
  margin-bottom: 14px;
}

.portal-login-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1.2;
}

.portal-login-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.portal-form-group {
  margin-bottom: 20px;
}

.portal-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.portal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.portal-input-wrap input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.portal-input-wrap input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary-navy);
  box-shadow: 0 0 0 3px rgba(8, 61, 113, 0.15);
}

.btn-portal-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary-navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.btn-portal-submit:hover {
  background: var(--primary-navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.portal-input-wrap.has-toggle input {
  padding-right: 44px;
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.btn-toggle-eye:hover {
  color: var(--primary-navy);
}

.portal-security-notice {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}


.portal-error-alert {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 18px;
  text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.portal-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
