/*
Claro, aqui vai o `funcionarios.css` refeito no mesmo visual escuro/dourado dos seus outros CSS:
*/
html,
body {
  overflow-x: hidden;
}

:root {
  --bg: #111315;
  --panel: #1a1d20;
  --panel-2: #22272b;
  --panel-3: #15181a;
  --text: #f5f1e8;
  --muted: #aaa29a;
  --line: #343a40;
  --accent: #d7a84f;
  --green: #49c27f;
  --red: #f06b61;
  --blue: #6ea8fe;
  --cyan: #009ee3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(110, 168, 254, 0.12), transparent 28%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.stat-card,
.toolbar,
.state-card,
.employee-card,
.modal-card {
  border: 1px solid var(--line);
  background: rgba(26, 29, 32, 0.92);
  border-radius: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.1;
}

h2 {
  font-size: 1rem;
}

.subtitle,
.section-heading span,
.stat-label,
.employee-id,
.employee-meta,
.search-box span,
.filter-box span,
.field span {
  color: var(--muted);
}

.subtitle {
  display: block;
  margin-top: 8px;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.primary-button {
  padding: 0 16px;
  background: var(--accent);
  color: #17120a;
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.danger-button {
  padding: 0 16px;
  background: var(--red);
  color: #ffffff;
}

.icon-button {
  width: 44px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 1.45rem;
  line-height: 1;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

button:disabled,
.button-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.4);
  transform: none;
}

button:disabled:hover,
.button-disabled:hover {
  opacity: 0.45;
  transform: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 14px;
  background: var(--panel-2);
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--text);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
  align-items: end;
  padding: 18px;
  margin-bottom: 18px;
}

.search-box,
.filter-box,
.field {
  display: grid;
  gap: 7px;
}

.search-box span,
.filter-box span,
.field span {
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input::placeholder {
  color: #7e766f;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(215, 168, 79, 0.14);
}

.employees-section {
  margin-top: 18px;
}

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

.section-heading span {
  font-size: 0.9rem;
}

.state-card {
  padding: 18px;
  color: var(--muted);
  background: rgba(17, 19, 21, 0.55);
  border: 1px dashed var(--line);
  text-align: center;
}

.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
}

.employee-card {
  padding: 18px;
  min-width: 0;
}

.employee-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.employee-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.employee-avatar,
.employee-photo-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(215, 168, 79, 0.36);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(215, 168, 79, 0.96), rgba(235, 196, 93, 0.88));
  color: #17120a;
  font-weight: 950;
}

.employee-avatar {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  font-size: 1.12rem;
}

.employee-avatar-initials {
  position: relative;
  z-index: 1;
}

.employee-avatar img,
.employee-photo-preview img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.employee-name {
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.employee-id {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.photo-card-button {
  min-height: 30px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid rgba(215, 168, 79, 0.38);
  border-radius: 8px;
  background: rgba(215, 168, 79, 0.1);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
}

.photo-card-button:hover:not(:disabled) {
  background: rgba(215, 168, 79, 0.17);
  transform: translateY(-1px);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-3);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.available {
  color: var(--green);
}

.badge.busy {
  color: var(--accent);
}

.badge.paused {
  color: var(--blue);
}

.badge.offline,
.badge.unavailable {
  color: var(--red);
}

.badge.inactive {
  color: var(--red);
}

.employee-meta {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.employee-meta strong {
  color: var(--text);
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.card-actions button {
  min-width: 0;
  padding-inline: 12px;
}

.status-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
}

.status-chip {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 5px;
  color: var(--muted);
  background: transparent;
  font-size: clamp(0.68rem, 0.72vw, 0.78rem);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.status-chip:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.status-chip.active {
  color: #17120a;
  background: var(--accent);
  border-color: rgba(215, 168, 79, 0.7);
}

.status-chip[data-status="available"].active {
  background: var(--green);
}

.status-chip[data-status="paused"].active {
  color: #0c1a2b;
  background: var(--blue);
}

.status-chip[data-status="unavailable"].active {
  color: #fff;
  background: var(--red);
}

.status-chip:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.hidden {
  display: none !important;
}

.modal {
  width: min(520px, calc(100% - 28px));
  max-height: min(92vh, 860px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: auto;
}

.modal::backdrop {
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
}

.photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 21, 0.45);
}

.employee-photo-preview {
  width: 78px;
  height: 78px;
  font-size: 1.55rem;
}

.photo-editor-fields {
  display: grid;
  min-width: 0;
  gap: 10px;
}

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

.photo-actions button {
  min-height: 38px;
  padding-inline: 12px;
}

.modal-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 21, 0.45);
}

.modal-section h3 {
  font-size: 1rem;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 940px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .stats-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .employee-card {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .topbar,
  .toolbar,
  .employee-card,
  .modal-card {
    padding: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .employee-head {
    flex-direction: column;
  }

  .employee-title {
    width: 100%;
  }

  .badge {
    width: fit-content;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .employees-grid {
    grid-template-columns: 1fr;
  }

  .status-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .photo-editor {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .photo-actions {
    width: 100%;
  }

  .photo-actions button {
    flex: 1 1 140px;
  }
}

/*BORRAR FUNCIONARIS PLANO SIMPLES*/

.employee-card-locked {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  cursor: pointer;
}

.employee-card-locked > :not(.employee-lock-overlay) {
  filter: blur(4px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.employee-card-locked .employee-lock-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: rgba(17, 19, 21, 0.62);
  border-radius: 8px;
  z-index: 2;
}

.employee-lock-overlay strong {
  color: var(--text);
  font-size: 1rem;
}

.employee-lock-overlay small {
  color: var(--muted);
  max-width: 220px;
  line-height: 1.4;
}

.employee-card-locked button,
.employee-card-locked select {
  cursor: not-allowed;
}
