/* Login comun si administrarea accesului (portal) */
[hidden] { display: none !important; }

.portal-header {
  display: flex;
  max-width: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.user-who { color: #4a382e; }

.role-chip,
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(138, 90, 69, 0.14);
  color: #694839;
  font-size: 0.78rem;
  font-weight: 700;
}

.ghost-button,
.small-button,
.link-button {
  font: inherit;
  cursor: pointer;
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(91, 59, 46, 0.3);
  border-radius: var(--pic-control-radius, 12px);
  background: rgba(255, 250, 245, 0.75);
  color: #34251f;
  font-weight: 650;
}

.ghost-button:hover { background: #fffaf5; }

.center-view {
  display: grid;
  place-items: center;
}

.login-card,
.admin-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(91, 59, 46, 0.26);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 250, 245, 0.97), rgba(238, 225, 213, 0.95));
  box-shadow: 0 22px 54px rgba(52, 37, 31, 0.13);
}

.admin-card { width: 100%; }

.login-form {
  display: grid;
  gap: 14px;
}

.login-form h2,
.admin-card h2 {
  margin: 0;
  color: #2b201b;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.hint {
  margin: 0;
  color: #70594a;
  line-height: 1.5;
}

.next-info {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(123, 132, 80, 0.14);
  color: #4d5330;
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
  color: #4a382e;
  font-size: 0.92rem;
  font-weight: 650;
}

.field input,
.users-table select {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(91, 59, 46, 0.32);
  border-radius: 12px;
  background: #fffdfb;
  color: #2b201b;
  font: inherit;
  font-weight: 400;
}

.field input:focus-visible,
.users-table select:focus-visible {
  outline: 3px solid rgba(138, 90, 69, 0.3);
  outline-offset: 1px;
}

.primary-button {
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--pic-control-radius, 12px);
  background: linear-gradient(135deg, #34251f, #8a5a45);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.primary-button:disabled { opacity: 0.65; cursor: progress; }

.login-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: #694839;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-message {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(123, 132, 80, 0.14);
  color: #4d5330;
  line-height: 1.45;
}

.form-message.error {
  background: rgba(168, 63, 47, 0.12);
  color: #82301f;
}

.home-note {
  margin: 0 0 22px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(168, 63, 47, 0.12);
  color: #82301f;
  font-weight: 600;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.roles-help {
  margin: 0 0 18px;
  padding-left: 20px;
  color: #4a382e;
  line-height: 1.6;
}

.admin-card .form-message { margin-bottom: 14px; }

.admin-list { overflow-x: auto; }

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th {
  padding: 10px;
  border-bottom: 1px solid rgba(91, 59, 46, 0.25);
  color: #765846;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(91, 59, 46, 0.12);
  vertical-align: middle;
}

.users-table td.check { text-align: center; }
.users-table th:nth-child(n+3):not(:last-child) { text-align: center; }

.users-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #8a5a45;
}

.users-table .email {
  display: block;
  color: #70594a;
  font-size: 0.85rem;
}

.small-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #694839;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.small-button:disabled { background: rgba(105, 72, 57, 0.35); cursor: default; }

@media (max-width: 760px) {
  .login-card, .admin-card { padding: 24px 20px; }
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; }
  .users-table tr { padding: 12px 0; border-bottom: 1px solid rgba(91, 59, 46, 0.2); }
  .users-table td { padding: 5px 0; border: 0; }
  .users-table td.check { display: flex; align-items: center; gap: 10px; text-align: left; }
  .users-table td.check::after { content: attr(data-label); }
}

.admin-create {
  margin-bottom: 26px;
  padding: 20px;
  border: 1px solid rgba(91, 59, 46, 0.18);
  border-radius: 18px;
  background: rgba(255, 253, 251, 0.7);
}

.admin-create h3,
.list-title {
  margin: 0 0 12px;
  color: #2b201b;
  font-size: 1.15rem;
}

.create-form { display: grid; gap: 14px; justify-items: start; }
.create-form .form-message { justify-self: stretch; margin: 0; }

.create-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.create-grid select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(91, 59, 46, 0.32);
  border-radius: 12px;
  background: #fffdfb;
  font: inherit;
  font-weight: 400;
}

.create-apps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  color: #4a382e;
  font-weight: 650;
}

.check-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.check-label input { width: 18px; height: 18px; accent-color: #8a5a45; }

.tag-new { background: rgba(168, 63, 47, 0.14); color: #82301f; }
.create-form .small-button { min-height: 42px; padding: 0 18px; }
