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

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
    border: 1px solid #ffffff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(40px);
    }
}

.card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 24px 32px;
}

.card-header h1 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: center;
}

.card-body {
    padding: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0px 10px;
    font-size: 1rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: #fff;
}

.form-control::placeholder {
    color: #aaa;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #888;
}

.dynamic-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.dynamic-fields .form-group {
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .dynamic-fields {
        grid-template-columns: 1fr;
    }
}

.empty-fields {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 32px 24px;
    color: #999;
    font-size: 0.95rem;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* --- Group Bar --- */
.group-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.group-select {
    flex: 1;
    min-width: 0;
}

.group-bar .btn {
    min-width: auto;
    white-space: nowrap;
    padding: 0px 14px;
    height: 44px;
    font-size: 0.9rem;
}

/* --- Select All Bar --- */
.select-all-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    /* padding: 8px 12px; */
    /* background: #f8f9fa; */
    /* border-radius: 6px; */
    font-size: 0.85rem;
    color: #555;
    justify-content: flex-end;
}

.select-all-bar label {
    cursor: pointer;
    font-weight: 500;
}

/* --- Document Cards --- */
.document-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    /* max-height: 400px;
    overflow-y: auto; */
}

.doc-card {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    transition: background-color 0.15s;
}

.doc-card:hover {
    background: #fafcff;
    border: 1px solid #e0e0e0;
}

.doc-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-card-header .doc-nome {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.group-section {
    margin-bottom: 16px;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f0f0ff;
}

.group-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-header h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.group-header-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.group-header-bar {
    display: inline-block;
    width: 4px;
    height: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
    flex-shrink: 0;
}

.group-checkbox {
    cursor: pointer;
    accent-color: #667eea;
    opacity: 0;
    transition: opacity 0.15s;
}

.group-section:hover .group-checkbox {
    opacity: 1;
}

.group-checkbox:checked {
    opacity: 1;
}

.doc-checkbox {
    /* opacity: 0; */
    transition: opacity 0.15s;
}

.doc-card:hover .doc-checkbox,
.doc-checkbox:checked {
    opacity: 1;
}



.group-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.group-section:hover .group-header-actions {
    opacity: 1;
}

.group-header-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: #999;
    transition: all 0.15s;
    padding: 0;
}

.group-header-actions .btn-icon:hover {
    background: #f0f0f0;
    color: #555;
}

.group-header-actions .group-delete:hover {
    background: #fff0f0;
    color: #c62828;
}

/* --- Delete button hover on doc cards --- */
.doc-card .delete-doc {
    opacity: 0;
    transition: opacity 0.15s;
}

.doc-card:hover .delete-doc {
    opacity: 1;
}

/* --- Group Modal Extras --- */
.grupo-docs-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 8px;
}

.grupo-doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #333;
}

.grupo-doc-item:last-child {
    border-bottom: none;
}

.grupo-doc-item:hover {
    background: #f8f9ff;
}

.grupo-doc-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #333;
}

.grupo-doc-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 4px;
    transition: transform 0.1s;
}

input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: #667eea;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.step-title {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    font-size: 1rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    min-width: 160px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

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

/* --- Dropzone --- */

