@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink:        #F6F6FB;
  --surface:    #FFFFFF;
  --surface-2:  #F1F1F7;
  --border:     #E4E4EF;
  --brand:      #6C63F7;
  --brand-soft: #4F46E5;
  --brand-dim:  rgba(108, 99, 247, 0.09);
  --gold:       #CA8A04;
  --good:       #059669;
  --bad:        #DC2626;
  --text:       #16172E;
  --text-dim:   #62637F;
  --text-faint: #9899AE;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(30,30,70,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(108,99,247,0.08), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(202,138,4,0.05), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(108,99,247,0.05), transparent 50%);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

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

::selection { background: var(--brand); color: white; }

/* ---------- Layout shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(255,255,255,0.75);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 24px;
}
.sidebar .brand img { height: 26px; width: auto; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--brand-dim); color: var(--brand-soft); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-chevron {
  width: 14px; height: 14px;
  opacity: 0.5;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.main {
  padding: 32px 40px 80px;
  max-width: 1100px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.topbar h1 { font-size: 24px; }
.topbar .subtitle { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

/* ---------- Chevron divider — echoes the logo mark ---------- */
.chevron-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 16px;
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chevron-divider::before {
  content: "";
  width: 12px; height: 12px;
  background: var(--brand);
  clip-path: polygon(0 0, 50% 45%, 100% 0, 100% 25%, 50% 70%, 0 25%);
}
.chevron-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.stat-card .label { color: var(--text-dim); font-size: 13px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: rgba(251,113,133,0.14); color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
label { font-size: 13px; color: var(--text-dim); font-weight: 500; display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-active { background: rgba(94,234,212,0.14); color: var(--good); }
.badge-inactive { background: rgba(251,113,133,0.14); color: var(--bad); }
.badge-pending { background: rgba(255,209,102,0.14); color: var(--gold); }
.badge-role { background: var(--brand-dim); color: var(--brand-soft); }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand-soft);
  flex-shrink: 0;
}

/* ---------- Employee directory cards ---------- */
.employee-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.employee-card:hover { border-color: var(--brand); }
.employee-card .name { font-weight: 600; font-size: 15px; }
.employee-card .meta { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Wall feed ---------- */
.wall-post {
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.wall-post::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.wall-post.birthday {
  background: linear-gradient(120deg, rgba(255,180,40,0.14), var(--surface) 55%);
  border-color: rgba(255,180,40,0.4);
}
.wall-post.birthday::before { background: linear-gradient(180deg, #FFB020, #FF7A5C); }
.wall-post.anniversary {
  background: linear-gradient(120deg, rgba(108,99,247,0.14), var(--surface) 55%);
  border-color: rgba(108,99,247,0.4);
}
.wall-post.anniversary::before { background: linear-gradient(180deg, #6C63F7, #9B5CF7); }
.wall-post .title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; }
.wall-post .body-text { color: var(--text-dim); font-size: 14px; margin-top: 4px; line-height: 1.5; }
.wall-post .timestamp { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); margin-top: 8px; }

/* ---------- Celebration banner (Wall "coming up this week") ---------- */
.celebration-banner {
  position: relative;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 20%, rgba(255,180,40,0.16), transparent 45%),
    radial-gradient(circle at 92% 15%, rgba(108,99,247,0.18), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(255,122,92,0.10), transparent 50%),
    var(--surface);
  border: 1px solid var(--border);
}
.celebration-banner .confetti-dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
}
.celebration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  position: relative;
  z-index: 1;
}
.celebration-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.celebration-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 24px rgba(30,30,70,0.12);
}
.celebration-card .ring {
  border-radius: 50%;
  padding: 2px;
  flex-shrink: 0;
}
.celebration-card .ring.birthday { background: linear-gradient(135deg, #FFB020, #FF7A5C); }
.celebration-card .ring.anniversary { background: linear-gradient(135deg, #6C63F7, #9B5CF7); }
.celebration-card .name { font-weight: 700; font-size: 14.5px; }
.celebration-card .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}
.celebration-card .chip.birthday { color: #D97706; }
.celebration-card .chip.anniversary { color: var(--brand-soft); }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 380px;
  text-align: center;
  box-shadow: var(--shadow);
}
.login-card img.logo { height: 40px; margin-bottom: 22px; }
.login-card p { color: var(--text-dim); font-size: 14px; margin: 10px 0 26px; }
.login-error { color: var(--bad); font-size: 13px; margin-top: 16px; min-height: 18px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

/* ---------- Page header accent ---------- */
.page-glow {
  position: relative;
  padding-bottom: 4px;
}
.page-glow::before {
  content: "";
  position: absolute;
  top: -60px; left: -60px;
  width: 260px; height: 200px;
  background: radial-gradient(circle, rgba(112,112,249,0.25), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Card lift on hover for anything clickable */
.card, .employee-card {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
a.employee-card:hover, a.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(30,30,70,0.14);
}
.btn-primary {
  box-shadow: 0 4px 18px rgba(112,112,249,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(112,112,249,0.5); }

/* ---------- Segmented tabs (List / Calendar, etc.) ---------- */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button.active { background: var(--brand); color: white; }
.segmented button:not(.active):hover { background: var(--surface); color: var(--text); }

/* ---------- Editable field (HR edit mode) ---------- */
.edit-field { margin-bottom: 14px; }
.edit-field label { display: block; margin-bottom: 5px; }
.view-value {
  font-size: 14.5px;
  padding: 9px 0;
}
.field-row { display: flex; align-items: center; gap: 10px; }

/* ---------- Leave calendar ---------- */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-header h3 { font-size: 17px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  padding-bottom: 4px;
}
.cal-day {
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-day.outside { opacity: 0.35; }
.cal-day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.cal-day .daynum { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.cal-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--brand-dim);
  color: var(--brand-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip.sick { background: rgba(251,113,133,0.16); color: var(--bad); }
.cal-chip.emergency { background: rgba(255,209,102,0.18); color: var(--gold); }
.cal-more { font-size: 10px; color: var(--text-faint); }

/* ---------- Query cards ---------- */
.query-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--surface);
}
.query-card .subject { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.query-card .message { color: var(--text-dim); font-size: 14px; margin-top: 6px; line-height: 1.5; }
.query-card .response-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  background: var(--brand-dim);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
}
.badge-open { background: rgba(255,209,102,0.14); color: var(--gold); }
.badge-resolved { background: rgba(94,234,212,0.14); color: var(--good); }
.badge-high { background: rgba(220,38,38,0.10); color: var(--bad); }
.badge-medium { background: rgba(202,138,4,0.10); color: var(--gold); }
.badge-low { background: rgba(98,99,127,0.10); color: var(--text-dim); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state .chevron-mark { width: 32px; height: 32px; margin: 0 auto 14px; opacity: 0.4; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; }
  .sidebar-footer { display: none; }
  .main { padding: 20px; }
}
