/* ============================================
   GLOBE LIFE ENTERPRISE — BASE STYLES
   ============================================ */

:root {
  --navy: #152c48;
  --navy-dark: #0e1f33;
  --navy-light: #1e3d5f;
  --gold: #e8c840;
  --gold-light: #f5dc6e;
  --white: #ffffff;
  --off-white: #f4f6f9;
  --border: #dde3ea;
  --text: #1a2b42;
  --text-muted: #6b7e94;
  --success: #2e7d4f;
  --error: #c0392b;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
}

/* HEADER */
.header {
  background: var(--navy);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header img { height: 40px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.header-gold-bar {
  height: 3px;
  background: linear-gradient(90deg, #c8a951, #f5dc6e, #c8a951);
}

/* CARDS */
.card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* FORMS */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
}

.field input.error { border-color: var(--error); }

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  text-align: center;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover { background: var(--navy-light); }

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}

.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-outline:hover { background: var(--off-white); }

.btn-danger {
  background: var(--error);
  color: var(--white);
}

.btn-full { width: 100%; }

/* BADGES */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-active { background: #e6f4ed; color: var(--success); }
.badge-inactive { background: #fdecea; color: var(--error); }
.badge-gold { background: var(--gold); color: var(--navy); }
.badge-navy { background: var(--navy); color: var(--gold); }

/* ALERTS */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-success { background: #e6f4ed; color: var(--success); border-left: 3px solid var(--success); }
.alert-error { background: #fdecea; color: var(--error); border-left: 3px solid var(--error); }
.alert-info { background: #e8f0f8; color: var(--navy); border-left: 3px solid var(--navy); }

/* TABLES */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--off-white);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--off-white); }

/* LAYOUT */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container, .container-wide { padding: 16px 12px; }
}

/* LOGIN PAGE */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img { height: 48px; }

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

/* STAT CARDS */
.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SPINNER */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* TABS */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.tab-label-short { display: none; }

@media (max-width: 768px) {
  .tab {
    padding: 8px 11px;
    font-size: 12px;
  }
  .tab-label-short { display: inline; }
  .tab-label-full { display: none; }
}

.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21,44,72,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn { from{opacity:0} to{opacity:1} }
@keyframes modalSlideUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 12px 48px rgba(21,44,72,0.2);
  overflow: hidden;
  animation: modalSlideUp 0.25s ease;
}

.modal-title {
  background: linear-gradient(135deg, var(--navy), #1e3d5f);
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--white);
  padding: 20px 24px;
  margin-bottom: 0;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 24px 24px 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px 24px 24px;
  margin-top: 0;
}

/* UTILITY */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

.login-slogan {
  font-size: 0.9rem;
  font-weight: 700;
  color: #b89a3e;
  text-align: center;
  margin-top: -14px;
  margin-bottom: 90px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}


@media (max-width: 600px) {
  #statsRow {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  #mgmtStatsRow {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .globe-life-logo { display: none; }
  .header > div {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
  }
  .header-right {
    margin-left: auto;
  }
}