 
/* ============================================================================
   app.css — Estilos partilhados do InnCore.
   ========================================================================== */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #28595e;
  outline-offset: 2px;
}

/* -------------------------------- Botões -------------------------------- */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-danger-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease,
    border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled,
.btn-danger:disabled,
.btn-danger-solid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  color: #ffffff;
  background-color: #28595e;
  border: 1px solid #28595e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.btn-primary:hover:not(:disabled) {
  background-color: #fd812a;
  border-color: #fd812a;
}

.btn-secondary {
  color: #374151;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover:not(:disabled) { background-color: #f9fafb; }

.btn-success {
  color: #ffffff;
  background-color: #16a34a;
  border: 1px solid #16a34a;
}
.btn-success:hover:not(:disabled) { background-color: #15803d; }

.btn-danger {
  color: #dc2626;
  background-color: #ffffff;
  border: 1px solid #fecaca;
}
.btn-danger:hover:not(:disabled) { background-color: #fef2f2; }

.btn-danger-solid {
  color: #ffffff;
  background-color: #dc2626;
  border: 1px solid #dc2626;
}
.btn-danger-solid:hover:not(:disabled) { background-color: #b91c1c; }

.link-btn,
.link-btn-danger {
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.link-btn { color: #28595e; }
.link-btn:hover { text-decoration: underline; color: #fd812a; }
.link-btn-danger { color: #dc2626; }
.link-btn-danger:hover { text-decoration: underline; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #4b5563;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: #f9fafb; color: #28595e; }
.icon-btn-danger { color: #dc2626; border-color: #fecaca; }
.icon-btn-danger:hover { background: #fef2f2; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: #f9fafb; }
.chip-active {
  background: #28595e;
  border-color: #28595e;
  color: #ffffff;
}

/* -------------------------------- Inputs -------------------------------- */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: #28595e;
  box-shadow: 0 0 0 3px rgba(40, 89, 94, 0.15);
}
.input:disabled,
.select:disabled,
.textarea:disabled {
  background-color: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}
.textarea { resize: vertical; }

.input.w-auto { width: auto; }
.input.w-64 { width: 16rem; }
.input.w-56 { width: 14rem; }
.input.w-40 { width: 10rem; }
.input.w-28 { width: 7rem; }
.input.w-24 { width: 6rem; }

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

/* ---------------------------- Cartões / tabelas -------------------------- */
.card {
  background-color: #ffffff;
  border: 1px solid #f1f2f4;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.table-head {
  background-color: rgba(40, 89, 94, 0.05);
  color: #28595e;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
}

/* -------------------------------- Badges -------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-gray   { background-color: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.badge-green  { background-color: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-red    { background-color: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-blue   { background-color: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.badge-indigo { background-color: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge-amber  { background-color: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-purple { background-color: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.badge-teal   { background-color: #ccfbf1; color: #0f766e; border-color: #99f6e4; }

/* -------------------------------- Toasts -------------------------------- */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 2rem);
}
.toast-item { pointer-events: auto; animation: toast-in 0.22s ease-out; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(1rem); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --------------------------- Skeleton / spinner -------------------------- */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 37%, #e5e7eb 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton-loading {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
.spinner-dark {
  border-color: rgba(40, 89, 94, 0.25);
  border-top-color: #28595e;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------- Sidebar -------------------------------- */
.thin-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
.thin-scroll { scrollbar-width: thin; }

.thin-scroll-light::-webkit-scrollbar { width: 6px; height: 6px; }
.thin-scroll-light::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
.thin-scroll-light { scrollbar-width: thin; }

.sidebar-mobile { transition: transform 0.3s ease-in-out, width 0.25s ease; }
#sidebar .si-label { display: inline; }

@media (min-width: 768px) {
  #sidebar.is-collapsed { width: 4.5rem; }
  #sidebar.is-collapsed .si-label { display: none !important; }
  #sidebar.is-collapsed .si-header {
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    height: auto;
  }
  #sidebar.is-collapsed .si-tenant {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  #sidebar.is-collapsed .si-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  #sidebar.is-collapsed .si-collapse-btn svg { transform: rotate(180deg); }
  #sidebar.is-collapsed .si-footer {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
}

#sidebar.is-collapsed .si-item { position: relative; }
#sidebar.is-collapsed .si-item:hover::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 0.6rem);
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  color: #ffffff;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 60;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* -------------------------------- Diversos ------------------------------- */
.no-select { user-select: none; }
.tabular-nums { font-variant-numeric: tabular-nums; }

.search-results {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 40;
  overflow: hidden;
}
.search-results button {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  text-align: left;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
}
.search-results button:hover { background: #f9fafb; color: #28595e; }

/* Drawer lateral (folio). */
.drawer-panel {
  position: fixed;
  inset-block: 0;
  right: 0;
  z-index: 50;
  width: 100%;
  max-width: 42rem;
  background: #ffffff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.22s ease-out;
}
@keyframes drawer-in {
  from { transform: translateX(2rem); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
