/* ============================================================
   HR Suite - Stylesheet
   Palette matches the HR Officer Playbook deck:
   Charcoal #36454F, Safety Orange #FF6B35, Off-white #F2F2F2
   ============================================================ */

:root {
  --charcoal: #36454F;
  --charcoal-d: #232D34;
  --orange: #FF6B35;
  --orange-tint: #FFE4D6;
  --offwhite: #F2F2F2;
  --white: #FFFFFF;
  --text-dark: #262626;
  --grey-text: #5B6670;
  --border: #E2E5E8;
  --green-bg: #E8F5E9; --green-fg: #2E7D32;
  --amber-bg: #FFF3E0; --amber-fg: #E65100;
  --red-bg: #FFEBEE; --red-fg: #C62828;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Calibri, Arial, sans-serif;
  background: var(--offwhite);
  color: var(--text-dark);
  font-size: 14.5px;
}

a { color: inherit; text-decoration: none; }

/* ---- Auth screens ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal);
  background-image: radial-gradient(circle at 85% -10%, #4a5a66 0%, var(--charcoal) 55%);
}
.auth-card {
  width: 380px;
  background: var(--white);
  border-radius: 10px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.auth-logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--orange); display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 20px; margin-bottom: 18px;
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card p.sub { color: var(--grey-text); margin: 0 0 24px; font-size: 13px; }

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--charcoal);
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .dot {
  width: 34px; height: 34px; border-radius: 50%; background: var(--orange);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.sidebar-brand .name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.sidebar-brand .name small { display: block; font-weight: 400; color: #B7C0C7; font-size: 11px; }

.sidebar nav { padding: 14px 10px; overflow-y: auto; flex: 1; }
.sidebar .section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #8A97A0;
  padding: 14px 10px 6px;
}
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px; color: #D8DEE3; font-size: 13.5px;
  margin-bottom: 2px;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar a.nav-link.active { background: var(--orange); color: white; font-weight: 600; }
.sidebar a.nav-link .ic { width: 18px; text-align: center; opacity: 0.9; }

.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: #9AA6AD; }
.sidebar-foot a { color: var(--orange-tint); }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; margin: 0; font-family: Cambria, Georgia, serif; }
.topbar .crumbs { font-size: 12px; color: var(--grey-text); margin-top: 2px; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topbar .user-chip .initials {
  width: 32px; height: 32px; border-radius: 50%; background: var(--orange-tint); color: var(--orange);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
.topbar .logout-link { color: var(--grey-text); font-size: 12.5px; margin-left: 6px; }

.content { padding: 24px 28px 60px; }

/* ---- Flash messages ---- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.flash.success { background: var(--green-bg); color: var(--green-fg); }
.flash.error { background: var(--red-bg); color: var(--red-fg); }
.flash.info { background: #E3F2FD; color: #1565C0; }

/* ---- Cards / grid ---- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: white; border-radius: 10px; border: 1px solid var(--border);
  padding: 20px;
}
.card h3 { margin: 0 0 4px; font-size: 14px; }
.card .big-stat { font-size: 30px; font-weight: 700; color: var(--charcoal); font-family: Cambria, Georgia, serif; }
.card .stat-label { font-size: 12px; color: var(--grey-text); }
.card.accent { border-top: 3px solid var(--orange); }

.section-title {
  font-family: Cambria, Georgia, serif; font-size: 18px; margin: 28px 0 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title:first-child { margin-top: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; background: var(--charcoal); color: white;
}
.btn:hover { opacity: 0.92; }
.btn.btn-primary { background: var(--orange); }
.btn.btn-outline { background: white; color: var(--charcoal); border-color: var(--border); }
.btn.btn-outline:hover { background: var(--offwhite); }
.btn.btn-danger { background: #C62828; }
.btn.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- Tables ---- */
table.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; }
table.data-table thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--grey-text); background: var(--offwhite); padding: 11px 14px; border-bottom: 1px solid var(--border);
}
table.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #FAFBFC; }
.table-wrap { background: white; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.table-wrap table.data-table { border: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: span 2; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--charcoal); }
.form-group .hint { font-size: 11px; color: var(--grey-text); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], select, textarea {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 13.5px;
  font-family: inherit; background: white; color: var(--text-dark);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 0 0 20px; }
fieldset legend { font-weight: 700; font-size: 13.5px; padding: 0 8px; color: var(--charcoal); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--grey-text); }
.empty-state .ic { font-size: 34px; margin-bottom: 10px; }

.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.small-muted { font-size: 12px; color: var(--grey-text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--grey-text); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--orange); border-bottom-color: var(--orange); }

.kpi-strip { display: flex; gap: 14px; flex-wrap: wrap; }
.kpi-strip .card { flex: 1; min-width: 160px; }

@media (max-width: 980px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .form-grid, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0 !important; }
  body { background: white; }
}
