/* ============================================================
   ARCOLL 2028 — acoll.css
   Redesign: header com brand, sidebar sem user-card,
   footer rodapé com 4 ícones, sem scrollbars visíveis,
   footer sempre visível.
   ============================================================ */

:root {
  --bg:             #0b1020;
  --panel:          rgba(255,255,255,0.86);
  --panel-strong:   #ffffff;
  --panel-soft:     rgba(255,255,255,0.68);
  --stroke:         rgba(15,23,42,0.08);
  --stroke-strong:  rgba(15,23,42,0.14);
  --text:           #0f172a;
  --muted:          #64748b;
  --primary:        #10b981;
  --primary-strong: #059669;
  --primary-soft:   rgba(16,185,129,0.12);
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --shadow-lg:      0 32px 80px rgba(2,6,23,.16);
  --shadow-md:      0 18px 40px rgba(2,6,23,.1);
  --radius-xl:      24px;
  --radius-lg:      18px;
  --radius-md:      14px;
  --sidebar-width:           280px;
  --sidebar-width-collapsed:  72px;
  --topbar-h:       72px;
  --footer-h:       56px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* Esconde TODAS as scrollbars — mantém scroll funcional */
* {
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
}
*::-webkit-scrollbar { display: none; } /* Chrome/Safari */

html, body { height: 100%; margin: 0; overflow: hidden; }

body.acoll-body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left,  rgba(16,185,129,.14), transparent 22%),
    radial-gradient(circle at 100% 20%,  rgba(59,130,246,.12), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

a { text-decoration: none; }
img { max-width: 100%; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: padding-left .25s ease;
}

.sidebar-collapsed .app-main {
  padding-left: var(--sidebar-width-collapsed);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(2,6,23,.45);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: .25s ease;
  z-index: 1030;
}
.sidebar-overlay.is-open { opacity: 1; visibility: visible; }

.sidebar {
  position: fixed;
  inset: 12px auto 12px 12px;
  width: calc(var(--sidebar-width) - 12px);
  background: linear-gradient(180deg, rgba(15,23,42,.97), rgba(17,24,39,.94));
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 26px;
  z-index: 1040;
  box-shadow: 0 24px 60px rgba(2,6,23,.36);
  display: flex;
  flex-direction: column;
  padding: 1rem .85rem;
  transition: width .25s ease, transform .25s ease;
  overflow: hidden;
}

.sidebar--admin {
  background: linear-gradient(180deg, rgba(2,6,23,.99), rgba(15,23,42,.96));
}

/* Topo do sidebar */
.sidebar__head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.1rem;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  flex: 1;
  color: #fff;
}

.sidebar-brand__logo {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(16,185,129,.9), rgba(14,165,233,.9));
  box-shadow: 0 8px 20px rgba(16,185,129,.22);
  overflow: hidden;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sidebar-brand__logo.is-admin {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 8px 20px rgba(99,102,241,.22);
}
.sidebar-brand__logo img  { width: 100%; height: 100%; object-fit: cover; }
.sidebar-brand__text      { min-width: 0; display: flex; flex-direction: column; }
.sidebar-brand__text strong {
  font-size: .95rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand__text span {
  font-size: .72rem; color: rgba(255,255,255,.55);
}

.sidebar-collapse-btn {
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  transition: background .15s;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: .15rem;
  margin: 0 -.15rem;
}

.sidebar-nav__list,
.sidebar-submenu { list-style: none; margin: 0; padding: 0; }

.sidebar-nav__section {
  padding: .9rem .75rem .4rem;
  font-size: .68rem; font-weight: 700;
  color: rgba(255,255,255,.38);
  text-transform: uppercase; letter-spacing: .09em;
}

.sidebar-nav__item { margin-bottom: .25rem; }

.sidebar-link {
  width: 100%;
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,.75);
  padding: .8rem .85rem;
  border-radius: 16px;
  transition: .18s ease;
  border: 1px solid transparent;
  background: transparent;
  font-size: .9rem;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sidebar-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(16,185,129,.26), rgba(59,130,246,.2));
  border-color: rgba(255,255,255,.1);
}

