/* StaLyx Mail M365 Enterprise Portal Styles */

:root {
  --bg-main: #020617;
  --bg-card: #0F172A;
  --bg-card-hover: #1E293B;
  --border: #334155;
  --border-subtle: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --accent: #38BDF8;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #020617;
  color: #F8FAFC;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ================= CRITICAL LAYOUT & LOGO STYLING ================= */
.hidden {
  display: none !important;
}

.brand-logo-icon {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #0F172A !important;
  border: 1px solid #1E293B !important;
  border-radius: 0.75rem !important;
  padding: 5px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.brand-logo-icon svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  display: block !important;
}

/* Header */
.app-header {
  border-bottom: 1px solid #1E293B;
  background-color: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
}

/* Fallback Flex & Grid Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.max-w-7xl {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

.max-w-md {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

/* Form Controls */
.form-input {
  width: 100%;
  background-color: #020617;
  border: 1px solid #334155;
  color: #F8FAFC;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
}

.form-input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border: 1px solid #3B82F6;
  border-radius: 0.75rem;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: #1E293B;
  color: #CBD5E1;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: #334155;
  color: #FFFFFF;
}

.btn-tool {
  background: #020617;
  border: 1px solid #334155;
  color: #94A3B8;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool:hover {
  border-color: #38BDF8;
  color: #FFFFFF;
}

/* Navigation Tabs */
.portal-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  padding: 0.5rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.portal-tab:hover {
  color: #FFFFFF;
  background: rgba(30, 41, 59, 0.6);
}

.portal-tab.active {
  background: #1E293B;
  border-color: #334155;
  color: #38BDF8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Metric Cards */
.metric-card {
  background-color: #0F172A;
  border: 1px solid #1E293B;
  border-radius: 1.25rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.metric-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

/* Modals */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.app-modal.hidden {
  display: none !important;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 10;
  background-color: #0F172A;
  border: 1px solid #334155;
  border-radius: 1.5rem;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalEnter 0.2s ease-out;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

th {
  text-align: left;
  padding: 0.75rem 1rem;
  color: #64748B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: 1px solid #1E293B;
  letter-spacing: 0.05em;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1E293B;
  color: #E2E8F0;
}

tr:hover td {
  background-color: rgba(30, 41, 59, 0.4);
}

/* Chips */
.chip-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chip-group.selected {
  background: #1D4ED8;
  color: #FFFFFF;
  border: 1px solid #3B82F6;
}

.chip-group.unselected {
  background: #1E293B;
  color: #94A3B8;
  border: 1px solid #334155;
}

.chip-group:hover {
  border-color: #38BDF8;
}
