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

:root {
  --bg-primary: #f5f5f5;
  --bg-white: #ffffff;
  --bg-hero: #00256F;
  --border: #e5e5e5;
  --border-hover: #BCBEC0;
  --text-primary: #111111;
  --text-secondary: #414042;
  --text-muted: #808285;
  --text-on-dark: #ffffff;
  --cm-dark-blue: #00256F;
  --cm-blue: #0052F6;
  --cm-light-blue: #007BDB;
  --cm-gold: #92752E;
  --green: #16a34a;
  --amber: #92752E;
  --red: #dc2626;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ---- LOGIN ---- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg-hero);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-white);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
  width: 160px;
  margin-bottom: 24px;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: var(--cm-dark-blue);
}

.login-card h1 span {
  color: var(--cm-blue);
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 36px;
}

.login-card form { text-align: left; }

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--cm-blue);
  box-shadow: 0 0 0 3px rgba(0, 82, 246, 0.15);
}

.form-group input::placeholder { color: var(--text-muted); }

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--cm-blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.login-btn:hover {
  background: var(--cm-dark-blue);
  box-shadow: 0 4px 16px rgba(0, 37, 111, 0.3);
}

.login-btn:active { transform: scale(0.99); }

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

.login-footer {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
  text-align: center;
}

/* ---- DASHBOARD ---- */
.dash-hero {
  background: var(--bg-hero);
  padding: 16px 24px;
  color: var(--text-on-dark);
}

.dash-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-logo {
  width: 72px;
}

.dash-hero h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-on-dark);
}

.dash-hero h1 span {
  opacity: 0.7;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  padding: 8px 20px 8px 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cm-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.user-info { line-height: 1.3; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text-on-dark); }
.user-role { font-size: 11px; color: rgba(255, 255, 255, 0.6); text-transform: uppercase; letter-spacing: 0.5px; }

.logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; border-color: rgba(255, 255, 255, 0.5); }

.greeting-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.greeting-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.greeting-clock {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dashboard-body {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  flex: 1;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
  margin-top: 32px;
}

/* Main app cards — half width each */
.main-apps-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.main-app-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.main-app-card:hover {
  box-shadow: 0 8px 24px var(--card-shadow, rgba(0, 0, 0, 0.08));
  border-color: var(--card-accent, var(--cm-blue));
}

.main-app-card::before {
  content: '';
  display: block;
  height: 4px;
  background: var(--card-accent, var(--cm-blue));
}

.main-app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.main-app-header:hover {
  background: var(--bg-primary);
}

.main-app-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-accent-bg, rgba(0, 82, 246, 0.08));
  border-radius: 10px;
  flex-shrink: 0;
}

.main-app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.main-app-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.main-app-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.main-app-header:hover .main-app-arrow {
  transform: translateX(4px);
  color: var(--cm-blue);
}

.main-app-links {
  display: flex;
  flex-direction: column;
}

.app-quick-link {
  display: block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: all 0.15s;
}

.app-quick-link:last-child {
  border-bottom: none;
}

.app-quick-link:hover {
  background: var(--bg-primary);
  color: var(--cm-blue);
  padding-left: 30px;
}

/* Small cards for coming soon + admin */
.small-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.app-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--cm-blue));
  opacity: 1;
}

.app-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: var(--card-accent-bg, rgba(0, 82, 246, 0.08));
}

.app-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.app-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.app-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0); }
}

.status-dot.coming-soon { background: var(--amber); }
.status-dot.offline { background: var(--red); }

/* Card color variants — vibrant top bars */
.app-card.blue, .main-app-card.blue { --card-accent: #0052F6; --card-accent-bg: rgba(0, 82, 246, 0.08); --card-shadow: rgba(0, 82, 246, 0.15); }
.app-card.emerald, .main-app-card.emerald { --card-accent: #16a34a; --card-accent-bg: rgba(22, 163, 74, 0.08); --card-shadow: rgba(22, 163, 74, 0.15); }
.app-card.cyan, .main-app-card.cyan { --card-accent: #007BDB; --card-accent-bg: rgba(0, 123, 219, 0.08); --card-shadow: rgba(0, 123, 219, 0.15); }
.app-card.amber, .main-app-card.amber { --card-accent: #92752E; --card-accent-bg: rgba(146, 117, 46, 0.08); --card-shadow: rgba(146, 117, 46, 0.15); }
.app-card.rose, .main-app-card.rose { --card-accent: #dc2626; --card-accent-bg: rgba(220, 38, 38, 0.08); --card-shadow: rgba(220, 38, 38, 0.15); }
.app-card.violet, .main-app-card.violet { --card-accent: #7c3aed; --card-accent-bg: rgba(124, 58, 237, 0.08); --card-shadow: rgba(124, 58, 237, 0.15); }
.app-card.gold, .main-app-card.gold { --card-accent: #92752E; --card-accent-bg: rgba(146, 117, 46, 0.08); --card-shadow: rgba(146, 117, 46, 0.15); }
.app-card.navy, .main-app-card.navy { --card-accent: #00256F; --card-accent-bg: rgba(0, 37, 111, 0.08); --card-shadow: rgba(0, 37, 111, 0.15); }

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 32px;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.quick-link:hover {
  border-color: var(--cm-blue);
  color: var(--cm-blue);
  box-shadow: 0 2px 8px rgba(0, 82, 246, 0.1);
}

.dash-footer {
  text-align: center;
  padding: 32px 0 24px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
}

.dash-footer .made-with {
  opacity: 0.5;
  margin-bottom: 4px;
}

.dash-footer .easter-egg {
  opacity: 0.2;
  font-size: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .login-card { padding: 36px 28px; }
  .dash-hero-inner { flex-direction: column; gap: 16px; align-items: flex-start; }
  .dashboard-body { padding: 0 16px 24px; }
  .main-apps-row { grid-template-columns: 1fr; }
  .small-grid { grid-template-columns: 1fr 1fr; }
}

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