:root {
  --primary: #C97457;
  --primary-hover: #b05c40;
  --secondary: #10B981;
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --warning: #F59E0B;
  --bg-color: #F0EBE3;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-main: #333333;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --font-body: 'Lato', sans-serif;
  --font-headings: 'Montserrat', sans-serif;
  --brand-peach: #fcd8c6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
}

body {
  background: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

.filter-bar .form-control {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* Weekly calendar */
.weekly-calendar-wrapper { display: grid; gap: 0.85rem; }
.weekly-calendar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; }
.weekly-calendar-week { border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem; background: #F8FAFC; }
.weekly-calendar-week-title { font-size: 0.9rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.6rem; }
.weekly-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.weekly-calendar-day { min-height: 58px; border-radius: 8px; border: 1px solid #E2E8F0; background: white; padding: 0.3rem; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; }
.weekly-calendar-day.is-conflict { border-color: #FCA5A5; background: #FEF2F2; }
.weekly-calendar-day-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.weekly-calendar-day-number { font-size: 0.8rem; font-weight: 700; color: var(--text-main); }
.weekly-calendar-pill { font-size: 0.65rem; font-weight: 700; color: white; background: var(--primary); border-radius: 999px; padding: 0.15rem 0.35rem; }
.weekly-calendar-empty { height: 0.8rem; }

/* Dashboard Stats */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-total .stat-number { color: var(--primary); }
.stat-pending .stat-number { color: var(--warning); }
.stat-approved .stat-number { color: var(--secondary); }
.stat-rejected .stat-number { color: var(--danger); }
.stat-month .stat-number { color: #8B5CF6; }
.stat-employees .stat-number { color: #0EA5E9; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-headings); color: var(--text-main); margin-bottom: 1rem; }
p { color: var(--text-muted); line-height: 1.6; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  gap: 0.5rem;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 6px -1px rgba(201, 116, 87, 0.3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); transform: translateY(-2px); }

.btn-success { background: var(--secondary); color: white; }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f1f5f9; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* Forms */
.form-group { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-weight: 500; font-size: 0.9rem; color: var(--text-main); }
.form-control { padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 1rem; color: var(--text-main); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(201, 116, 87, 0.2); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.5rem; }

/* Tables */
.table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #F8FAFC; font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #F1F5F9; }

/* Badges */
.badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-pending { background: #FEF3C7; color: #D97706; }
.badge-approved { background: #D1FAE5; color: #059669; }
.badge-rejected { background: #FEE2E2; color: #DC2626; }

/* Navbar */
.navbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-brand { font-family: var(--font-headings); font-weight: 700; font-size: 1.25rem; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-main);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }

/* Detail modal styles */
.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text-main);
}

.detail-divider {
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

.reason-box {
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: pre-wrap;
}

.reject-reason-box {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reject-reason-box .detail-label {
  color: #DC2626;
}

.reject-reason-box p {
  color: #991B1B;
  font-size: 0.9rem;
  margin: 0;
}

/* Toasts */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  border-left: 4px solid var(--primary);
  pointer-events: all;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 380px;
}

.toast-visible { opacity: 1; transform: translateX(0); }
.toast-exit { opacity: 0; transform: translateX(100%); }

.toast-success { border-left-color: var(--secondary); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--primary); }

.toast-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--secondary); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-message { flex: 1; line-height: 1.3; }

.toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 0.15rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination .btn-sm {
  min-width: 36px;
  padding: 0.35rem 0.6rem;
}

.pagination-dots {
  padding: 0 0.3rem;
  color: var(--text-muted);
}

.pagination-info {
  margin-left: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Skeleton loading */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton-line {
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 8px, #e0e0e0 16px, #f0f0f0 24px);
  background-size: 200px 100%;
  animation: shimmer 1.2s infinite;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.5s ease forwards; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* Section headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h3 { margin-bottom: 0; }
.section-header p { margin: 0; }
.section-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .navbar { padding: 0.75rem 1rem; }
  .navbar-brand { font-size: 1rem; }
  .card { padding: 1.25rem; }
  .nav-toggle { display: block; }
  .nav-right { display: none; }
  .nav-right.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 1rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-group { width: 100%; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-actions { width: 100%; }
  .toast { max-width: calc(100vw - 2rem); }
  #toast-container { left: 1rem; }
}

@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  th, td { padding: 0.65rem 0.5rem; font-size: 0.85rem; }
}
/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.profile-group {
  display: flex;
  flex-direction: column;
}

.profile-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-group input {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
  background-color: #f8fafc;
}

.profile-group input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-large {
  max-width: 900px;
  width: 90%;
}
