:root{
  --laranja:#ff7a00;
  --laranja-esc:#e06900;
  --vinho:#6a0f1a;
  --vinho-esc:#4f0b13;
  --bg:#0f0f12;
  --txt:#f6f6f6;
  --muted:#cfcfd4;
}
*{box-sizing:border-box}
body{
  margin:0; 
  background:var(--bg); 
  color:var(--txt);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
  line-height:1.5;
}
/* Header / Nav */
.nav{
  position:sticky; top:0; z-index:50;
  background:linear-gradient(90deg,var(--vinho),var(--laranja-esc));
  border-bottom:1px solid rgba(255,255,255,.1);
}
.nav-wrap{
  max-width:1100px; margin:0 auto; padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex; align-items:center; gap:10px; text-decoration:none; color:#fff;
  font-weight:700; letter-spacing:.3px;
}
.brand .dot{width:10px; height:10px; border-radius:999px; background:var(--laranja); box-shadow:0 0 12px #000 inset}
.links{display:flex; gap:14px; align-items:center; flex-wrap:wrap}
.link{
  color:#fff; text-decoration:none; padding:8px 10px; border-radius:10px;
  transition:transform .08s ease, background .15s ease;
  background:rgba(255,255,255,.06);
}
.link:hover{background:rgba(255,255,255,.14); transform:translateY(-1px)}
/* Hamburger */
.menu{
  position:relative;
}
.menu-btn{
  display:flex; flex-direction:column; justify-content:center; gap:4px;
  width:40px; height:38px; border:0; border-radius:10px; cursor:pointer;
  background:rgba(0,0,0,.2);
}
.menu-btn .bar{height:2px; background:#fff; width:60%; margin:0 auto; border-radius:4px}
.dropdown{
  position:absolute; right:0; top:46px; min-width:180px;
  background:linear-gradient(180deg,var(--vinho),var(--vinho-esc));
  border:1px solid rgba(255,255,255,.1); border-radius:12px; padding:6px;
  box-shadow:0 10px 30px rgba(0,0,0,.35); display:none;
}
.dropdown.open{display:block}
.item{
  display:block; color:#fff; text-decoration:none; padding:10px 12px; border-radius:8px;
}
.item:hover{background:rgba(255,255,255,.12)}
/* Main container */
.container{max-width:1100px; margin:18px auto; padding:0 16px}
.card{
  background:#272726; border:1px solid rgba(255,255,255,.06);
  border-radius:14px; padding:16px;
}
/* Footer */
footer{
  color:var(--muted); font-size:.9rem; padding:24px 16px; text-align:center;
  border-top:1px solid rgba(255,255,255,.06)
}
/* Small screens */
@media (max-width:640px){
  .links{display:none}
}
/* fundo do campo principal */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: #ffe5b4; /* laranja claro */
  color: #000; /* texto preto */
  border: 1px solid #ffa64d;
}

/* texto dentro */
.select2-container--default .select2-selection__rendered {
  color: #000 !important; /* preto */
}

/* placeholder */
.select2-container--default .select2-selection__placeholder {
  color: #004080; /* azul escuro */
}

/* opções do dropdown */
.select2-container--default .select2-results__option {
  background-color: #fffaf0; /* tom neutro */
  color: #000;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #ffa64d; /* laranja médio no hover */
  color: #000;
}

/* Object heading (back / title / actions) - deprecated, using .object-heading-wrapper */
.object-heading{display:flex; align-items:center; gap:12px}
.object-heading .back{flex:0 0 40px; text-align:left}
.object-heading .title{flex:1; text-align:center; font-weight:600}
.object-heading .actions{flex:0 0 120px; display:flex; justify-content:flex-end; gap:8px; align-items:center}
.object-heading .actions a{display:inline-block; font-size:1.05rem}

/* small icon tweaks */
.icon-btn{font-size:1.05rem; line-height:1; padding:6px; border-radius:8px}
.icon-btn:hover{background:rgba(255,255,255,.04)}

/* Estilos para página de pessoas */
#search-nome,
#search-time {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background-color: #fff;
  color: #000;
  min-width: 140px;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
}

#search-nome {
  min-width: 200px;
}

#search-nome::placeholder,
#search-time::placeholder {
  color: #999;
}

#btn-clear {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
  color: #000;
  transition: background 0.15s ease;
}

#btn-clear:hover {
  background: #efefef;
}

/* Flexbox utilities for layout */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-18 { gap: 18px; }

/* Table base styles */
.table-base {
  width: 100%;
  border-collapse: collapse;
}

