/* ============================================================
   FarEye Reimbursement Portal — Main Stylesheet
   Clean, professional, corporate
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --navy:       #1B3A6B;
  --navy-light: #2E5AA8;
  --accent:     #E8F0FE;
  --success:    #15803D;
  --success-bg: #DCFCE7;
  --danger:     #B91C1C;
  --danger-bg:  #FEE2E2;
  --warn:       #B45309;
  --warn-bg:    #FEF3C7;
  --info:       #1D4ED8;
  --info-bg:    #DBEAFE;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-400:   #9CA3AF;
  --gray-600:   #4B5563;
  --gray-800:   #1F2937;
  --white:      #FFFFFF;
  --radius:     10px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.13);
  --font:       'DM Sans', sans-serif;
  --mono:       'DM Mono', monospace;
  --sidebar-w:  260px;
  --transition: .2s ease;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand .logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #fff;
}
.sidebar-brand .logo-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: #60A5FA;
  text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sidebar-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-weight: 600; color: rgba(255,255,255,.9); font-size: .85rem; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .5px; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 28px 32px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--navy); }
.card-body { padding: 24px; }

/* ── Stat cards ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-400); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 4px; }
.stat-sub { font-size: .78rem; color: var(--gray-400); }
.stat-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .7rem; font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  border: none; border-radius: 7px; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
  line-height: 1;
}
.btn-primary   { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); color: #fff; text-decoration: none; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline   { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--accent); }
.btn-sm        { padding: 6px 12px; font-size: .8rem; }
.btn-icon      { padding: 8px; border-radius: 7px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-label span.req { color: var(--danger); margin-left: 2px; }

.form-control, .form-select {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font); font-size: .875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  background: var(--white);
  color: var(--gray-800);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(46,90,168,.12);
}
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.input-group { display: flex; }
.input-group .form-control { border-radius: 7px 0 0 7px; flex: 1; }
.input-group .input-addon {
  padding: 9px 12px;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200); border-left: none;
  border-radius: 0 7px 7px 0;
  font-size: .82rem; color: var(--gray-600); font-weight: 500;
  display: flex; align-items: center;
}

/* File upload */
.file-drop {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
}
.file-drop:hover, .file-drop.dragover { border-color: var(--navy-light); background: var(--accent); }
.file-drop input[type=file] { display: none; }
.file-drop-icon { font-size: 2rem; margin-bottom: 8px; }
.file-drop-text { font-size: .85rem; color: var(--gray-600); }
.file-drop-hint { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 13px 16px; color: var(--gray-800); vertical-align: middle; }
.mono { font-family: var(--mono); font-size: .82rem; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
}
.badge-pending  { background: var(--warn-bg);    color: var(--warn); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg);  color: var(--danger); }
.badge-more_info{ background: var(--info-bg);    color: var(--info); }

/* ── Alert ───────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 7px; font-size: .875rem; margin-bottom: 18px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger   { background: var(--danger-bg);  color: var(--danger); }
.alert-info     { background: var(--info-bg);    color: var(--info); }
.alert-warn     { background: var(--warn-bg);    color: var(--warn); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1B3A6B 0%, #2E5AA8 60%, #3b82f6 100%);
}
.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.login-logo p  { color: var(--gray-400); font-size: .82rem; margin-top: 4px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 14px;
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.modal-close { cursor: pointer; color: var(--gray-400); font-size: 1.3rem; border: none; background: none; }
.modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 150px; }

/* ── Responsive ──────────────────────────────────────────── */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--navy); }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
}
