/* Área do funcionário — FC Ponto (web + celular) */
:root {
  --blue-950: #102a43;
  --blue-800: #174e73;
  --blue-600: #1479b8;
  --blue-100: #e8f3fa;
  --slate-900: #18212b;
  --slate-600: #64748b;
  --slate-300: #cbd5e1;
  --white: #fff;
  --danger: #b42318;
  --success: #16804c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--slate-900);
  background: linear-gradient(145deg, var(--blue-950) 0%, var(--blue-800) 48%, var(--blue-600) 100%);
  -webkit-text-size-adjust: 100%;
}

body.is-authenticated {
  background: #f5f7fa;
}

button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(145deg, var(--blue-950) 0%, var(--blue-800) 48%, var(--blue-600) 100%);
}

.login-card {
  width: min(410px, 100%);
  padding: 28px 22px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 24px 70px rgb(0 0 0 / 24%);
}

.login-card h1 {
  margin: 16px 0 4px;
  font-size: 1.7rem;
}

.login-card > p {
  margin: 0 0 22px;
  color: var(--slate-600);
  font-size: .95rem;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--white);
  background: var(--blue-600);
  font-weight: 800;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: .85rem;
}

.stack { display: grid; gap: 14px; }

.login-card label,
.employee-portal-shell label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: .82rem;
  font-weight: 700;
}

.login-card input,
.employee-portal-shell input,
.employee-portal-shell select,
.employee-portal-shell textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate-900);
}

.login-card input:focus,
.employee-portal-shell input:focus,
.employee-portal-shell select:focus,
.employee-portal-shell textarea:focus {
  outline: 2px solid rgb(20 121 184 / 25%);
  border-color: var(--blue-600);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  background: var(--white);
  color: var(--slate-900);
  text-decoration: none;
}

.button.primary {
  border-color: var(--blue-600);
  color: var(--white);
  background: var(--blue-600);
}

.button:disabled { opacity: .65; cursor: wait; }

.message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ecfdf3;
  color: var(--success);
  font-size: .9rem;
}

.message.error {
  background: #fef3f2;
  color: var(--danger);
}

/* ---------- App shell ---------- */
.employee-portal-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 250px 1fr;
  background: #f5f7fa;
}

.employee-portal-shell .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  color: var(--white);
  background: var(--blue-950);
  overflow: auto;
  z-index: 40;
}

.employee-portal-shell .sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.employee-portal-shell .brand {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
}

#employee-navigation {
  display: grid;
  gap: 6px;
}

#employee-navigation a {
  display: block;
  padding: 12px 12px;
  border-radius: 8px;
  color: #dbe8f1;
  text-decoration: none;
  font-weight: 600;
}

#employee-navigation a:hover,
#employee-navigation a.active {
  color: var(--white);
  background: rgb(255 255 255 / 12%);
}

.employee-portal-shell .sidebar-user {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 16px 8px 4px;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

.employee-portal-shell .sidebar-user span {
  color: #a8c0d2;
  font-size: .82rem;
}

.employee-portal-shell .link-button {
  width: fit-content;
  padding: 8px 0 0;
  border: 0;
  color: #dbe8f1;
  background: none;
  cursor: pointer;
  text-decoration: underline;
}

.employee-portal-shell .content {
  min-width: 0;
  padding: 22px 24px 40px;
}

.employee-portal-shell .content > h1 {
  margin: 0 0 16px;
  font-size: 1.45rem;
}

.employee-portal-shell .menu-toggle {
  width: 42px;
  height: 38px;
  display: grid;
  align-content: center;
  gap: 5px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  color: var(--blue-950);
  background: var(--white);
  cursor: pointer;
}

.employee-portal-shell .menu-toggle span {
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.employee-portal-shell .sidebar-menu-toggle {
  border-color: rgb(255 255 255 / 28%);
  color: var(--white);
  background: transparent;
}

#employee-menu-toggle-mobile {
  display: none;
  margin-bottom: 14px;
}

.employee-portal-topbar {
  display: none;
}

.employee-portal-shell .card {
  padding: 18px;
  border: 1px solid #e4e9ef;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 3px 14px rgb(15 23 42 / 5%);
}

.employee-portal-shell .card + .card { margin-top: 14px; }
.employee-portal-shell .card-subtitle {
  margin: 0 0 12px;
  color: var(--slate-600);
  font-size: .9rem;
}

.employee-portal-shell .form-help {
  margin: 0 0 12px;
  color: var(--slate-600);
  font-size: .88rem;
}

.employee-portal-shell .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.employee-portal-shell .form-grid h3 {
  margin: 0 0 4px;
  font-size: .78rem;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.employee-portal-shell .form-grid p { margin: 0; font-weight: 600; }

.employee-portal-shell .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.employee-portal-shell .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.employee-portal-shell table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.employee-portal-shell th,
.employee-portal-shell td {
  padding: 10px 8px;
  border-bottom: 1px solid #e8edf2;
  text-align: left;
  white-space: nowrap;
}

.employee-portal-shell th {
  color: var(--slate-600);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.employee-portal-shell .badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f3fa;
  color: var(--blue-800);
  font-size: .75rem;
  font-weight: 700;
}

.employee-portal-shell .badge.inactive {
  background: #fef3f2;
  color: var(--danger);
}

.employee-portal-shell .empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--slate-300);
  border-radius: 10px;
  color: var(--slate-600);
  text-align: center;
}

.punch-clock {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(160deg, #f5f8fb, #e8f3fa);
  text-align: center;
}

.punch-clock strong {
  font-size: clamp(1.8rem, 7vw, 2.2rem);
  letter-spacing: .02em;
}

.punch-clock span {
  color: var(--slate-600);
  font-size: .9rem;
  text-transform: capitalize;
}

.punch-action {
  width: 100%;
  max-width: 420px;
  min-height: 52px;
  font-size: 1rem;
}

.punch-today { margin-top: 20px; }
.punch-today h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.portal-backdrop {
  display: none;
}

/* ---------- Celular / tablet ---------- */
@media (max-width: 860px) {
  .employee-portal-shell {
    grid-template-columns: 1fr;
  }

  .employee-portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -22px -16px 16px;
    padding: 12px 16px;
    background: var(--blue-950);
    color: var(--white);
    box-shadow: 0 8px 20px rgb(16 42 67 / 18%);
  }

  .employee-portal-topbar .brand-text {
    display: grid;
    gap: 1px;
    min-width: 0;
  }

  .employee-portal-topbar strong {
    font-size: 1rem;
    line-height: 1.2;
  }

  .employee-portal-topbar span {
    color: #a8c0d2;
    font-size: .75rem;
  }

  .employee-portal-topbar .menu-toggle {
    border-color: rgb(255 255 255 / 28%);
    color: var(--white);
    background: transparent;
    flex: 0 0 auto;
  }

  #employee-menu-toggle-mobile { display: none; }

  .employee-portal-shell .sidebar-menu-toggle { display: none; }

  .employee-portal-shell .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 12px 0 40px rgb(0 0 0 / 25%);
  }

  .employee-portal-shell.portal-drawer-open .sidebar {
    transform: translateX(0);
  }

  .portal-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    background: rgb(15 23 42 / 45%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .employee-portal-shell.portal-drawer-open .portal-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .employee-portal-shell .content {
    padding: 22px 16px 36px;
  }

  .employee-portal-shell .content > h1 {
    font-size: 1.28rem;
  }

  .login-card {
    padding: 26px 18px;
  }

  .punch-action {
    max-width: none;
  }
}
