/* ============================================================
   HR PORTAL — style.css
   ============================================================ */

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 15px; background: #f1f5f9; color: #1e293b; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

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

/* ─── Top navigatie ─── */
.topnav {
  background: linear-gradient(90deg, #1a3356 0%, #1e3a5f 55%, #1e40af 100%);
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(0,0,0,.22);
  padding: 0 1rem;
  width: 100%;
}

/* Logo */
.tn-brand {
  display: flex; align-items: center; gap: .6rem;
  padding-right: 1.25rem;
  border-right: 1px solid rgba(255,255,255,.12);
  margin-right: .4rem;
  flex-shrink: 0;
  text-decoration: none; color: #fff;
}
.tn-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(37,99,235,.4);
}
.tn-logo-text { font-weight: 700; font-size: .9rem; white-space: nowrap; }

/* Nav links */
.tn-links {
  display: flex;
  align-items: center;
  gap: .1rem;
  flex: 1;
  overflow: hidden;
}
.tn-link {
  display: flex; align-items: center; gap: .35rem;
  padding: .38rem .85rem;
  border-radius: .6rem;
  color: rgba(255,255,255,.65);
  transition: all .15s;
  font-weight: 500; font-size: .85rem;
  white-space: nowrap;
  text-decoration: none;
}
.tn-link:hover  { background: rgba(255,255,255,.1); color: #fff; }
.tn-link.active { background: #2563eb; color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.4); }
.tn-icon { font-size: .88rem; }

/* Gebruiker */
.tn-user {
  display: flex; align-items: center; gap: .55rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,.12);
  margin-left: .4rem;
  flex-shrink: 0;
}
.tn-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.tn-user-info { line-height: 1.2; }
.tn-uname { font-size: .82rem; font-weight: 600; }
.tn-urole { font-size: .68rem; color: rgba(255,255,255,.45); }
.tn-logout {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.6);
  border-radius: .5rem;
  padding: .3rem .55rem;
  font-size: .88rem;
  transition: all .15s;
  margin-left: .2rem;
}
.tn-logout:hover { background: rgba(239,68,68,.2); color: #ef4444; border-color: rgba(239,68,68,.3); }

/* Hamburger (mobiel) */
.tn-ham {
  display: none;
  background: none; border: none; color: #fff;
  font-size: 1.3rem; padding: .3rem .45rem;
  margin-left: auto;
}

/* ─── Main area ─── */
.main { flex: 1; width: 100%; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 56px; z-index: 50;
}
.topbar h1     { font-size: 1.15rem; font-weight: 700; flex: 1; }
.topbar-meta   { font-size: .82rem; color: #94a3b8; }
.topbar-badge  {
  background: #fee2e2; color: #dc2626;
  border-radius: 999px; padding: .2rem .65rem;
  font-size: .75rem; font-weight: 600; text-decoration: none;
}
.content { padding: 1.5rem; flex: 1; }

/* ─── Mobiel menu ─── */
@media (max-width: 960px) {
  .tn-ham { display: block; }
  .tn-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 56px; left: 0; right: 0;
    background: #1e3a5f;
    padding: .6rem;
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    gap: .15rem;
  }
  .tn-links.open { display: flex; }
  .tn-link { font-size: .9rem; padding: .65rem 1rem; }
  .tn-user-info { display: none; }
}
@media (max-width: 640px) {
  .tn-logo-text { display: none; }
  .content { padding: 1rem; }
}

/* ─── Cards ─── */
.card { background: #fff; border-radius: 1rem; border: 1px solid #e2e8f0; overflow: hidden; }
.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.card-body  { padding: 1.25rem 1.5rem; }

/* ─── Stats grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.07); }
.stat-icon {
  width: 50px; height: 50px; border-radius: .85rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-val   { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .78rem; color: #64748b; margin-top: .25rem; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f8fafc; }
th {
  text-align: left; padding: .75rem 1rem;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: #64748b; white-space: nowrap;
}
td {
  padding: .8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .88rem;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfc; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; flex-shrink: 0;
}

/* ─── Badges ─── */
.badge {
  display: inline-block; padding: .2rem .65rem;
  border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red   { background: #fee2e2; color: #dc2626; }
.badge-amber { background: #fef3c7; color: #d97706; }
.badge-gray  { background: #f1f5f9; color: #475569; }
.badge-blue  { background: #dbeafe; color: #2563eb; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: .6rem;
  font-size: .87rem; font-weight: 600;
  border: none; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn-outline { background: #fff; color: #374151; border: 1.5px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-danger  { background: #fff; color: #dc2626; border: 1.5px solid #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
.btn-green   { background: #16a34a; color: #fff; }
.btn-green:hover { background: #15803d; }
.btn-sm      { padding: .35rem .75rem; font-size: .78rem; }
.btn-ghost   { background: none; border: none; color: #64748b; padding: .35rem .5rem; border-radius: .5rem; }
.btn-ghost:hover { color: #1e293b; background: #f1f5f9; }

/* ─── Forms ─── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-group  { display: flex; flex-direction: column; gap: .4rem; }
.form-group.full { grid-column: 1 / -1; }

label.lbl { font-size: .82rem; font-weight: 600; color: #374151; }
.req { color: #dc2626; }

input[type=text],
input[type=email],
input[type=number],
input[type=date],
input[type=password],
input[type=file],
select,
textarea {
  padding: .65rem .9rem;
  border: 1.5px solid #d1d5db;
  border-radius: .6rem;
  font-size: .92rem;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  color: #1e293b;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 80px; }
.hint    { font-size: .78rem; color: #94a3b8; margin-top: .2rem; }

/* ─── Filters ─── */
.filters {
  background: #fff; border-radius: .75rem;
  border: 1px solid #e2e8f0;
  padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin-bottom: 1rem; align-items: center;
}
.filters input, .filters select {
  width: auto; flex: 1; min-width: 150px;
  padding: .55rem .8rem; font-size: .87rem;
}

/* ─── Flash messages ─── */
.flash {
  padding: .9rem 1.25rem; border-radius: .75rem;
  margin-bottom: 1rem; font-weight: 500;
  display: flex; align-items: center; gap: .65rem;
  animation: slideIn .2s ease;
}
.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Login page ─── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a3356 0%, #1e3a5f 50%, #1e40af 100%);
  padding: 2rem;
}
.login-card {
  background: #fff; border-radius: 1.5rem;
  padding: 2.75rem; max-width: 420px; width: 100%;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
}
.login-logo {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  border-radius: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.login-card h1 { text-align: center; font-size: 1.75rem; margin-bottom: .5rem; }
.login-sub     { text-align: center; color: #64748b; margin-bottom: 2rem; }
.login-btn {
  width: 100%; padding: 1rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: .75rem;
  font-size: 1rem; font-weight: 700;
  margin-top: 1.25rem; cursor: pointer;
  transition: all .2s;
}
.login-btn:hover { box-shadow: 0 6px 20px rgba(37,99,235,.4); transform: translateY(-1px); }

/* ─── Document upload grid ─── */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.doc-btn  {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem; border-radius: .85rem; border: 2px solid;
  text-align: left; background: #fff; width: 100%;
  cursor: pointer; transition: all .2s;
}
.doc-btn.uploaded { border-color: #86efac; background: #f0fdf4; cursor: default; }
.doc-btn.required { border-color: #fca5a5; background: #fff5f5; }
.doc-btn.required:hover { border-color: #dc2626; background: #fef2f2; }
.doc-btn.optional { border-color: #e2e8f0; }
.doc-btn.optional:hover { border-color: #93c5fd; background: #eff6ff; }
.doc-icon { width: 40px; height: 40px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.doc-name { font-size: .87rem; font-weight: 600; }
.doc-sub  { font-size: .74rem; margin-top: .15rem; }

/* ─── Contract cards ─── */
.contract-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 1rem; }
.contract-card {
  background: #fff; border-radius: 1rem;
  border: 1px solid #e2e8f0; padding: 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: box-shadow .2s, transform .2s;
}
.contract-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.cc-head    { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.cc-icon    { width: 42px; height: 42px; border-radius: .65rem; background: #f5f3ff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.cc-name    { font-weight: 700; font-size: .92rem; }
.cc-type    { font-size: .77rem; color: #64748b; }
.cc-row     { display: flex; justify-content: space-between; font-size: .84rem; }
.cc-row span:first-child { color: #64748b; }
.cc-row span:last-child  { font-weight: 600; }
.cc-actions { display: flex; border-top: 1px solid #f1f5f9; padding-top: .75rem; gap: .25rem; }
.cc-action  {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .4rem; border-radius: .5rem;
  font-size: .77rem; font-weight: 600; color: #64748b;
  background: none; border: none; cursor: pointer; transition: all .15s;
}
.cc-action:hover       { background: #f8fafc; color: #1e293b; }
.cc-action.danger:hover { background: #fef2f2; color: #dc2626; }
.cc-action.green:hover  { background: #f0fdf4; color: #16a34a; }

/* ─── Page header ─── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.page-title  { font-size: 1.45rem; font-weight: 800; }
.page-sub    { font-size: .83rem; color: #64748b; margin-top: .25rem; }

/* ─── Empty state ─── */
.empty-state      { text-align: center; padding: 3rem; color: #94a3b8; }
.empty-state .icon { font-size: 3rem; margin-bottom: .75rem; }
.empty-state p    { font-size: .95rem; font-weight: 600; color: #64748b; }
.empty-state small { font-size: .83rem; }

/* ─── Modal ─── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 1rem; padding: 1.75rem;
  max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; }

/* ─── Mobile menu button ─── */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #1e293b; }

/* ─── Misc ─── */
.section-head {
  font-size: .73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: #94a3b8; padding: .75rem 0 .5rem;
  border-top: 1px solid #f1f5f9; margin-top: .5rem;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .doc-grid  { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: block; }
}
@media (max-width: 600px) {
  .stats-grid    { grid-template-columns: 1fr 1fr; }
  .contract-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
}