.sidebar-link__icon {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-link.is-active .sidebar-link__icon { background: rgba(255,255,255,.15); }

.sidebar-link__label {
  flex: 1; text-align: left;
  font-weight: 600; font-size: .9rem;
}
.sidebar-link__arrow { transition: transform .2s ease; }
.sidebar-link[aria-expanded="true"] .sidebar-link__arrow { transform: rotate(90deg); }

.sidebar-link--sub { padding: .6rem .75rem .6rem 1rem; margin-top: .2rem; }
.sidebar-link--sub .sidebar-link__icon {
  width: 28px; height: 28px; border-radius: 9px; font-size: .88rem;
}

/* Rodapé do sidebar: 4 ícones na mesma linha */
.sidebar__foot {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: .75rem .5rem .5rem;
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: .5rem;
  flex-shrink: 0;
  gap: .25rem;
}

.sidebar-foot-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: inline-grid; place-items: center;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.07);
  font-size: 1.15rem;
  transition: .18s ease;
  flex-shrink: 0;
}
.sidebar-foot-icon:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  transform: translateY(-1px);
}
.sidebar-foot-icon--danger { color: #fca5a5; }
.sidebar-foot-icon--danger:hover {
  background: rgba(239,68,68,.18);
  color: #fecaca;
}

/* Sidebar colapsado */
.sidebar-collapsed .sidebar {
  width: calc(var(--sidebar-width-collapsed) - 12px);
}
.sidebar-collapsed .sidebar-brand__text,
.sidebar-collapsed .sidebar-link__label,
.sidebar-collapsed .sidebar-link__arrow,
.sidebar-collapsed .sidebar-nav__section {
  display: none;
}
.sidebar-collapsed .sidebar-link   { justify-content: center; padding: .8rem; }
.sidebar-collapsed .sidebar__foot  { flex-direction: column; }
.sidebar-collapsed .sidebar-foot-icon { width: 38px; height: 38px; }

/* ============================================================
   TOPBAR (HEADER)
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  margin: 12px 12px 0 12px;
  padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  height: var(--topbar-h);
  flex-shrink: 0;
}

.topbar__left,
.topbar__right { display: flex; align-items: center; gap: .75rem; }

/* Brand no header */
.topbar-brand {
  display: flex; align-items: center; gap: .75rem;
  min-width: 0;
}

.topbar-brand__logo-img {
  height: 40px; width: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.topbar-brand__logo-init {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff;
  font-weight: 800; font-size: 1.1rem;
  flex-shrink: 0;
}

.topbar-brand__text {
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar-brand__text strong {
  font-size: .95rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.topbar-brand__text span {
  font-size: .78rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Botões de ícone */
.topbar-icon-btn {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(15,23,42,.08);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(148,163,184,.1);
  transition: transform .18s, box-shadow .18s;
  font-size: 1.1rem;
}
.topbar-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(148,163,184,.16);
  color: var(--text);
}
.has-indicator { position: relative; }
.topbar-notif-count {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 3px;
  display: inline-grid; place-items: center;
  border-radius: 999px; font-size: .62rem; font-weight: 700;
  color: #fff; background: var(--danger);
}

/* Avatar do usuário — somente foto, sem texto */
.topbar-avatar-btn {
  padding: 0;
  background: transparent;
  border: 2px solid rgba(15,23,42,.1);
  border-radius: 999px;
  line-height: 0;
  transition: border-color .18s, box-shadow .18s;
}
.topbar-avatar-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.topbar-avatar-img {
  width: 40px; height: 40px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

/* Dropdowns */
.topbar-dropdown {
  min-width: 300px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  border-radius: 20px;
  padding: .55rem;
}
.topbar-dropdown__header,
.topbar-dropdown__footer,
.topbar-dropdown__profile { padding: .5rem .6rem; }

.topbar-dropdown__profile {
  display: flex; align-items: center; gap: .75rem;
}
.topbar-dropdown__avatar {
  width: 42px; height: 42px;
  border-radius: 13px; object-fit: cover; flex-shrink: 0;
}
.topbar-dropdown__profile strong { display: block; font-size: .9rem; }
.topbar-dropdown__profile span   { font-size: .78rem; color: var(--muted); }

.topbar-dropdown__header {
  display: flex; justify-content: space-between; gap: 1rem;
}
.topbar-dropdown__header small { display: block; color: var(--muted); font-size: .78rem; }
.topbar-dropdown__footer a { font-size: .83rem; color: var(--primary-strong); }

.topbar-notifications {
  display: grid; gap: .3rem;
  max-height: 300px; overflow-y: auto;
  padding: .15rem .05rem;
}

.topbar-empty-state,
.topbar-notification-item {
  display: flex; gap: .75rem; align-items: center;
  padding: .8rem; border-radius: 14px;
}
.topbar-empty-state {
  justify-content: center; color: var(--muted);
  min-height: 100px; flex-direction: column;
}
.topbar-notification-item { color: var(--text); background: #f8fafc; }
.topbar-notification-item.is-unread { background: rgba(16,185,129,.08); }
.topbar-notification-item__icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: #fff; color: var(--primary-strong); flex-shrink: 0;
}
.topbar-notification-item__body { display: flex; flex-direction: column; gap: .15rem; }
.topbar-notification-item__body strong { font-size: .86rem; }
.topbar-notification-item__body span   { font-size: .78rem; color: var(--muted); }

/* ============================================================
   MAIN CONTENT + FOOTER
   ============================================================ */
.app-main {
  /* já declarado acima com flex-direction:column e height:100vh */
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: .85rem 12px 0;
}

.main-content__inner {
  padding-bottom: 1rem;
}

/* Footer sempre visível na parte inferior */
.app-footer {
  flex-shrink: 0;
  margin: 0 12px 12px;
  padding: .85rem 1.1rem;
  border-radius: 20px;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: center;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow-md);
  color: #334155;
  font-size: .85rem;
}
.app-footer strong { display: block; font-weight: 700; }
.app-footer span   { color: var(--muted); }
.app-footer__meta  {
  display: inline-flex; gap: 1rem; align-items: center; font-weight: 700;
}

/* ============================================================
   FLASH / PAGE REGIONS
   ============================================================ */
.page-region, .acoll-modal-view { display: grid; gap: 1rem; }
.acoll-flash-stack { display: grid; gap: .7rem; margin-bottom: 1rem; }
.alert { border: 0; border-radius: 16px; box-shadow: var(--shadow-md); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--primary-strong); font-size: .73rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}

/* ============================================================
   PAGE HEADER / HERO
   ============================================================ */
.page-header, .hero-panel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--shadow-md);
}
.page-header h4, .page-header h1, .page-header h2,
.hero-panel__title { margin: 0; font-weight: 800; }
.page-header p, .hero-panel__text { margin: .2rem 0 0; color: var(--muted); }

/* ============================================================
   CARDS / FORMS
   ============================================================ */
.card, .form-section, .metric-card, .stat-card {
  border: 1px solid rgba(255,255,255,.72) !important;
  background: var(--panel) !important;
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-md);
}
.card-header {
  padding: 1rem 1.2rem;
  background: transparent !important;
  border-bottom: 1px solid rgba(15,23,42,.06) !important;
}
.card-body, .card-footer, .form-section { padding: 1.1rem 1.2rem; }
.card-footer {
  background: transparent !important;
  border-top: 1px solid rgba(15,23,42,.06) !important;
}
.form-section { display: block; }

