@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg: #f5f5f3;
  --white: #ffffff;
  --black: #09090b;
  --zinc-950: #09090b;
  --zinc-900: #18181b;
  --zinc-800: #27272a;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;
  --zinc-300: #d4d4d8;
  --zinc-200: #e4e4e7;
  --zinc-100: #f4f4f5;
  --zinc-50: #fafafa;
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 80px rgba(0,0,0,0.10);
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── LAYOUT ── */
.page { display: none; }
.page.active { display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 1.5rem; }
.container-md { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

/* ── NAVBAR ── */
.navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--zinc-200);
  position: sticky; top: 0; z-index: 100;
  padding: 0 1.5rem;
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.navbar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 800; font-size: 1.1rem; color: var(--black);
  text-decoration: none;
}
.navbar-brand .brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--black); display: inline-block;
}
.navbar-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.45rem 0.85rem; border-radius: 0.6rem;
  font-size: 0.875rem; font-weight: 500; color: var(--zinc-600);
  text-decoration: none; cursor: pointer; border: none; background: none;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active { background: var(--zinc-100); color: var(--black); }
.navbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.badge-role {
  padding: 0.3rem 0.75rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 600;
  background: var(--zinc-950); color: white;
}
.badge-role.admin { background: var(--zinc-950); }
.badge-role.user { background: var(--zinc-700); }

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}
.card-dark {
  background: var(--zinc-950);
  border: 1px solid var(--zinc-800);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  color: white;
  padding: 2rem;
}
.card-sm { padding: 1.25rem; border-radius: var(--radius-lg); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.65rem 1.4rem; border-radius: 99px;
  font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--zinc-950); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--zinc-800); }
.btn-outline {
  background: transparent; color: var(--zinc-950);
  border: 1.5px solid var(--zinc-300);
}
.btn-outline:hover:not(:disabled) { border-color: var(--zinc-950); }
.btn-ghost { background: var(--zinc-100); color: var(--zinc-700); }
.btn-ghost:hover:not(:disabled) { background: var(--zinc-200); }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-icon {
  padding: 0.55rem; border-radius: var(--radius-sm);
  background: var(--zinc-100); border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--zinc-600); transition: background 0.15s;
}
.btn-icon:hover { background: var(--zinc-200); }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.8rem; font-weight: 600;
  color: var(--zinc-700); letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 0.4rem;
}
.form-control {
  width: 100%; padding: 0.7rem 1rem;
  border: 1.5px solid var(--zinc-200); border-radius: var(--radius-md);
  font-size: 0.9rem; font-family: inherit; color: var(--black);
  background: var(--white); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--zinc-950);
  box-shadow: 0 0 0 3px rgba(9,9,11,0.08);
}
.form-control::placeholder { color: var(--zinc-400); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' 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; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar-nav { display: none; }
  .card { padding: 1.25rem; }
}

/* ── STAT CARD ── */
.stat-card {
  background: var(--white); border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg); padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--zinc-950); color: white;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.25rem;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--zinc-500); font-weight: 500; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--zinc-200); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { background: var(--zinc-50); border-bottom: 1px solid var(--zinc-200); }
th {
  padding: 0.85rem 1rem; text-align: left;
  font-weight: 600; color: var(--zinc-600); font-size: 0.8rem;
  letter-spacing: 0.05em; text-transform: uppercase;
}
td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--zinc-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--zinc-50); }

/* ── STATUS BADGE ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 600;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* ── LEAVE TYPE BADGE ── */
.leave-badge {
  padding: 0.25rem 0.65rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 600;
  background: var(--zinc-100); color: var(--zinc-700);
}

/* ── HERO (LANDING) ── */
.hero { padding: 4rem 0 2rem; }
.hero h1 { font-size: clamp(2.5rem,6vw,4.5rem); font-weight: 900; line-height: 1.08; letter-spacing: -0.03em; }
.hero h1 span { color: var(--zinc-500); }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 1rem; border-radius: 99px;
  border: 1px solid var(--zinc-200); background: var(--zinc-50);
  font-size: 0.8rem; font-weight: 500; color: var(--zinc-600);
}

