:root {
  --blue: #1769e0;
  --blue-dark: #0d47a1;
  --bg: #f4f8fd;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --white: #ffffff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card, .panel, .stats article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(23, 105, 224, 0.08);
}

.login-card { width: min(420px, 100%); padding: 32px; }
.login-card h1 { margin-top: 0; color: var(--blue-dark); }

label { display: grid; gap: 8px; font-weight: 650; color: var(--text); }
input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  resize: vertical;
  font: inherit;
}

button, .button-light {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button-light {
  display: inline-flex;
  align-items: center;
  background: #e8f1ff;
  color: var(--blue-dark);
}

.alert { background: #fff1f0; color: #b42318; padding: 12px; border-radius: 6px; }
.sidebar { display: none; }
.content { margin-left: 0; padding: 20px; }
.topbar { display: none; } /* Replaced by new header in partials_header */
.topbar h1 { margin: 4px 0 0; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stats article { padding: 22px; display: grid; gap: 10px; }
.stats span { color: var(--muted); }
.stats strong { font-size: 30px; color: var(--blue-dark); }
.panel { padding: 22px; margin-bottom: 20px; }
.panel h2 { margin-top: 0; }
.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-title-row h2 { margin: 0; }
.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.grid-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}
.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}
.form-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  margin: 0 0 32px;
  padding: 0 0 32px;
  border: 0;
  border-bottom: 2px dashed var(--line);
  background: transparent;
}
.form-group label {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  font-size: 14px;
}
.form-group label.wide {
  grid-template-columns: 160px 1fr;
  align-items: start;
}
.form-group label.check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.form-group label.check input {
  width: auto;
}
.form-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-weight: 800;
  font-size: 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.form-section-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f1ff;
  color: var(--blue-dark);
  font-size: 12px;
}
.wide {
  grid-column: 1 / -1;
}
.photo-preview {
  display: flex;
  align-items: center;
  gap: 16px;
}
.document-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-left: 176px; /* align with inputs (160px + 16px gap) */
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.form-actions button,
.form-actions .button-light {
  min-height: 42px;
}
.photo-preview img,
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f6f8fb;
}
.avatar.empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.link { color: var(--blue); font-weight: 700; margin-right: 10px; }
.danger { color: #b42318; }
.dr-manage-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}
.inner-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}
.inner-group-title {
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-dark);
  letter-spacing: 0.2px;
}
.inner-group-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px 24px;
  padding: 16px;
  background: #fff;
}

@media (max-width: 800px) {
  .sidebar { position: static; width: auto; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .content { margin: 0; padding: 18px; }
  .topbar { align-items: flex-start; gap: 12px; }
  .panel-title-row { display: grid; }
  .stats, .grid-form, .filters { grid-template-columns: 1fr; }
  .form-group { grid-template-columns: 1fr; }
  .wide { grid-column: 1; }
  .inner-group-fields { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .filters button { display: none; }
  .content { margin: 0; padding: 0; }
  .panel { box-shadow: none; border: 0; }
}

.report-page {
  background: #eef3f9;
  padding: 24px;
}
.report-sheet {
  width: min(900px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.report-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.employee-report-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.employee-report-header span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}
.employee-report-header h1 {
  margin: 6px 0;
  color: var(--blue-dark);
}
.employee-report-header p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.employee-report-header img {
  width: 110px;
  height: 130px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}
.report-grid article {
  break-inside: avoid;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.report-grid h2 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 17px;
}
.report-grid p {
  margin: 7px 0;
  line-height: 1.45;
}

@media print {
  .report-page {
    background: #fff;
    padding: 0;
  }
  .report-sheet {
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
  .report-actions {
    display: none;
  }
}

@media (max-width: 700px) {
  .report-page {
    padding: 12px;
  }
  .employee-report-header,
  .report-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}