.form-control, .form-select,
.select2-container--bootstrap-5 .select2-selection {
  border-radius: 14px !important;
  border: 1px solid var(--stroke-strong) !important;
  min-height: 46px;
  background: rgba(255,255,255,.9) !important;
  box-shadow: none !important;
}
textarea.form-control { min-height: 110px; }
.form-control:focus, .form-select:focus {
  border-color: rgba(16,185,129,.45) !important;
  box-shadow: 0 0 0 .2rem rgba(16,185,129,.1) !important;
}
.form-label { font-weight: 700; font-size: .86rem; color: #334155; }

.btn {
  border-radius: 14px !important;
  font-weight: 700 !important;
  padding: .75rem 1rem !important;
  box-shadow: none !important;
}
.btn-sm { padding: .5rem .8rem !important; border-radius: 11px !important; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #14b8a6) !important;
  border: 0 !important;
}
.btn-outline-primary { border-color: rgba(16,185,129,.25) !important; color: var(--primary-strong) !important; }
.btn-outline-danger  { border-color: rgba(239,68,68,.22)  !important; color: #b91c1c !important; }
.badge { border-radius: 999px; padding: .45rem .65rem; font-weight: 700; }

/* ============================================================
   TABELAS
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; font-weight: 800;
  background: rgba(248,250,252,.8) !important;
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.table > :not(caption) > * > * {
  padding: .9rem .85rem;
  border-color: rgba(15,23,42,.05);
  vertical-align: middle;
}
.table tbody tr:hover { background: rgba(255,255,255,.5); }

/* ============================================================
   METRIC / STAT CARDS
   ============================================================ */
.metric-card, .stat-card {
  position: relative; overflow: hidden;
  color: #fff !important;
  padding: 1.1rem 1.1rem 1rem;
  min-height: 170px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.metric-card::before, .stat-card::before {
  content: ''; position: absolute; inset: auto -20% -35% auto;
  width: 150px; height: 150px; border-radius: 999px;
  background: rgba(255,255,255,.1);
}
.metric-card--cyan   { background: linear-gradient(135deg, #06b6d4, #2563eb) !important; }
.metric-card--green  { background: linear-gradient(135deg, #10b981, #059669) !important; }
.metric-card--amber  { background: linear-gradient(135deg, #f59e0b, #ea580c) !important; }
.metric-card--rose   { background: linear-gradient(135deg, #fb7185, #ef4444) !important; }
.metric-card__icon, .stat-card-icon {
  width: 48px; height: 48px; border-radius: 16px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 1.35rem;
}
.metric-card__label {
  font-size: .78rem; letter-spacing: .04em;
  text-transform: uppercase; opacity: .88; font-weight: 700;
}
.metric-card__value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.metric-card__meta  { font-size: .82rem; opacity: .85; }

.summary-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .95rem 1rem;
  border-radius: 16px;
  background: rgba(248,250,252,.88);
  border: 1px solid rgba(15,23,42,.05);
}
.summary-item strong { display: block; }
.summary-item span:not(.badge) { display: block; color: var(--muted); font-size: .84rem; }

/* ============================================================
   DATATABLES
   ============================================================ */
.dt-toolbar, .dt-footer { padding: .8rem .95rem; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 11px;
  border: 1px solid var(--stroke-strong);
  padding: .4rem .7rem;
}

/* ============================================================
   MODAL CRUD
   ============================================================ */
.acoll-modal .modal-dialog {
  max-width: min(1100px, calc(100vw - 24px));
}
.acoll-modal .modal-content {
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 26px; overflow: hidden;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}
.acoll-modal .modal-header {
  border-bottom: 1px solid rgba(15,23,42,.06);
  padding: 1.1rem 1.25rem;
}
.acoll-modal .modal-body {
  padding: 1.15rem 1.25rem;
  background: linear-gradient(180deg, rgba(248,250,252,.92), rgba(255,255,255,.8));
}
.acoll-modal-loading {
  min-height: 240px; display: grid; place-items: center;
  gap: .8rem; color: var(--muted);
}

/* ============================================================
   IMPERSONATION BANNER
   ============================================================ */
.impersonation-banner {
  display: flex; align-items: center; gap: .55rem;
  padding: .4rem 1.1rem;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #1c1917; font-size: .82rem; font-weight: 500;
  position: sticky; top: 0; z-index: 1100;
  border-bottom: 2px solid #92400e;
}
.impersonation-banner i  { font-size: 1.05rem; }
.impersonation-banner strong { font-weight: 700; }
.impersonation-banner .btn-warning {
  background: rgba(0,0,0,.15); border: 1.5px solid rgba(0,0,0,.22);
  color: #1c1917; font-weight: 600; border-radius: 8px;
  font-size: .78rem; padding: .2rem .65rem;
}
.impersonation-banner .btn-warning:hover { background: rgba(0,0,0,.25); }

/* ============================================================
   SETTINGS TABS
   ============================================================ */
.palette-card:hover {
  border-color: #5856d6 !important;
  box-shadow: 0 0 0 2px #5856d61a;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
  .app-main { padding-left: 0; }
  .sidebar-collapsed .app-main { padding-left: 0; }

  .sidebar {
    transform: translateX(-120%);
    width: min(84vw, 300px);
    inset: 10px auto 10px 10px;
  }
  .sidebar.is-open { transform: translateX(0); }

  .topbar { margin: 10px 10px 0; }
  .main-content { padding: .75rem 10px 0; }
  .app-footer { margin: 0 10px 10px; }
}

@media (max-width: 767.98px) {
  .topbar { border-radius: 18px; padding: .65rem .85rem; }
  .topbar-brand__text span { display: none; }
  .page-header, .hero-panel { padding: .9rem 1rem; border-radius: 20px; }
  .card-header, .card-body, .card-footer, .form-section { padding: .9rem 1rem; }
  .app-footer { border-radius: 18px; font-size: .8rem; }
  .btn { width: 100%; justify-content: center; }
  .page-header .btn, .page-header form { width: 100%; }
}
