/* ═══════════════════════════════════════════════════════════════════════════
   CatalogLinks – Folha de estilos principal
   Cores: Azul #093759 | Laranja #FF7F00 | Texto #000 / #555
═══════════════════════════════════════════════════════════════════════════ */

:root {
  --blue:        #093759;
  --blue-dark:   #062a45;
  --blue-light:  #0d4b78;
  --orange:      #FF7F00;
  --orange-dark: #e67300;
  --text:        #111111;
  --muted:       #555555;
  --bg:          #f4f6f9;
  --card-shadow: 0 2px 8px rgba(0,0,0,.10);
  --card-hover:  0 6px 20px rgba(0,0,0,.18);
  --radius:      12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

/* ─── Scrollbar discreta ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════════════════════ */
.navbar-main {
  background: var(--blue);
  height: 52px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  z-index: 1050;
}

.nav-logo-badge {
  width: 34px; height: 34px;
  background: var(--orange);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem; color: #fff;
  letter-spacing: .5px;
  flex-shrink: 0;
}

.nav-brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .5px;
}

.nav-counter {
  color: rgba(255,255,255,.65);
  font-size: .8rem;
  border-right: 1px solid rgba(255,255,255,.2);
  padding-right: 12px;
  margin-right: 4px;
}

/* Botões da navbar */
.btn-orange {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-orange:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }

.btn-user {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: .85rem;
}
.btn-user:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-user::after { border-top-color: rgba(255,255,255,.8); }

.btn-primary-brand {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}
.btn-primary-brand:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD – CORPO PRINCIPAL
═══════════════════════════════════════════════════════════════════════════ */
.dashboard-body {
  padding-top: 62px;   /* altura navbar + folga */
  min-height: 100vh;
}

.cards-grid {
  padding: .75rem;
}

/* ─── Estado vazio ─────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}
.empty-icon { font-size: 5rem; color: #ccc; }

/* ═══════════════════════════════════════════════════════════════════════════
   CATALOG CARD
═══════════════════════════════════════════════════════════════════════════ */
.catalog-card {
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
  border: 1px solid rgba(0,0,0,.06);
  height: 100%;
}
.catalog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover);
}
.catalog-card.card-inactive {
  opacity: .55;
  filter: grayscale(.4);
}

/* ── Cabeçalho com imagem/cor ─────────────────────────────────────────── */
.card-header-bg {
  height: 72px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}