/* ── SIGNATURE PAD ── */
.sig-pad-wrap {
  border: 2px dashed var(--zinc-300); border-radius: var(--radius-lg);
  background: var(--zinc-50); overflow: hidden; position: relative;
}
#sig-canvas { display: block; cursor: crosshair; touch-action: none; }
.sig-actions { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--zinc-200); }

/* ── TABS ── */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--zinc-200); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.65rem 1.1rem; border: none; background: none;
  font-size: 0.875rem; font-weight: 500; color: var(--zinc-500);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.15s;
}
.tab-btn.active { color: var(--black); border-bottom-color: var(--black); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(9,9,11,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-xl);
  box-shadow: 0 40px 120px rgba(0,0,0,0.25);
  width: 100%; max-width: 600px; max-height: 90vh;
  overflow-y: auto; padding: 2rem;
  transform: translateY(20px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.4rem; font-weight: 800; }
.modal-close { background: var(--zinc-100); border: none; border-radius: var(--radius-sm); padding: 0.4rem; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--zinc-500); }
.modal-close:hover { background: var(--zinc-200); }

/* ── UTILS ── */
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.text-sm { font-size: 0.875rem; } .text-xs { font-size: 0.75rem; }
.text-muted { color: var(--zinc-500); }
.text-white { color: white; }
.font-bold { font-weight: 700; } .font-black { font-weight: 900; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--zinc-200); margin: 1.5rem 0; }
.section-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--zinc-400); margin-bottom: 1rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--zinc-950); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--zinc-400); }
.empty-state svg { margin: 0 auto 1rem; opacity: 0.3; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--white); border: 1.5px solid var(--zinc-200);
  border-radius: var(--radius-md); padding: 0.55rem 1rem;
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--zinc-950); }
.search-bar input { border: none; outline: none; background: none; font-size: 0.875rem; width: 100%; font-family: inherit; }

/* ── FILTER CHIPS ── */
.filter-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-chip {
  padding: 0.35rem 0.85rem; border-radius: 99px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--zinc-200); background: var(--white);
  color: var(--zinc-600); transition: all 0.12s;
}
.filter-chip.active { background: var(--zinc-950); color: white; border-color: var(--zinc-950); }

/* ── SIDEBAR (Admin) ── */
.layout-sidebar { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; padding: 1.5rem; min-height: calc(100vh - 64px); }
@media (max-width: 900px) { .layout-sidebar { grid-template-columns: 1fr; } .sidebar { display: none; } }
.sidebar { background: var(--white); border: 1px solid var(--zinc-200); border-radius: var(--radius-xl); padding: 1.25rem; height: fit-content; position: sticky; top: 80px; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--zinc-600);
  cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; transition: background 0.12s, color 0.12s;
}
.sidebar-item:hover, .sidebar-item.active { background: var(--zinc-100); color: var(--black); }
.sidebar-item svg { flex-shrink: 0; }

/* ── PDF PREVIEW ── */
.pdf-preview-box {
  background: white; border: 1px solid var(--zinc-200);
  border-radius: var(--radius-lg); padding: 2rem;
  font-family: 'Times New Roman', serif;
  line-height: 1.7; color: #000;
}
.pdf-preview-box h2 { text-align: center; font-size: 1.2rem; margin-bottom: 0.25rem; }
.pdf-preview-box .pdf-sub { text-align: center; font-size: 0.9rem; margin-bottom: 2rem; }
.pdf-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.pdf-table td, .pdf-table th { border: 1px solid #ccc; padding: 0.5rem 0.75rem; font-size: 0.88rem; }
.sig-img { max-width: 160px; max-height: 80px; }

/* ── FADE IN ── */
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ── LOADING SCREEN ── */
#loading-screen {
  position: fixed; inset: 0; background: var(--white);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; flex-direction: column; gap: 1rem;
}
.loading-logo { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--zinc-950); display: flex; align-items: center; justify-content: center; }
.loading-bar { width: 200px; height: 3px; background: var(--zinc-100); border-radius: 99px; overflow: hidden; }
.loading-bar-inner { height: 100%; background: var(--zinc-950); border-radius: 99px; animation: loadBar 1.2s ease-in-out infinite; }
@keyframes loadBar { 0%{width:0%;margin-left:0} 50%{width:60%;margin-left:20%} 100%{width:0%;margin-left:100%} }
