/* =============================================================
   components.css — Buttons, cards, forms, badges, tables, flash
   ============================================================= */

/* ----- Back link ------------------------------------------ */
.back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--text-muted); font-size: .82rem; font-weight: 500;
  margin-bottom: 1.25rem; transition: color .15s;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ----- Card ----------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: 
    8px 12px 24px rgba(0, 37, 85, 0.04),
    -8px -8px 24px rgba(255, 255, 255, 0.8),
    inset -4px -4px 10px rgba(0, 37, 85, 0.03),
    inset 4px 4px 10px rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 
    12px 18px 30px rgba(0, 37, 85, 0.06),
    -12px -12px 30px rgba(255, 255, 255, 0.9),
    inset -4px -4px 10px rgba(0, 37, 85, 0.02),
    inset 4px 4px 10px rgba(255, 255, 255, 0.98);
}

/* ----- Admin panel ---------------------------------------- */
.admin-panel { padding: 0; overflow: hidden; }
.admin-panel__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.5rem;
  background: var(--surface-tonal);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ----- Data table ----------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead th {
  background: var(--surface-tonal);
  color: var(--text-muted);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .75rem 1.1rem; text-align: left;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-tonal); }
.data-table tbody td { padding: .75rem 1.1rem; vertical-align: middle; }
.data-table tbody td:last-child { text-align: right; }
.data-table .empty-row td {
  text-align: center; color: var(--text-muted);
  padding: 3rem; font-size: .875rem;
}

/* ----- Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.3rem;
  border-radius: var(--radius-md); /* pill shape for claymorphism */
  font-weight: 700; font-size: .855rem; letter-spacing: -.01em;
  cursor: pointer;
  border: 1.5px solid rgba(0,37,85,0.08);
  background: linear-gradient(135deg, #f0f5fc 0%, #e1ebf7 100%);
  color: var(--primary);
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  white-space: nowrap; font-family: inherit;
  text-decoration: none; line-height: 1;
  box-shadow: 
    3px 4px 10px rgba(0, 37, 85, 0.05),
    inset -2px -2px 6px rgba(0, 37, 85, 0.04),
    inset 2px 2px 6px rgba(255, 255, 255, 0.85);
}
.btn:hover {
  text-decoration: none; color: var(--primary); transform: translateY(-1.5px);
  box-shadow: 
    4px 6px 14px rgba(0, 37, 85, 0.08),
    inset -2px -2px 6px rgba(0, 37, 85, 0.02),
    inset 2px 2px 6px rgba(255, 255, 255, 0.95);
}
.btn:active {
  transform: translateY(0.5px);
  box-shadow: 
    1px 2px 4px rgba(0, 37, 85, 0.05),
    inset -1px -1px 3px rgba(0, 37, 85, 0.04),
    inset 1px 1px 3px rgba(255, 255, 255, 0.8);
}