.card-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 25%, rgba(0,0,0,.58));
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-bg-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 6px;
  gap: 4px;
}
.card-bg-title {
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  max-width: calc(100% - 50px);
}
.badge-inactive {
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: .6rem;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Corpo do card ────────────────────────────────────────────────────── */
.card-body-area {
  padding: 7px 9px 5px;
  flex: 1;
  min-width: 0;
}

.card-url-link {
  display: block;
  font-size: .72rem;
  color: var(--orange);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  transition: color .15s;
}
.card-url-link:hover { color: var(--orange-dark); text-decoration: underline; }

/* Linha de credencial */
.cred-row {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  margin-bottom: 3px;
}
.cred-icon {
  font-size: .75rem;
  color: var(--muted);
  flex-shrink: 0;
  width: 13px;
  text-align: center;
}
.cred-val {
  font-size: .75rem;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cred-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 1px 3px;
  cursor: pointer;
  color: #999;
  border-radius: 4px;
  font-size: .72rem;
  line-height: 1;
  transition: background .12s, color .12s;
}
.cred-btn:hover { background: rgba(0,0,0,.07); color: var(--blue); }
.cred-btn .bi-check2 { color: #198754 !important; }

/* Observações */
.card-obs {
  font-size: .67rem;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.card-obs i { margin-right: 2px; }

/* ── Rodapé do card ───────────────────────────────────────────────────── */
.card-footer-area {
  padding: 4px 8px;
  background: rgba(0,0,0,.025);
  border-top: 1px solid rgba(0,0,0,.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.click-badge {
  font-size: .68rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 2px;
}
.click-badge i { color: var(--orange); }

.card-actions {
  display: flex;
  gap: 1px;
}
.act-btn {
  background: none;
  border: none;
  padding: 2px 5px;
  cursor: pointer;
  border-radius: 5px;
  font-size: .78rem;
  line-height: 1;
  color: #888;
  transition: background .12s;
}
.act-btn:hover { background: rgba(0,0,0,.08); }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTAS FLUTUANTES
═══════════════════════════════════════════════════════════════════════════ */
.alerts-container {
  position: fixed;
  top: 60px;
  right: 1rem;
  z-index: 1060;
  width: 360px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.alerts-container .alert {
  font-size: .875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  border: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════════════════════ */
.modal-header {
  background: var(--blue);
  color: #fff;
  border-radius: .5rem .5rem 0 0;
  padding: .85rem 1.25rem;
}
.modal-title { font-size: .95rem; font-weight: 700; }

.modal-body label.form-label { font-size: .82rem; margin-bottom: .25rem; }
.modal-body .input-group-text { background: #f8f9fa; color: var(--blue); font-size: .85rem; }

/* ── Barra de tipo de imagem ────────────────────────────────────────────── */
.img-type-bar {
  display: flex;
  gap: 6px;
}
.img-type-btn {
  flex: 1;
  padding: 5px 4px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
  text-align: center;
}
.img-type-btn:hover { border-color: #adb5bd; color: var(--text); }
.img-type-btn.active {
  border-color: var(--blue);
  background: rgba(9,55,89,.06);
  color: var(--blue);
}

/* ── Swatches de cor ────────────────────────────────────────────────────── */
.color-swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.color-swatch:hover, .color-swatch.selected {
  border-color: #222;
  transform: scale(1.18);
}

/* ── Prévia do card no modal ────────────────────────────────────────────── */
.card-preview-box {
  border: 1px solid #dee2e6;
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-label {
  background: #f8f9fa;
  font-size: .7rem;
  color: var(--muted);
  text-align: center;
  padding: 2px;
  border-bottom: 1px solid #dee2e6;
}
.card-preview-bg {
  height: 72px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════════════════════ */
.login-wrap {
  display: flex;
  min-height: 100vh;
}

/* Painel esquerdo */
.login-left {
  width: 42%;
  background: var(--blue);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,127,0,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.06) 0%, transparent 40%);
}
.login-brand { position: relative; z-index: 1; text-align: center; }

.brand-badge {
  width: 80px; height: 80px;
  background: var(--orange);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; color: #fff;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.brand-name { font-size: 2rem; font-weight: 800; letter-spacing: .5px; margin-bottom: .5rem; }
.brand-tag  { color: rgba(255,255,255,.7); font-size: .95rem; margin-bottom: 1.75rem; }

.brand-features {
  list-style: none;
  padding: 0; margin: 0;
  text-align: left;
  display: inline-block;
}
.brand-features li {
  color: rgba(255,255,255,.75);
  font-size: .88rem;
  padding: .3rem 0;
  display: flex; align-items: center; gap: .5rem;
}
.brand-features li i { color: var(--orange); font-size: .95rem; }

/* Painel direito */
.login-right {
  flex: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
}
.login-form-wrap {
  width: 100%;
  max-width: 400px;
}

/* Mobile brand badge */
.brand-badge-sm {
  width: 42px; height: 42px;
  background: var(--blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
}

/* Tabs de login */
.login-tabs {
  border-bottom: 2px solid #e9ecef;
}
.login-tabs .nav-link {
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
  font-size: .9rem;
  padding: .5rem 1.1rem;
  transition: color .15s, border-color .15s;
}
.login-tabs .nav-link:hover { color: var(--blue); }
.login-tabs .nav-link.active {
  color: var(--blue);
  border-bottom-color: var(--orange);
  background: none;
  font-weight: 600;
}

/* ─── Utilitários ────────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .2rem rgba(9,55,89,.15);
}
.input-group-text {
  border-color: #ced4da;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD – NOVO LAYOUT SPLIT (cards + bookmarks)
═══════════════════════════════════════════════════════════════════════════ */

/* Corpo principal: fill viewport abaixo da navbar */
.dashboard-body {
  height: 100vh;
  padding-top: 52px;        /* navbar height */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ── Barra de busca ──────────────────────────────────────────────────────── */
.search-zone {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  z-index: 10;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-icon-inline {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: .85rem;
  pointer-events: none;
}

.search-field {
  width: 100%;
  padding: 6px 32px 6px 30px;
  border: 1.5px solid #dee2e6;
  border-radius: 8px;
  font-size: .86rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: #fafafa;
  color: var(--text);
}
.search-field:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(9,55,89,.1);
}
.search-field::placeholder { color: #bbb; }

.search-clear-btn {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: #aaa; cursor: pointer;
  font-size: .8rem; padding: 2px 4px;
  border-radius: 4px;
  transition: color .12s;
}
.search-clear-btn:hover { color: var(--text); }

.search-count {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Área split ──────────────────────────────────────────────────────────── */
.content-split {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Coluna dos cards: flex-column para empurrar footer para baixo ────────── */
.cards-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Painel de cards (área rolável) ─────────────────────────────────────── */
.cards-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

/* ── Rodapé fixo na base da coluna de cards ──────────────────────────────── */
.cards-footer {
  flex-shrink: 0;
  padding: .45rem 1rem;
  border-top: 1px solid #e9ecef;
  font-size: .62rem;
  color: #bbb;
  text-align: center;
  line-height: 1.4;
  background: var(--bg);
}
/* Scrollbar ultra-fina e discreta – desaparece visualmente quando não rola */
.cards-panel::-webkit-scrollbar { width: 4px; }
.cards-panel::-webkit-scrollbar-track { background: transparent; }
.cards-panel::-webkit-scrollbar-thumb {
  background: rgba(9,55,89,.18);
  border-radius: 4px;
}
.cards-panel::-webkit-scrollbar-thumb:hover { background: rgba(9,55,89,.38); }
/* Firefox */
.cards-panel { scrollbar-width: thin; scrollbar-color: rgba(9,55,89,.18) transparent; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}
.empty-icon { font-size: 4.5rem; color: #ccc; }

/* ── Painel de bookmarks ─────────────────────────────────────────────────── */
.bm-panel {
  width: 300px;
  min-width: 240px;
  max-width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  border-left: 2px solid #e9ecef;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Cabeçalho do painel */
.bm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 12px;
  background: var(--blue);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.bm-header-title {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}
.bm-total-count {
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: .68rem;
  padding: 1px 6px;
  border-radius: 10px;
}
.bm-header-actions { display: flex; gap: 2px; }
.bm-hdr-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: rgba(255,255,255,.85);
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-size: .78rem;
  transition: background .12s;
}
.bm-hdr-btn:hover { background: rgba(255,255,255,.3); color: #fff; }
.bm-add-btn { background: var(--orange); color: #fff !important; }
.bm-add-btn:hover { background: var(--orange-dark) !important; }

/* ── Árvore de bookmarks ─────────────────────────────────────────────────── */
.bm-tree {
  flex: 1;
  padding: 4px 0;
}

/* Item raiz / item dentro de pasta */
.bm-item {
  display: flex;
  align-items: center;
  padding: 4px 10px 4px 8px;
  gap: 4px;
  border-bottom: 1px solid #f3f4f6;
  transition: background .1s;
}
.bm-item:hover {
  background: rgba(9,55,89,.04);
}
.bm-item.bm-item-nested {
  padding-left: 22px;
  background: #fafafa;
}
.bm-item.bm-item-nested:hover { background: #f0f4f8; }

.bm-icon {
  color: var(--orange);
  font-size: .82rem;
  flex-shrink: 0;
}

.bm-link {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
  font-size: .78rem;
  overflow: hidden;
}
.bm-link:hover { color: var(--blue); }
.bm-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.bm-item-actions {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.bm-item:hover .bm-item-actions { opacity: 1; }

.bm-act-btn {
  background: none; border: none;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  font-size: .72rem;
  color: #aaa;
  transition: color .12s, background .12s;
}
.bm-act-btn:hover { background: rgba(0,0,0,.08); color: var(--blue); }
.bm-act-btn:last-child:hover { color: #dc3545; }

/* ── Pasta ───────────────────────────────────────────────────────────────── */
.bm-folder-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 8px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  transition: background .12s;
}
.bm-folder-header:hover { background: #eef2f8; }

.bm-chevron {
  font-size: .7rem;
  color: var(--muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.bm-folder.open .bm-chevron { transform: rotate(90deg); }

.bm-folder-icon {
  font-size: .85rem;
  color: var(--orange);
  flex-shrink: 0;
}
.bm-folder.open .bm-folder-icon::before { content: "\f3d1"; } /* bi-folder2-open */

.bm-folder-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bm-folder-count {
  font-size: .68rem;
  color: var(--muted);
  flex-shrink: 0;
}

.bm-folder-items { display: none; }
.bm-folder.open .bm-folder-items { display: block; }

/* Estado vazio de bookmarks */
.bm-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

/* ── Rodapé (usado em login e no painel de cards) ────────────────────────── */
.login-footer {
  margin-top: 1.25rem;
  padding: .6rem 1rem;
  border-top: 1px solid #e9ecef;
  font-size: .63rem;
  color: #bbb;
  text-align: center;
  line-height: 1.5;
}

/* ── Botão Exportar ──────────────────────────────────────────────────────── */
.btn-export {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  transition: background .15s;
}
.btn-export:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVIDADE
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  /* No mobile o layout volta a ser linear */
  html, body { overflow: auto !important; height: auto !important; }
  .dashboard-body { height: auto; overflow: visible; }
  .content-split { flex-direction: column; overflow: visible; }
  .cards-panel { overflow-y: visible; }
  .bm-panel {
    width: 100%; max-width: none; min-width: 0;
    border-left: none; border-top: 2px solid #e9ecef;
    max-height: 60vh; /* limita altura no mobile */
  }
}
@media (max-width: 575px) {
  .cards-grid { padding: .5rem; }
  .catalog-card { border-radius: 10px; }
  .card-header-bg { height: 60px; }
  .search-zone { padding: 6px 8px; }
}
@media (max-width: 767px) {
  .login-wrap { flex-direction: column; }
  .login-right { padding: 2rem 1.25rem; }
}
