/* JelHR System – Shared styles */
:root {
  --bg: #F5F2EB;
  --card: #FFFBEB;
  --card-white: #FFFFFF;
  --ink: #111111;
  --muted: rgba(0,0,0,0.5);
  --muted-2: rgba(0,0,0,0.35);
  --accent: #FFE066;
  --border: rgba(0,0,0,0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #111;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #111;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav a.active {
  background: var(--accent);
  color: #111;
}

.nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-footer {
  padding: 1rem 0.75rem 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 1rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}

.user-chip img, .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333;
  object-fit: cover;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.user-meta { font-size: 12px; }
.user-meta .name { font-weight: 600; }
.user-meta .role { color: rgba(255,255,255,0.45); font-size: 11px; }

/* Main */
.main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.75rem 2rem;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-header h1 em {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
}

.page-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.1s, background 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-dark {
  background: #111;
  color: #fff;
}

.btn-dark:hover { background: #000; }

.btn-light {
  background: #fff;
  border: 1px solid var(--border);
  color: #111;
}

.btn-accent {
  background: var(--accent);
  color: #111;
}

/* Cards & grid */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 1rem; }
}

.card {
  background: var(--card-white);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  padding: 1.25rem;
}

.card-cream {
  background: var(--card);
}

.card-dark {
  background: #111;
  color: #fff;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 14px;
  font-weight: 600;
}

.stat {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: #DCFCE7; color: #166534; }
.badge-yellow { background: var(--accent); color: #111; }
.badge-gray { background: #F3F4F6; color: #374151; }
.badge-red { background: #FEE2E2; color: #991B1B; }

.progress {
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.list-row:hover { background: rgba(0,0,0,0.03); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 13px;
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  justify-content: space-around;
}

.mobile-nav a {
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
}

.mobile-nav a.active {
  color: var(--accent);
}

@media (max-width: 640px) {
  .mobile-nav { display: flex; }
  .main { padding-bottom: 5rem; }
}
