/* LeaveFlow - Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #0077B3;
  --primary-dark: #005c8a;
  --secondary: #A3D1E0;
  --background: #F0F8FF;
  --surface: #E0F7FA;
  --card: #FFFFFF;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

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

html, body {
  font-family: 'Poppins', 'Inter', sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ------- Auth Pages ------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background);
}

.auth-card {
  background: var(--card);
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.auth-card .brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-card .brand h1 {
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
}
.auth-card .brand p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 179, 0.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--primary); }
.btn-secondary:hover { background: var(--secondary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; }

.auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

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

.sidebar {
  width: 250px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  z-index: 20;
}

.sidebar .logo {
  padding: 0 12px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar .logo h2 {
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
}
.sidebar .logo span {
  font-size: 12px;
  color: var(--text-muted);
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--surface); text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.nav a .icon { width: 18px; text-align: center; }

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 14px 6px;
  letter-spacing: 0.05em;
}

.sidebar .logout-btn {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.main {
  margin-left: 250px;
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.topbar h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* ------- Cards / Stats ------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card .label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-card .value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text);
}
.stat-card.warn { border-left-color: var(--warning); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger { border-left-color: var(--danger); }

/* Panel */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.panel h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.quick-action {
  background: var(--surface);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text);
}
.quick-action:hover {
  background: var(--secondary);
  border-color: var(--primary);
  text-decoration: none;
}
.quick-action .qi { font-size: 22px; margin-bottom: 6px; display: block; }
.quick-action .qt { font-weight: 500; font-size: 14px; }

/* ------- Tables ------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
thead {
  background: var(--surface);
}
th, td {
  text-align: left;
  padding: 13px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}
tbody tr:hover { background: #f9fbfd; }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Profile */
.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.profile-card .avatar {
  width: 72px; height: 72px;
  font-size: 26px;
}
.profile-info h3 { font-size: 20px; font-weight: 600; }
.profile-info p { color: var(--text-muted); font-size: 14px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.info-item {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 8px;
}
.info-item .k { font-size: 12px; color: var(--text-muted); }
.info-item .v { font-size: 15px; font-weight: 500; margin-top: 3px; }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 15;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px; }
  .menu-toggle { display: inline-flex; }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 500px) {
  .topbar .user .name-txt { display: none; }
  .auth-card { padding: 28px 22px; }
}
