/* ============================================
   HR Help for Small Business — Client Portal
   Brand: Ledger Navy / Advisor Green / Signal Ochre
   Type: Bricolage Grotesque (display) + DM Sans (body)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  --navy: #16233A;
  --green: #0E6B63;
  --ochre: #E0A22C;
  --clay: #B5442E;
  --slate: #5C5647;
  --paper: #EFECE6;
  --paper-soft: #F6F4EF;
  --white: #FFFFFF;
  --slate-soft: #8A8272;
  --line: #E2DDD2;

  --display: 'Bricolage Grotesque', -apple-system, sans-serif;
  --body: 'DM Sans', -apple-system, sans-serif;

  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(22,35,58,0.06);
  --shadow-md: 0 4px 12px rgba(22,35,58,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--slate);
  line-height: 1.6;
  font-size: 17px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--navy);
  line-height: 1.2;
}

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

/* ---- Layout ---- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Top Nav ---- */

.topnav {
  background: var(--navy);
  color: var(--white);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}

.topnav-brand img {
  height: 32px;
  width: auto;
}

.topnav-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.topnav-user {
  color: var(--slate-soft);
}

.topnav-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.topnav-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* ---- Login Screen ---- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}

.login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.login-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--slate-soft);
  margin-bottom: 32px;
  font-size: 15px;
}

.login-card .ochre-bar {
  width: 40px;
  height: 4px;
  background: var(--ochre);
  border-radius: 2px;
  margin-bottom: 24px;
}

/* ---- Forms ---- */

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 15px;
  color: var(--slate);
  background: var(--white);
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(14,107,99,0.1);
}

textarea { resize: vertical; min-height: 80px; }

.form-group { margin-bottom: 20px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: #1e3050; }

.btn-green {
  background: var(--green);
  color: var(--white);
}
.btn-green:hover { background: #0b5a53; }

.btn-ochre {
  background: var(--ochre);
  color: var(--navy);
  font-weight: 700;
}
.btn-ochre:hover { background: #d49520; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--slate);
}
.btn-outline:hover { background: var(--paper-soft); border-color: var(--slate-soft); }

.btn-danger {
  background: var(--clay);
  color: var(--white);
}
.btn-danger:hover { background: #a03c27; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.btn:disabled, .btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Cards ---- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 18px;
}

/* ---- Dashboard Grid ---- */

.dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 24px 0;
  min-height: calc(100vh - 56px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--body);
}

.sidebar-item:hover { background: var(--paper-soft); }
.sidebar-item.active { background: var(--white); color: var(--navy); font-weight: 600; border: 1px solid var(--line); }

.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Org Cards (admin) ---- */

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

.org-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.org-card:hover { border-color: var(--green); box-shadow: var(--shadow-md); }
.org-card.active { border-color: var(--green); border-width: 2px; }

.org-card h4 { font-size: 16px; margin-bottom: 4px; }
.org-card .org-meta { font-size: 13px; color: var(--slate-soft); }

.org-card .compliance-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
}

.org-card .compliance-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ---- Document List ---- */

.doc-list { list-style: none; }

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}

.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--paper-soft); }

.doc-info { flex: 1; }
.doc-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.doc-info .doc-meta { font-size: 12px; color: var(--slate-soft); }

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

/* ---- Category Tabs ---- */

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--body);
  font-size: 13px;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
}

.category-tab:hover { border-color: var(--green); }
.category-tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

.category-tab svg { width: 16px; height: 16px; }

/* ---- Compliance Checklist ---- */

.checklist { list-style: none; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--green);
  cursor: pointer;
}

.checklist-label { flex: 1; font-size: 14px; }
.checklist-label.complete { text-decoration: line-through; color: var(--slate-soft); }

.checklist-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-soft);
  padding: 4px 8px;
  background: var(--paper-soft);
  border-radius: 3px;
}

/* ---- Government Forms ---- */

.gov-form-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.15s;
}

.gov-form-card:hover { border-color: var(--green); }

.gov-form-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--paper-soft);
  border-radius: var(--radius);
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
  color: var(--navy);
  text-align: center;
  flex-shrink: 0;
}

.gov-form-info h4 { font-size: 14px; margin-bottom: 4px; }
.gov-form-info p { font-size: 13px; color: var(--slate-soft); line-height: 1.5; }

.gov-forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

/* ---- Progress Bar ---- */

.progress-container { margin-bottom: 24px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.progress-header h3 { font-size: 16px; }

.progress-percent {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  color: var(--green);
}

.progress-bar {
  height: 10px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* ---- Status Badges ---- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-active { background: rgba(14,107,99,0.1); color: var(--green); }
.badge-paused { background: rgba(224,162,44,0.15); color: #9a7a1b; }
.badge-archived { background: var(--paper-soft); color: var(--slate-soft); }

/* ---- Toast Notifications ---- */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 380px;
}

.toast-visible { transform: translateX(0); opacity: 1; }
.toast-success { background: var(--green); }
.toast-error { background: var(--clay); }
.toast-info { background: var(--navy); }

/* ---- Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22,35,58,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-visible { opacity: 1; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(22,35,58,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 { font-size: 18px; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--slate-soft);
  cursor: pointer;
  padding: 4px;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ---- Empty State ---- */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--slate-soft);
}

.empty-state h3 { color: var(--navy); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ---- Section Headers ---- */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 { font-size: 22px; }

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .sidebar-item {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .form-row { grid-template-columns: 1fr; }
  .org-grid { grid-template-columns: 1fr; }
  .gov-forms-grid { grid-template-columns: 1fr; }
  .topnav-user { display: none; }
}
