@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #00b4d8;
    --primary-dark: #0077b6;
    --accent: #7be041;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f9fbfd;
    --text: #0b1d33;
    --muted: #526071; /* Melhorado para contraste WCAG AA */
    --line: #dbe5ee;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow: 0 12px 40px rgba(11, 29, 51, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Melhoria de Acessibilidade: Foco visível */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    transition: var(--transition);
}

button {
    border: none;
    cursor: pointer;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--text);
    letter-spacing: -0.02em;
}

/* LOGIN */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(0, 180, 216, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(123, 224, 65, 0.14), transparent 30%),
        linear-gradient(135deg, #eef7fb 0%, #f7fbff 100%);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: 24px;
    padding: 36px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.auth-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 28px;
}

.auth-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.auth-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

.auth-header h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 8px;
}

.auth-header h2 {
    text-align: center;
}

.auth-header p {
    text-align: center;
    color: var(--muted);
    margin-bottom: 24px;
    margin-top: 6px;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-version {
    font-size: 1.0rem;
    color: var(--muted);
    text-align: center;
}

.auth-demo {
    margin-top: 22px;
    padding: 16px;
    border-radius: 14px;
    background: #f7fafc;
    border: 1px dashed var(--line);
    color: var(--muted);
    font-size: 0.95rem;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.alert-error {
    background: #fff1f2;
    color: #991b1b;
    border: 1px solid #fecdd3;
}

.alert-success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

/* APP */
.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #081728 0%, #0d2138 100%);
    color: #fff;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.sidebar-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.sidebar-logo {
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    align-content: start;
    flex-shrink: 0;
}

.nav-item {
    width: 100%;
    text-align: left;
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 600;
    transition: 0.25s ease;
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(135deg, rgba(0,180,216,0.24), rgba(123,224,65,0.18));
    color: #fff;
    border-color: rgba(255,255,255,0.12);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 16px;
    flex-shrink: 0;
}

#btn-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 auto;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
#btn-refresh:hover {
    background: linear-gradient(135deg, rgba(0,180,216,0.25), rgba(123,224,65,0.15));
    border-color: rgba(255,255,255,0.25);
    color: #fff;
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
#btn-refresh:active {
    transform: scale(0.95);
}
#btn-refresh.spinning svg {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    color: inherit;
    transition: background 0.15s;
}

.user-box:hover {
    background: rgba(255,255,255,0.12);
}

.user-box small {
    display: block;
    color: rgba(255,255,255,0.62);
    margin-top: 4px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.main-content {
    padding: 32px;
}

.topbar {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar h2 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.topbar p {
    color: var(--muted);
}

/* ── Topbar user ─────────────────────────────────────────────────────────── */
.topbar-user {
    position: relative;
    flex-shrink: 0;
}

.topbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.topbar-avatar:hover,
.topbar-avatar.active {
    background: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.25);
}

.topbar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 180px;
    padding: 6px;
    display: none;
    z-index: 500;
}

.topbar-dropdown.open {
    display: block;
}

.topbar-dropdown-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    padding: 6px 10px 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s;
}

.topbar-dropdown-item:hover {
    background: var(--bg);
}

.topbar-dropdown-item--danger {
    color: var(--danger);
}

.topbar-dropdown-item--danger:hover {
    background: #fef2f2;
}

.content-section {
    display: none;
    gap: 24px;
}

.content-section.active {
    display: grid;
}

/* CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid #eef3f8;
    display: flex;
    align-items: center;
    gap: 18px;
    border-top: 4px solid var(--line);
}

.stat-card--blue   { border-top-color: var(--primary); }
.stat-card--green  { border-top-color: var(--success); }
.stat-card--teal   { border-top-color: #0096c7; }
.stat-card--accent { border-top-color: var(--accent); }

.stat-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.85;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 800;
    display: block;
    line-height: 1.1;
}

.stat-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

/* CHARTS */
.charts-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-wrap {
    position: relative;
    height: 240px;
}

.chart-wrap--donut {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid #eef3f8;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-header p {
    color: var(--muted);
    margin-top: 6px;
}

.group-summary {
    display: grid;
    gap: 14px;
}

.summary-item {
    display: grid;
    gap: 6px;
}

.summary-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.summary-item-top span {
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-item-top strong {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.summary-bar {
    height: 7px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}

.summary-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* FORM */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-grid-compact {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 14px 15px;
    outline: none;
    transition: 0.2s ease;
}

.form-group select[multiple] {
    min-height: 140px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.12);
}

.form-group small {
    color: var(--muted);
    font-size: 0.86rem;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* TABLE */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
}

.table th {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 700;
}

.table td {
    font-size: 0.95rem;
}

/* TAGS */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(0, 180, 216, 0.12);
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.84rem;
}

