/* =========================================================
   modern-styles.css — Componentes das views admin
   Paleta: teal (#0d9488) — combina com o layout Tailwind
   ========================================================= */

/* ── Página ─────────────────────────────────────────────── */
.modern-page-container { width: 100%; }

.page-header {
    margin-bottom: 1.5rem;
}
.page-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}
.page-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* ── Botões ─────────────────────────────────────────────── */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.btn-modern.btn-primary {
    background: #0d9488;
    color: #fff;
    box-shadow: 0 1px 3px rgba(13,148,136,.25);
}
.btn-modern.btn-primary:hover {
    background: #0f766e;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(13,148,136,.3);
    color: #fff;
}
.btn-modern.btn-outline {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-modern.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}
.btn-modern.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-modern.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}
.btn-modern.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}
.btn-modern.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Cards ──────────────────────────────────────────────── */
.filters-card,
.data-card,
.form-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(15,23,42,.05);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.filters-card { padding: 1.25rem 1.5rem; }

.form-card { padding: 1.75rem; }

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 1.25rem;
}

/* ── Filtros ────────────────────────────────────────────── */
.filters-form { width: 100%; }
.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.filter-group { flex: 1; min-width: 140px; }
.filter-search { flex: 2; min-width: 220px; }

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 0.875rem;
    color: #94a3b8;
    font-size: 0.875rem;
    pointer-events: none;
}
.form-control-modern,
.search-input {
    width: 100%;
    padding: 0.55rem 0.875rem 0.55rem 2.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.15s ease;
    outline: none;
    font-family: inherit;
}
.form-control-modern:focus,
.search-input:focus {
    border-color: #0d9488;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.search-button {
    position: absolute;
    right: 0.5rem;
    padding: 0.3rem 0.75rem;
    background: #0d9488;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.search-button:hover { background: #0f766e; }
.clear-filters-btn {
    position: absolute;
    right: 5.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.2rem;
    transition: color 0.15s;
}
.clear-filters-btn:hover { color: #ef4444; }

.form-select-modern {
    width: 100%;
    padding: 0.55rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    transition: all 0.15s;
    font-family: inherit;
}
.form-select-modern:focus {
    border-color: #0d9488;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}

/* ── Tabela ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table-modern thead tr {
    border-bottom: 2px solid #99f6e4;
    background: #f0fdfa;
}
.table-modern th {
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #0f766e;
    white-space: nowrap;
}
.table-modern th.actions-column { text-align: right; }
.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #0f766e;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    transition: color 0.15s;
}
.table-sort-link:hover { color: #0d9488; }
.sort-icon { font-size: 0.7rem; color: #0d9488; }

.table-modern tbody tr.table-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}
.table-modern tbody tr.table-row:hover { background: #f0fdfa; }
.table-modern td { padding: 0.875rem 1.25rem; color: #334155; vertical-align: middle; }

/* ── Avatar / User info ─────────────────────────────────── */
.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { flex-shrink: 0; }
.avatar-image {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #ccfbf1;
    color: #0d9488;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    border: 2px solid #99f6e4;
}
.user-name { font-weight: 600; color: #0f172a; }
.user-email { color: #64748b; }

/* ── Badges ─────────────────────────────────────────────── */
.status-badge {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.status-active  { background: #d1fae5; color: #065f46; }
.status-inactive{ background: #fee2e2; color: #991b1b; }

.perfil-badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.role-badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    margin: 0.1rem;
}

/* ── Botões de ação ─────────────────────────────────────── */
.action-buttons { display: flex; align-items: center; gap: 0.375rem; justify-content: flex-end; }
.action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.edit-btn   { background: #f0fdfa; border-color: #99f6e4; color: #0d9488; }
.edit-btn:hover   { background: #ccfbf1; border-color: #0d9488; color: #0f766e; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(13,148,136,.2); }
.delete-btn { background: #fff1f2; border-color: #fecaca; color: #ef4444; }
.delete-btn:hover { background: #fee2e2; border-color: #ef4444; color: #dc2626; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(239,68,68,.2); }
.view-btn   { background: #eff6ff; border-color: #bfdbfe; color: #3b82f6; }
.view-btn:hover   { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(59,130,246,.2); }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: #f0fdfa;
    color: #0d9488;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.5rem;
}
.empty-state-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 1.25rem;
}

/* ── Paginação ──────────────────────────────────────────── */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f5f9;
}
.pagination-text { font-size: 0.8125rem; color: #64748b; }

/* Bootstrap 4 pagination override */
.pagination { display: flex; gap: 0.25rem; margin: 0; list-style: none; padding: 0; }
.page-item .page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 0.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.page-item .page-link:hover { background: #f0fdfa; border-color: #0d9488; color: #0d9488; }
.page-item.active .page-link { background: #0d9488; border-color: #0d9488; color: #fff; }
.page-item.disabled .page-link { opacity: .45; pointer-events: none; }

/* ── Formulários ────────────────────────────────────────── */
.form-section { margin-bottom: 2rem; }
.form-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}
.form-input {
    padding: 0.6rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: all 0.15s;
    font-family: inherit;
    width: 100%;
}
.form-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.form-select {
    padding: 0.6rem 2.25rem 0.6rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: all 0.15s;
    font-family: inherit;
    width: 100%;
    cursor: pointer;
}
.form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.form-error {
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.25rem;
}
.form-hint {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ── Checkbox / Toggle ──────────────────────────────────── */
.checkbox-group { display: flex; align-items: flex-start; gap: 0.6rem; }
.form-checkbox {
    width: 1rem; height: 1rem; margin-top: 0.15rem;
    border: 1.5px solid #cbd5e1; border-radius: 4px;
    cursor: pointer; accent-color: #0d9488; flex-shrink: 0;
}
.checkbox-label { font-size: 0.875rem; color: #374151; cursor: pointer; }

/* ── Utilitários ────────────────────────────────────────── */
.text-muted  { color: #94a3b8; }
.d-inline    { display: inline; }
.d-flex      { display: flex; }
.gap-2       { gap: 0.5rem; }
.mt-1        { margin-top: 0.25rem; }
.mt-2        { margin-top: 0.5rem; }
.mb-0        { margin-bottom: 0; }
.w-full      { width: 100%; }

/* ── Formulário por seções ──────────────────────────────── */
.modern-form { width: 100%; }

.form-sections { display: flex; flex-direction: column; gap: 0; }

.form-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.form-section:last-child { border-bottom: none; padding-bottom: 0; }
.form-section:first-child { padding-top: 0; }

.section-header { margin-bottom: 1.25rem; }
.section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.2rem;
}
.section-description {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
}

.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field.full-width { grid-column: 1 / -1; }

.field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}
.required { color: #ef4444; margin-left: 0.1rem; }

.form-input {
    padding: 0.6rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: all 0.15s;
    font-family: inherit;
    width: 100%;
}
.form-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.form-input.error {
    border-color: #ef4444;
    background: #fff5f5;
}
.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem;
}

.field-error {
    font-size: 0.8rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.field-error::before { content: '⚠'; font-size: 0.7rem; }

/* Status toggle */
.status-toggle { display: flex; flex-direction: column; gap: 0.375rem; }
.status-description { font-size: 0.8rem; color: #94a3b8; margin: 0; }

/* Checkbox component */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}
.checkbox-input {
    width: 1rem; height: 1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    accent-color: #0d9488;
    flex-shrink: 0;
}
.checkbox-wrapper .checkbox-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Avatar */
.current-avatar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.avatar-preview {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.avatar-label {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
}

/* File upload */
.file-upload-area {
    position: relative;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: #fafbfc;
}
.file-upload-area:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}
.file-input {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.file-upload-content {
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.file-upload-icon {
    font-size: 1.75rem;
    color: #0d9488;
}
.file-upload-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin: 0;
}
.file-upload-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .page-header-content { flex-direction: column; align-items: flex-start; }
    .filters-grid { flex-direction: column; }
    .filter-group, .filter-search { min-width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .pagination-wrapper { flex-direction: column; align-items: flex-start; }
}