.table-base thead tr {
  text-align: left;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.table-base thead th {
  padding: 12px;
  color: #000;
}

.table-base thead th a {
  color: #000;
  text-decoration: none;
}

.table-base tbody td a {
  text-decoration: none;
}

.table-base tbody td a:strong {
  font-weight: 700;
}

/* Avatar base styles */
.avatar-sm {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-md {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-lg {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

/* Person/item row styles */
.item-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Muted text styles */
.text-muted {
  color: var(--muted);
}

.text-muted-sm {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Object Heading Styles */
.object-heading-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.object-heading-wrapper .back {
  flex: 0 0 40px;
  text-align: left;
}

.object-heading-wrapper .back a {
  font-size: 1.1rem;
}

.object-heading-wrapper .title {
  flex: 1;
  text-align: center;
  font-weight: 600;
}

.object-heading-wrapper .actions {
  flex: 0 0 120px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.object-heading-wrapper .actions a {
  font-size: 1.1rem;
  display: inline-block;
}

.object-heading-wrapper .actions a.delete {
  color: var(--danger, #b00);
}

/* Modal Styles */
#js-confirm-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
}

#js-confirm-delete-modal[aria-hidden="false"] {
  display: flex;
}

#js-confirm-delete-modal .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

#js-confirm-delete-modal .dialog {
  position: relative;
  background: #f5f5f5;
  color: var(--txt);
  border-radius: 8px;
  padding: 18px;
  width: 520px;
  max-width: 92%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  z-index: 1201;
}

#js-confirm-delete-modal .dialog h3 {
  margin: 0 0 8px 0;
}

#js-confirm-delete-modal .dialog p {
  margin: 0 0 16px;
  color: var(--muted);
}

#js-confirm-delete-modal .controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

#js-confirm-delete-modal .btn {
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

#js-confirm-delete-modal .btn--cancel {
  background: #f5f5f5;
}

#js-confirm-delete-modal .btn--confirm {
  background: var(--danger, #b00);
  color: #fff;
}

/* Pessoa List Styles */
.search-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.search-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-wrapper {
  overflow: auto;
}

#pessoas-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

#pessoas-table thead tr {
  text-align: left;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

#pessoas-table thead th {
  padding: 12px;
  color: #000;
}

#pessoas-table thead th a {
  color: #000;
  text-decoration: none;
}

#pessoas-table thead th:first-child {
  min-width: 220px;
}

#pessoas-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
}

#pessoas-table tbody td {
  padding: 12px;
}

#pessoas-table tbody td:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
}

#pessoas-table tbody td img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
}

#pessoas-table tbody td a {
  color: #fff;
  text-decoration: none;
}

#pessoas-table tbody td.email {
  color: var(--muted);
}

#pessoas-table tbody td.money {
  text-align: right;
  font-weight: 700;
}

#pessoas-table tbody td:empty {
  padding: 12px;
  text-align: center;
  color: var(--muted);
}

.pessoa-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pessoa-avatar {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
}

.pessoa-detail-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pessoa-detail-header img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

/* Page Heading */
.page-heading {
  text-align: center;
}

/* Stat Card Styles */
.stat-card {
  padding: 12px;
  min-width: 160px;
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card .value {
  font-weight: 700;
  font-size: 1.1rem;
}

.pessoa-detail-stats {
  margin-top: 12px;
  display: flex;
  gap: 18px;
}

/* Pagination styles */
#pagination {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 6px;
  padding: 0;
  align-items: center;
}

#pagination li {
  padding: 8px;
}

#pagination li.disabled {
  color: #999;
}

#pagination a {
  color: #f6f6f6;
  text-decoration: none;
}

#pagination a:hover {
  text-decoration: underline;
}

/* Role Detail Styles */
.role-detail-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.role-detail-main {
  flex: 1 1 50%;
  min-width: 260px;
}

.role-detail-aside {
  flex: 0 0 42%;
  max-width: 42%;
  min-width: 220px;
}

.role-detail-aside h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.role-detail-pessoas-list {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

.role-pessoas-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-pessoa-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  border-radius: 6px;
}

.role-pessoa-info {
  display: flex;
  flex-direction: column;
}

.role-pessoa-info a {
  font-weight: 600;
}

.role-pessoas-empty {
  color: #666;
  padding: 12px;
}
.roles-table,
.locais-table {
  width: 100%;
  border-collapse: collapse;
}

.roles-table thead tr,
.locais-table thead tr {
  text-align: left;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.roles-table thead th,
.locais-table thead th {
  padding: 12px;
  color: #000;
}

.roles-table thead th a,
.locais-table thead th a {
  color: #000;
  text-decoration: none;
}

.roles-table tbody tr,
.locais-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.roles-table tbody tr.card,
.locais-table tbody tr.card {
  display: table-row;
}

.roles-table tbody td,
.locais-table tbody td {
  padding: 8px;
  color: #fff;
}

.roles-table tbody td a,
.locais-table tbody td a {
  color: #fff;
}

.role-form {
  padding: 20px;
}

.role-form-top,
.role-form-bottom {
  display: grid;
  gap: 14px;
}

.role-form-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.role-form-divider {
  margin: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.role-form-people-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  overflow: hidden;
}

.role-form-people-grid > * {
  min-width: 0;
  overflow: hidden;
}

.role-form-values-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.role-form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: start;
}

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