.btn-primary {
  background: linear-gradient(to bottom, #002555, #001f48);
  color: #fff;
  border-color: #001533;
  box-shadow: 
    3px 6px 12px rgba(0, 37, 85, 0.18),
    inset -3px -3px 6px rgba(0, 0, 0, 0.22),
    inset 3px 3px 6px rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(to bottom, #00306e, #002555);
  color: #fff;
  box-shadow: 
    4px 8px 16px rgba(0, 37, 85, 0.25),
    inset -3px -3px 6px rgba(0, 0, 0, 0.15),
    inset 3px 3px 6px rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: linear-gradient(to bottom, var(--accent), var(--accent-hv));
  color: #fff;
  border-color: rgba(74, 144, 226, 0.3);
  box-shadow: 
    3px 6px 12px rgba(74, 144, 226, 0.22),
    inset -3px -3px 6px rgba(0, 0, 0, 0.15),
    inset 3px 3px 6px rgba(255, 255, 255, 0.2);
}
.btn-accent:hover {
  background: linear-gradient(to bottom, #5ba4fc, var(--accent));
  color: #fff;
  box-shadow: 
    4px 8px 16px rgba(74, 144, 226, 0.3),
    inset -3px -3px 6px rgba(0, 0, 0, 0.1),
    inset 3px 3px 6px rgba(255, 255, 255, 0.25);
}

.btn-ghost {
  background: transparent; color: var(--primary);
  border: 1.5px solid rgba(0, 37, 85, 0.16);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(0, 37, 85, 0.04);
  box-shadow: 
    2px 4px 8px rgba(0, 37, 85, 0.04),
    inset -1px -1px 3px rgba(0, 37, 85, 0.02),
    inset 1px 1px 3px rgba(255, 255, 255, 0.8);
}

.btn-danger {
  background: linear-gradient(to bottom, var(--danger), #b91c1c);
  color: #fff;
  border-color: #991b1b;
  box-shadow: 
    3px 6px 12px rgba(220, 38, 38, 0.22),
    inset -3px -3px 6px rgba(0, 0, 0, 0.15),
    inset 3px 3px 6px rgba(255, 255, 255, 0.2);
}
.btn-danger:hover {
  background: linear-gradient(to bottom, #ef4444, var(--danger));
  color: #fff;
  box-shadow: 
    4px 8px 16px rgba(220, 38, 38, 0.3),
    inset -3px -3px 6px rgba(0, 0, 0, 0.1),
    inset 3px 3px 6px rgba(255, 255, 255, 0.25);
}

.btn-sm { padding: .32rem 1rem;  font-size: .78rem; }
.btn-xs { padding: .2rem .75rem;   font-size: .72rem; }

/* ----- Custom styled Uiverse button (Veloci adaptation) ------ */
.styled-button {
  position: relative;
  padding: .5rem 1.4rem;
  font-size: .855rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(to bottom, #002555, #001533);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 
    0 4px 10px rgba(0, 37, 85, 0.18), 
    inset 0 2px 4px rgba(255, 255, 255, 0.15), 
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #001026;
  text-decoration: none;
  font-family: inherit;
}
.styled-button::before {
  content: "";
  position: absolute;
  top: -2px; right: -1px; bottom: -1px; left: -1px;
  background: linear-gradient(to bottom, #003577, #000c1a);
  z-index: -1;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  opacity: 1;
}
.styled-button:hover {
  background: linear-gradient(to bottom, #00306e, #001c44);
  box-shadow: 
    0 6px 14px rgba(0, 37, 85, 0.25), 
    inset 0 2px 4px rgba(255, 255, 255, 0.2), 
    inset 0 -2px 4px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #ffffff;
  transform: translateY(-1.5px);
}
.styled-button:active {
  transform: translateY(0.5px);
  box-shadow: 
    0 2px 4px rgba(0, 37, 85, 0.12),
    inset 0 -1px 2px rgba(0,0,0,0.2);
}
.styled-button .inner-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #001c44, #000f26);
  width: 26px;
  height: 26px;
  margin-left: 8px;
  border-radius: 50%;
  box-shadow: 0 0 1px rgba(0, 0, 0, 1);
  border: 1px solid #000c1a;
  transition: all 0.2s ease;
}
.styled-button .inner-button::before {
  content: "";
  position: absolute;
  top: -2px; right: -1px; bottom: -1px; left: -1px;
  background: linear-gradient(to bottom, #002555, #000000);
  z-index: -1;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 1;
}
.styled-button .inner-button .icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: all 0.4s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}
.styled-button:hover .inner-button .icon {
  transform: rotate(-35deg);
}

/* ----- Forms ---------------------------------------------- */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block; font-weight: 600; font-size: .82rem;
  margin-bottom: .45rem; color: var(--text); letter-spacing: -0.01em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
.form-group input[type="file"] {
  width: 100%;
  padding: .7rem 1.1rem;
  border: 1.5px solid rgba(0, 37, 85, 0.05);
  border-radius: var(--radius-md);
  font-size: .895rem;
  background: var(--surface-tonal);
  color: var(--text);
  box-shadow: 
    inset 2px 2px 5px rgba(0, 37, 85, 0.05),
    inset -2px -2px 5px rgba(255, 255, 255, 0.85);
  transition: all 0.2s ease;
  font-family: inherit;
}
.form-group textarea { min-height: 90px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent); background: var(--surface);
  box-shadow: 
    0 0 0 3px var(--accent-glow),
    inset 1px 1px 3px rgba(0, 37, 85, 0.05);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-actions {
  display: flex; justify-content: flex-end; gap: .6rem;
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(0,37,85,.06);
}

/* ----- Badges --------------------------------------------- */
.badge {
  display: inline-block; padding: .22rem .65rem;
  border-radius: var(--radius-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.badge--blue   { background: #dbeafe; color: #1e40af; }
.badge--green  { background: #dcfce7; color: #15803d; }
.badge--orange { background: #ffedd5; color: #c2410c; }
.badge--red    { background: #fee2e2; color: #991b1b; }
.badge--gray   { background: #f1f5f9; color: #475569; }
.badge--yellow { background: #fef9c3; color: #a16207; }
.badge--indigo { background: #e0e7ff; color: #3730a3; }

/* ----- Flash messages ------------------------------------- */
.flash {
  padding: .8rem 1.1rem; border-radius: var(--radius-md);
  margin-bottom: 1rem; font-size: .875rem; font-weight: 500;
}
.flash--error   { background: #fff1f1; color: #991b1b; }
.flash--success { background: #f0fdf4; color: #15803d; }
.flash--info    { background: #eff6ff; color: #1e40af; }
.flash--warning { background: #fffbeb; color: #92400e; }

/* ----- Pagination ----------------------------------------- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; margin-top: 1.5rem;
}
.pagination a,
.pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 .6rem;
  border-radius: var(--radius-md);
  font-size: .82rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: background .15s, color .15s;
}
.pagination a:hover { background: var(--surface-tonal); color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; }
.pagination .disabled { opacity: .35; pointer-events: none; }

/* ----- Responsive components ------------------------------ */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  
  /* Ajustes nos Cartões */
  .card { padding: 1.25rem 1rem; }
  
  /* Interatividade Touch nos botões */
  .btn, .styled-button {
    padding: .65rem 1.2rem; /* Touch target mais generoso */
  }
  
  .btn:active, .styled-button:active {
    transform: scale(0.96) !important;
    transition: transform 0.1s ease !important;
  }
}

/* ----- Shared filters ------------------------------------- */
.filter-select,
.filter-input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1.5px solid rgba(0,37,85,.1);
  border-radius: var(--radius-md);
  font-size: .875rem;
  background: var(--surface-tonal);
  color: var(--text);
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(74,144,226,.15);
}

/* ----- Search input component ----------------------------- */
.search-input {
  width: 100%;
  padding: .6rem .75rem .6rem 2.5rem;
  border: 1.5px solid rgba(0,37,85,.12);
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(74,144,226,.15);
}

/* ----- Timeline component --------------------------------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: .55rem;
  top: .6rem; bottom: .6rem; width: 2px;
  background: var(--border); border-radius: 2px;
}
.timeline__item { position: relative; margin-bottom: 1.1rem; }
.timeline__marker {
  position: absolute; left: -1.635rem; top: .75rem;
  width: 12px; height: 12px; border-radius: 50%;
}
.timeline__marker--blue   { background:#3b82f6; box-shadow:0 0 0 3px #dbeafe; }
.timeline__marker--green  { background:#22c55e; box-shadow:0 0 0 3px #dcfce7; }
.timeline__marker--orange { background:#f97316; box-shadow:0 0 0 3px #ffedd5; }
.timeline__marker--yellow { background:#eab308; box-shadow:0 0 0 3px #fef9c3; }
.timeline__marker--red    { background:#ef4444; box-shadow:0 0 0 3px #fee2e2; }
.timeline__marker--gray   { background:#9ca3af; box-shadow:0 0 0 3px #f3f4f6; }
.timeline__content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: .85rem 1.1rem;
  box-shadow: var(--shadow-ambient);
}
.timeline__header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: .75rem; flex-wrap: wrap;
}