.status-badge.status-enviada {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.status-badge.status-rascunho {
    background: rgba(100, 116, 139, 0.14);
    color: #334155;
}

.status-badge.status-erro {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

/* EDITOR */
/* .editor {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fbfd;
}

.editor-btn {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    transition: 0.2s ease;
}

.editor-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.editor-area {
    min-height: 260px;
    padding: 18px;
    outline: none;
    line-height: 1.7;
}

.hidden-textarea {
    display: none;
} */

.target-block.is-hidden {
    display: none;
}

/* TinyMCE */
.tox.tox-tinymce {
    border-radius: 16px !important;
    border: 1px solid var(--line) !important;
    overflow: hidden;
}

.tox .tox-editor-header {
    border-bottom: 1px solid var(--line) !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-toolbar__overflow {
    background: #f8fbfd !important;
}

.tox .tox-edit-area__iframe {
    background: #ffffff !important;
}

/* PANEL EDIÇÃO */
.panel-edit {
    border: 2px solid var(--primary);
}

/* ACTION BUTTONS em tabelas */
.action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.action-btns form {
    margin: 0;
}

/* TAGS */
.tag-muted {
    background: rgba(100, 116, 139, 0.12);
    color: var(--muted);
}

/* LABEL OPCIONAL */
.label-optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.88rem;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 700;
    transition: 0.25s ease;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 180, 216, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    opacity: 0.96;
}

.btn-outline {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-sm {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
    border-radius: 10px;
}

/* ── Sidebar toggle (hamburger) ───────────────────────────────────────────── */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.25s;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* ── Sidebar overlay (mobile) ─────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}

.sidebar-overlay.active {
    display: block;
}

/* ── Panels com scroll horizontal (tabelas) ───────────────────────────────── */
.panel {
    overflow-x: auto;
}

/* RESPONSIVO */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .sidebar-toggle {
        display: flex;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        padding: 20px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .form-grid,
    .form-grid-compact {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 20px;
    }

    .modal {
        padding: 16px;
    }

    .modal-card {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 90vh;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .auth-card {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .section-toolbar {
        flex-wrap: wrap;
    }

    .topbar-user .topbar-dropdown {
        right: 0;
        left: auto;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 120px;
    }
}

/* ── File input estilizado ────────────────────────────────────────────────── */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-input-name {
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.app-footer {
    text-align: center;
    padding: 24px 0 24px;
    font-size: 1.0rem;
    color: var(--muted);
}

.panel-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.muted-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.log-msg {
    max-width: 320px;
    word-break: break-word;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.section-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.section-toolbar .spacer {
    flex: 1;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.is-hidden {
    display: none !important;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal:has(.modal-card-xl) {
    padding: 40px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 29, 51, 0.45);
    cursor: pointer;
}

.modal-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.modal-card-sm {
    max-width: 420px;
}

.modal-card-lg {
    max-width: 860px;
}

.modal-card-xl {
    max-width: calc(100vw - 80px);
    width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);
    height: calc(100vh - 80px);
    border-radius: var(--radius);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.modal-close-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s;
    max-width: 340px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--primary); }

/* ── DataTables overrides ─────────────────────────────────────────────────── */
.dataTables_wrapper {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
}

/* Toolbar superior: length + filter lado a lado */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 16px;
}

/* Select de linhas por página */
.dataTables_wrapper .dataTables_length select {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    padding: 12px 40px 12px 15px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center !important;
    color: var(--text) !important;
    font-family: var(--font-body) !important;
    font-size: 0.95rem !important;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.12) !important;
}

/* Input de busca */
.dataTables_wrapper .dataTables_filter input[type="search"] {
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    padding: 12px 15px !important;
    background: #fff !important;
    color: var(--text) !important;
    font-family: var(--font-body) !important;
    font-size: 0.95rem !important;
    min-width: 240px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dataTables_wrapper .dataTables_filter input[type="search"]::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.dataTables_wrapper .dataTables_filter input[type="search"]:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.12) !important;
}

/* Info e paginação */
.dataTables_wrapper .dataTables_info {
    margin-top: 14px;
    font-size: 0.86rem;
    color: var(--muted);
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 14px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px !important;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text) !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg) !important;
    border-color: var(--line) !important;
    color: var(--text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.28);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: var(--muted) !important;
    background: transparent !important;
    border-color: transparent !important;
    cursor: default;
    opacity: 0.5;
}

/* Cabeçalho da tabela */
table.dataTable thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--line) !important;
    border-top: none !important;
    padding: 12px 14px;
    white-space: nowrap;
}

/* Ícone de ordenação */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    cursor: pointer;
}

table.dataTable thead th.sorting_asc::after  { color: var(--primary); }
table.dataTable thead th.sorting_desc::after { color: var(--primary); }

/* Linhas do corpo */
table.dataTable tbody tr {
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
}

table.dataTable tbody tr:last-child {
    border-bottom: none;
}

table.dataTable tbody tr:hover {
    background: rgba(0, 180, 216, 0.04);
}

table.dataTable tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-top: none;
    font-size: 0.92rem;
}

table.dataTable.no-footer {
    border-bottom: 1px solid var(--line);
}

/* Botões de ação na tabela */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Tags de tipo */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(0, 180, 216, 0.12);
    color: var(--primary-dark);
    letter-spacing: 0.02em;
}

.tag-muted {
    background: rgba(100, 116, 139, 0.12);
    color: var(--muted);
}