.role-form-aside {
  display: grid;
  gap: 14px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.role-field {
  display: grid;
  gap: 6px;
}

.role-field label {
  font-weight: 600;
}

.role-form input[type="text"],
.role-form input[type="number"],
.role-form input[type="date"],
.role-form input[type="email"],
.role-form select,
.role-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--txt);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
}

.role-form .errorlist {
  margin: 0;
  padding-left: 18px;
  color: #ffb4b4;
  font-size: 0.9rem;
}

.role-form-alert {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 122, 0, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 122, 0, 0.1);
}

.role-field-file input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.role-dropzone {
  position: relative;
  min-height: 170px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.role-dropzone.is-dragging,
.role-dropzone:hover,
.role-dropzone.has-file {
  border-color: var(--laranja);
  background: rgba(255, 122, 0, 0.08);
}

.role-dropzone-content {
  display: grid;
  gap: 6px;
}

.role-dropzone-content span,
.role-dropzone-content small {
  color: var(--muted);
}

.role-dropzone-file-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.role-dropzone-remove {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.role-dropzone-remove:hover {
  border-color: rgba(255, 122, 0, 0.6);
  background: rgba(255, 122, 0, 0.25);
}

.role-preview-box {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.role-preview-box small {
  color: var(--muted);
}

.role-preview-box strong {
  font-size: 1.08rem;
}

.role-form-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.role-form .select2-container--default .select2-selection--single,
.role-form .select2-container--default .select2-selection--multiple {
  background: rgba(255, 255, 255, 0.05);
  color: var(--txt);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  min-height: 42px;
}

.role-form .select2-container--default .select2-selection__rendered {
  color: var(--txt) !important;
}

.select2-results__option .role-select2-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select2-results__option .role-select2-option input[type="checkbox"] {
  pointer-events: none;
}

.role-form .select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: none;
}

.role-form .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  display: none;
}

.role-form .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  min-height: 34px;
  padding: 6px 10px;
}

.role-form .select2-container--default .select2-results__option[aria-selected="true"] {
  display: none;
}

.role-people-picker #id_pessoas {
  display: none;
}

.role-people-picker {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.role-people-search {
  width: 100%;
  margin-bottom: 8px;
}

.role-available-box,
.role-selected-box {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  height: 300px;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}

.role-selected-column {
  display: block;
}

.role-selected-align-spacer {
  visibility: hidden;
  pointer-events: none;
}

.role-selected-search-spacer {
  visibility: hidden;
  pointer-events: none;
  margin-bottom: 20px;
}

.role-available-head,
.role-selected-head {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.role-selected-box {
  height: 300px;
}

.role-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-selected-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 122, 0, 0.22);
  color: #fff;
  font-weight: 600;
}

.role-selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.role-available-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.role-available-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.15);
}

.role-available-name {
  flex: 1;
  min-width: 0;
  color: var(--txt);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-available-add {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 26px;
  height: 26px;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
}

.role-available-add:hover {
  background: rgba(255, 122, 0, 0.24);
  border-color: rgba(255, 122, 0, 0.5);
}

.role-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.15);
}

.role-selected-name {
  flex: 1;
  min-width: 0;
  color: var(--txt);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-selected-remove {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 26px;
  height: 26px;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
}

.role-selected-remove:hover {
  background: rgba(255, 122, 0, 0.24);
  border-color: rgba(255, 122, 0, 0.5);
}

.role-selected-empty {
  color: var(--muted);
}

.role-available-empty {
  color: var(--muted);
}

@media (max-width: 900px) {
  .role-form-top-grid,
  .role-form-people-grid,
  .role-form-values-grid {
    grid-template-columns: 1fr;
  }

  .role-form-grid {
    grid-template-columns: 1fr;
  }

  .role-form-aside {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
  }
}

/* Select2 global readability fixes */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--txt) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.select2-container--default .select2-selection__rendered,
.select2-container--default .select2-selection__choice,
.select2-container--default .select2-selection__placeholder {
  color: var(--txt) !important;
}

.select2-container--default .select2-selection__choice {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.select2-dropdown {
  background: #1f1f24 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.select2-container--default .select2-results__option {
  background: transparent !important;
  color: var(--txt) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(255, 122, 0, 0.22) !important;
  color: #fff !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--txt) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.select2-container--default .select2-results > .select2-results__options {
  background: #1f1f24 !important;
  color: var(--txt) !important;
}

.select2-container--default .select2-results__option--disabled {
  color: #9b9ba3 !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
  border-color: var(--laranja) !important;
  outline: none !important;
}

/* fallback: native select dropdown options */
.role-form select,
.role-form select option {
  background-color: #1f1f24;
  color: #f6f6f6;
}