.dropzone {
    background: linear-gradient(135deg, #f8f7ff 0%, #ffffff 100%);
    border: 2px dashed #c7d2fe;
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    margin-bottom: 24px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f0ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.dropzone.drag-over {
    border-color: #667eea;
    background: linear-gradient(135deg, #e8e8ff 0%, #f8f7ff 100%);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: scale(1.01);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.dropzone-icon {
    margin-bottom: 4px;
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s;
}

.dropzone:hover .dropzone-icon {
    color: #667eea;
    transform: translateY(-2px);
}

.dropzone.drag-over .dropzone-icon {
    color: #667eea;
    transform: translateY(-4px) scale(1.1);
}

.dropzone-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.dropzone-description {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

.uploading .btn-secondary {
    pointer-events: none;
    opacity: 0.5;
}

.dropzone .btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.dropzone .btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

#fileInput,
#assinatura {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.assinatura-upload {
    background: linear-gradient(135deg, #f8f7ff 0%, #ffffff 100%);
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
}

.assinatura-upload:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f0ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.assinatura-content {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.assinatura-icon {
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s;
    display: flex;
}

.assinatura-upload:hover .assinatura-icon {
    color: #667eea;
    transform: translateY(-1px);
}

.assinatura-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    display: block;
}

.assinatura-hint {
    font-size: 0.72rem;
    color: #9ca3af;
    display: block;
}

.assinatura-filename {
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* --- File List --- */

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-card {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.file-card:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.file-card.status-error {
    border-color: #fecaca;
    background-color: #fef2f2;
}

.file-card.status-error:hover {
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.1);
}

.file-icon {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

.file-icon.icon-pdf {
    background: #ef4444;
}

.file-icon.icon-png,
.file-icon.icon-jpg,
.file-icon.icon-jpeg {
    background: #22c55e;
}

.file-icon.icon-mp4 {
    background: #a855f7;
}

.file-icon.icon-docx {
    background: transparent;
}

.file-icon.icon-default {
    background: #6b7280;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-meta .separator {
    color: #d1d5db;
}

.file-meta .status {
    font-weight: 500;
}

.file-meta .status.status-success {
    color: #22c55e;
}

.file-meta .status.status-error {
    color: #ef4444;
}

.file-meta .status.status-uploading {
    color: #667eea;
}

.file-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s;
    padding: 0;
}

.btn-remove:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}

.btn-retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    background: #fef2f2;
    color: #ef4444;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-retry:hover {
    background: #fee2e2;
}

/* --- Progress Bar --- */

.progress-bar {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.file-card.status-error .progress-bar {
    display: none;
}

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

.alert-error {
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

@media (max-width: 600px) {
    .card-header {
        padding: 18px 20px;
    }

    .card-header h1 {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 20px;
    }

    .btn {
        width: 100%;
        padding: 12px 24px;
    }

    .step-actions {
        flex-direction: column-reverse;
    }

    .header-top {
        flex-direction: column;
        gap: 4px;
    }

    .user-info {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .group-bar {
        flex-wrap: wrap;
    }

    .group-bar .form-control {
        flex: 1 1 100%;
    }
}

.auth-form {
    padding: 8px 0;
}

.auth-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #888;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-top h1 {
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    flex-wrap: wrap;
    justify-content: space-between;
}

.user-email {
    opacity: 0.9;
}

.user-credits {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.user-credits:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-logout {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.8rem;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.alert-success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.admin-header {
    background: linear-gradient(135deg, #e53935, #c62828) !important;
}

.admin-container {
    width: 100%;
    max-width: 900px;
}

.admin-content {
    padding: 8px 0;
}

.admin-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-container {
    margin-bottom: 24px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

.table thead {
    background: #f5f5f5;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.table th:first-child {
    border-radius: 6px 0 0 0;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.table tbody tr:hover {
    background: #fafcff;
}

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

.credits-badge {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
    min-width: auto;
}

.btn-admin {
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    box-shadow: none;
}

.btn-admin:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-success {
    background: #4caf50;
    color: #fff;
    box-shadow: none;
}

.btn-success:hover {
    background: #43a047;
}

.btn-danger {
    background: #e53935;
    color: #fff;
    box-shadow: none;
}

.btn-danger:hover {
    background: #c62828;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin-bottom: 12px;
    color: #555;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

.modal-feedback {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1565c0;
}

@media (max-width: 600px) {
    .admin-container {
        max-width: 100%;
    }

    .modal {
        width: 95%;
    }

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

/* --- Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    white-space: nowrap;
}

.dropdown-menu {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 9999;
    overflow: hidden;
    animation: fadeIn 0.15s ease-out;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    font-family: inherit;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* --- Credit Preview --- */
.credit-preview {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-align: center;
}

.credit-preview-add {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.credit-preview-remove {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    color: #e65100;
}

.credit-preview-warn {
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* --- Password Input Group --- */
.password-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.password-input-group .form-control {
    flex: 1;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-size: 1.1rem;
    transition: border-color 0.2s, background 0.2s;
}

.btn-icon:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: 16px;
}

/* --- Alert types for modals --- */
.alert-success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1565c0;
}

/* --- Modal Largo --- */
.modal-lg {
    max-width: 600px;
}

.modal-sm {
    max-width: 360px;
}

/* --- Histórico --- */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-loading,
.history-empty {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 0.9rem;
}

.history-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #9e9e9e;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.history-add {
    border-left-color: #2e7d32;
}

.history-remove {
    border-left-color: #c62828;
}

.history-generate {
    border-left-color: #1565c0;
}

.history-password {
    border-left-color: #6a1b9a;
}

.history-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.history-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #fff;
}

.history-add .history-pill {
    background: #2e7d32;
}

.history-remove .history-pill {
    background: #c62828;
}

.history-generate .history-pill {
    background: #1565c0;
}

.history-password .history-pill {
    background: #6a1b9a;
}

.history-data {
    color: #888;
    font-size: 0.78rem;
    white-space: nowrap;
}

.history-saldo {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.78rem;
    color: #555;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.history-desc {
    color: #444;
    font-size: 0.85rem;
    line-height: 1.5;
}

.history-vars {
    margin-top: 10px;
    padding: 8px 10px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-vars-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #999;
    margin-bottom: 2px;
}

.history-var {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.history-var-nome {
    color: #888;
    font-weight: 600;
    min-width: 180px;
    word-break: break-word;
}

.history-var-valor {
    color: #333;
    word-break: break-word;
}

/* --- Botão Excluir --- */
.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: #999;
    transition: all 0.15s;
    padding: 0;
}

.btn-icon-danger:hover {
    background: #fff0f0;
    border-color: #ffcdd2;
    color: #c62828;
}

/* --- Card Footer --- */
.card-footer {
    padding: 18px 32px;
    border-top: 1px solid #e8e8e8;
    text-align: center;
    background: #fafafa;
}

.card-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 6px 16px;
    border-radius: 20px;
    transition: all 0.2s;
}

.card-footer a:hover {
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

/* --- Help Page --- */
.help-section {
    margin-bottom: 36px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8e8;
    position: relative;
}

.help-section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.help-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
}

.help-example {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.help-example:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.help-example:last-child {
    margin-bottom: 0;
}

.help-example-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-example-label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.help-example-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 12px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8f9ff;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.help-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.7;
    color: #333;
}

.help-section code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f0f0ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #667eea;
    font-weight: 600;
}

.help-steps {
    list-style: none;
    counter-reset: help-steps;
    padding: 0;
}

.help-steps li {
    counter-increment: help-steps;
    position: relative;
    padding: 12px 16px 12px 50px;
    font-size: 0.9rem;
    color: #444;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 8px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s;
}

.help-steps li:hover {
    transform: translateX(4px);
}

.help-steps li::before {
    content: counter(help-steps);
    position: absolute;
    left: 14px;
    top: 12px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-tips {
    list-style: none;
    padding: 0;
}

.help-tips li {
    padding: 10px 16px 10px 36px;
    font-size: 0.9rem;
    color: #444;
    position: relative;
    line-height: 1.5;
    background: #f8f9ff;
    border-radius: 6px;
    margin-bottom: 6px;
}

.help-tips li::before {
    content: '\2713';
    position: absolute;
    left: 10px;
    top: 10px;
    color: #4caf50;
    font-weight: 700;
    font-size: 1.1rem;
}

.help-tips li code {
    font-size: 0.82em;
}

@media (max-width: 600px) {
    .card-footer {
        padding: 14px 20px;
    }

    .help-example {
        padding: 12px;
    }

    .help-code {
        font-size: 0.8rem;
        padding: 12px 14px;
    }

    .help-steps li {
        padding: 10px 14px 10px 46px;
    }

    .help-tips li {
        padding: 8px 14px 8px 32px;
    }
}

/* --- SweetAlert2 Theme Overrides --- */
.swal2-popup {
    border-radius: 12px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 24px 28px;
}

.swal2-popup.swal2-show {
    animation: slideUp 0.15s ease-out !important;
}

.swal2-popup.swal2-hide {
    animation: slideDown 0.15s ease-in !important;
}

.swal2-icon {
    display: none !important;
}

.swal2-title {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: left;
    padding: 0;
}

.swal2-html-container {
    color: #555;
    font-size: 0.95rem;
    text-align: left;
    margin: 0 0 8px;
    padding: 0;
}

.swal2-actions {
    justify-content: flex-start;
    flex-direction: row-reverse;
    margin-top: 20px;
    width: 100%;
}

.swal2-header {
    padding: 0;
}

.swal2-close {
    font-size: 1.8rem;
}

.swal2-confirm.swal2-styled {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 8px !important;
    font-weight: 600;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
    transition: all 0.25s;
}

.swal2-confirm.swal2-styled:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
}

.swal2-cancel.swal2-styled {
    border-radius: 8px !important;
    font-weight: 600;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff !important;
    border: 2px solid #667eea !important;
    color: #667eea !important;
    transition: all 0.25s;
}

.swal2-cancel.swal2-styled:hover {
    background: #f8f9ff !important;
    transform: translateY(-1px);
}

.swal2-icon.swal2-warning {
    border-color: #f0ad4e;
    color: #f0ad4e;
}

.swal2-icon.swal2-error {
    border-color: #e53935;
    color: #e53935;
}

.swal2-icon.swal2-success {
    border-color: #4caf50;
    color: #4caf50;
}

.swal2-timer-progress-bar {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

.btn-icon-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s;
    position: relative;
    flex-shrink: 0;
    opacity: 0;
}

.doc-card:hover .btn-icon-info {
    opacity: 1;
}

.btn-icon-info:hover {
    background: #f0f4ff;
    border-color: #c7d2fe;
    color: #667eea;
}

.doc-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.75rem;
    line-height: 1.6;
    margin-top: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.15s ease-out;
    white-space: nowrap;
    grid-template-columns: auto auto;
    gap: 2px 16px;
}

.btn-icon-info:hover .doc-tooltip {
    display: grid;
}

.doc-tooltip-label {
    color: #9ca3af;
    font-weight: 600;
    text-align: right;
}

.doc-tooltip-value {
    color: #e5e7eb;
    text-align: left;
}