.favoritos-page {
    position: relative;
}

.favoritos-topbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.2rem 0.1rem;
}

.favoritos-topbar-copy {
    min-width: 0;
}

.favoritos-topbar-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 700;
    color: #0f172a;
}

html.dark .favoritos-topbar-title {
    color: #f8fafc;
}

.favoritos-topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 500;
    color: #64748b;
}

html.dark .favoritos-topbar-meta {
    color: #94a3b8;
}

.favoritos-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.favoritos-action-strip {
    display: grid;
    align-items: center;
    justify-items: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
    margin-bottom: 1rem;
    width: 100%;
    padding: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.6rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.88));
    box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.22);
}

.favoritos-mobile-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    min-height: 3.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.94));
    color: #0f172a;
    box-shadow: 0 18px 34px -24px rgba(15, 23, 42, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.favoritos-action-button {
    width: 100%;
    height: 3.5rem;
}

.favoritos-action-icon {
    font-size: 1.45rem;
    line-height: 1;
}

.favoritos-action-label {
    margin-top: 0.28rem;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

.favoritos-action-form {
    width: 100%;
}

.favoritos-mobile-icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px -24px rgba(15, 23, 42, 0.34);
    filter: saturate(1.06);
}

.favoritos-mobile-icon-button-active,
.favoritos-mobile-icon-button-primary {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.favoritos-mobile-icon-button-danger {
    color: #fff1f2;
    border-color: transparent;
    background: linear-gradient(135deg, #e11d48, #f43f5e);
}

html.dark .favoritos-mobile-icon-button {
    border-color: rgba(71, 85, 105, 0.38);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
    color: #e2e8f0;
}

html.dark .favoritos-mobile-icon-button:hover {
    color: #ffffff;
}

html.dark .favoritos-action-strip {
    border-color: rgba(71, 85, 105, 0.34);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88));
    box-shadow: 0 24px 42px -34px rgba(2, 6, 23, 0.78);
}

.favoritos-action-manage {
    color: #eff6ff !important;
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
}

.favoritos-action-create {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
}

.favoritos-action-folders {
    color: #fff7ed !important;
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
}

.favoritos-action-export {
    color: #ecfdf5 !important;
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

.favoritos-action-import {
    color: #fff7ed !important;
    background: linear-gradient(135deg, #ea580c, #fb923c) !important;
}

.favoritos-action-delete {
    color: #fff1f2 !important;
    background: linear-gradient(135deg, #e11d48, #f43f5e) !important;
}

html.dark .favoritos-action-manage {
    color: #eff6ff !important;
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
}

html.dark .favoritos-action-folders {
    color: #fff7ed !important;
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
}

html.dark .favoritos-action-export {
    color: #ecfdf5 !important;
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

html.dark .favoritos-action-import {
    color: #fff7ed !important;
    background: linear-gradient(135deg, #ea580c, #fb923c) !important;
}

.favoritos-primary-button,
.favoritos-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    padding: 0.58rem 0.92rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.favoritos-primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
    box-shadow: 0 18px 32px -20px rgba(37, 99, 235, 0.85);
}

.favoritos-primary-button:hover,
.favoritos-secondary-button:hover,
.favoritos-toolbar-button:hover,
.favoritos-mobile-action-button:hover {
    transform: translateY(-1px);
}

.favoritos-secondary-button {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.24);
}

html.dark .favoritos-secondary-button {
    border-color: rgba(71, 85, 105, 0.45);
    background: rgba(15, 23, 42, 0.74);
    color: #e2e8f0;
}

.favoritos-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
}

.favoritos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(96, 165, 250, 0.16);
    border-radius: 1rem;
    background: rgba(239, 246, 255, 0.58);
    box-shadow: 0 12px 24px -24px rgba(37, 99, 235, 0.35);
}

html.dark .favoritos-toolbar {
    border-color: rgba(30, 64, 175, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

.favoritos-toolbar-button,
.favoritos-mobile-action-button,
.favoritos-modal-primary,
.favoritos-modal-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.35rem;
    padding: 0.55rem 0.82rem;
    border-radius: 0.82rem;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.favoritos-toolbar-button {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.85);
    color: #1e293b;
}

html.dark .favoritos-toolbar-button {
    border-color: rgba(71, 85, 105, 0.42);
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
}

.favoritos-toolbar-button-primary,
.favoritos-modal-primary,
.favoritos-mobile-action-button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.favoritos-toolbar-button-danger,
.favoritos-mobile-action-button-danger {
    color: #fff1f2;
    background: linear-gradient(135deg, #e11d48, #f43f5e);
}

.favoritos-modal-secondary {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #f8fafc;
    color: #334155;
}

html.dark .favoritos-modal-secondary {
    border-color: rgba(71, 85, 105, 0.45);
    background: #1e293b;
    color: #e2e8f0;
}

.favoritos-panel {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html.dark .favoritos-panel {
    background: transparent;
    box-shadow: none;
}

.favoritos-panel-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.favoritos-panel-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

html.dark .favoritos-panel-title {
    color: #f8fafc;
}

.favoritos-panel-text {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: #64748b;
}

html.dark .favoritos-panel-text {
    color: #94a3b8;
}

.favoritos-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.favoritos-switch-track {
    width: 3.4rem;
    height: 1.9rem;
    border-radius: 9999px;
    background: #cbd5e1;
    transition: background-color 0.2s ease;
}

.peer:checked + .favoritos-switch-track {
    background: #10b981;
}

.favoritos-switch-thumb {
    position: absolute;
    left: 0.3rem;
    top: 0.3rem;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease;
}

.peer:checked ~ .favoritos-switch-thumb {
    transform: translateX(1.48rem);
}

.favoritos-switch-label {
    margin-left: 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
}

html.dark .favoritos-switch-label {
    color: #cbd5e1;
}

.favoritos-mobile-actions {
    padding: 1rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.8);
}

html.dark .favoritos-mobile-actions {
    border-color: rgba(71, 85, 105, 0.4);
    background: rgba(2, 6, 23, 0.48);
}

.favoritos-mobile-actions-title {
    margin-bottom: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

html.dark .favoritos-mobile-actions-title {
    color: #f8fafc;
}

.favoritos-mobile-action-button {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.88);
    color: #1e293b;
}

html.dark .favoritos-mobile-action-button {
    border-color: rgba(71, 85, 105, 0.42);
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
}

.favoritos-groups {
    display: grid;
    gap: 1.3rem 1.15rem;
    align-items: start;
}

.favoritos-group-card {
    position: relative;
    padding: 0.68rem 0.72rem 0.72rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(250, 248, 239, 0.96), rgba(245, 241, 226, 0.92));
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.favoritos-group-card:hover {
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.22);
    transform: translateY(-1px);
}

html.dark .favoritos-group-card {
    border-color: rgba(71, 85, 105, 0.34);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.74));
}

.favoritos-group-card::before {
    content: '';
    position: absolute;
    top: -0.34rem;
    left: 0.85rem;
    width: 4rem;
    height: 0.5rem;
    border-radius: 0.55rem 0.55rem 0 0;
    background: linear-gradient(135deg, rgba(245, 204, 116, 0.58), rgba(214, 158, 46, 0.28));
}

html.dark .favoritos-group-card::before {
    background: linear-gradient(135deg, rgba(245, 204, 116, 0.34), rgba(214, 158, 46, 0.14));
}

.favoritos-group-card-open {
    border-color: rgba(96, 165, 250, 0.28);
    box-shadow: 0 22px 40px -32px rgba(37, 99, 235, 0.28);
}

.favoritos-group-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.1rem;
}

.favoritos-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    padding: 0.08rem 0.05rem 0.1rem;
    text-align: left;
}

.favoritos-group-folder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.55rem;
    color: #92400e;
    background: rgba(245, 204, 116, 0.22);
}

html.dark .favoritos-group-folder {
    color: #fde68a;
    background: rgba(120, 53, 15, 0.34);
}

.favoritos-group-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
}

html.dark .favoritos-group-title {
    color: #f8fafc;
}

.favoritos-group-meta {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.62rem;
    color: #64748b;
}

html.dark .favoritos-group-meta {
    color: #94a3b8;
}

.favoritos-group-chevron {
    margin-left: auto;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.favoritos-group-actions {
    display: flex;
    gap: 0.18rem;
}

.edit-mode-active .favoritos-group-actions {
    flex: 0 0 auto;
    margin-left: 0.2rem;
}

.edit-mode-active .favoritos-group-toggle > .min-w-0 {
    flex: 1 1 auto;
}

.edit-mode-active .favoritos-group-title {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.2;
    padding-right: 0.15rem;
}

.edit-mode-active .favoritos-group-chevron {
    display: none;
}

.favoritos-icon-action,
.favoritos-link-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.45rem;
    color: #64748b;
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.favoritos-icon-action:hover,
.favoritos-link-action:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.favoritos-icon-action-success:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.favoritos-icon-action-danger,
.favoritos-link-action-danger {
    color: #ef4444;
}

.favoritos-icon-action-danger:hover,
.favoritos-link-action-danger:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #e11d48;
}

.favoritos-folder-window {
    margin-top: 0.35rem;
    padding: 0.42rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.62);
    border-radius: 0.78rem;
}

html.dark .favoritos-folder-window {
    border-top-color: rgba(71, 85, 105, 0.3);
    background: rgba(2, 6, 23, 0.34);
}

.favoritos-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
    max-height: 10.5rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.favoritos-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.32rem;
    min-height: 1.72rem;
    padding: 0.26rem 0.34rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0.62rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
    cursor: grab;
}

html.dark .favoritos-link-card {
    border-color: rgba(71, 85, 105, 0.35);
    background: rgba(15, 23, 42, 0.88);
}

.favoritos-link-card:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.24);
    background: rgba(239, 246, 255, 0.9);
    box-shadow: 0 14px 24px -24px rgba(37, 99, 235, 0.26);
}

html.dark .favoritos-link-card:hover {
    background: rgba(15, 23, 42, 0.96);
}

.favoritos-link-main {
    display: flex;
    align-items: center;
    gap: 0.36rem;
    flex: 1;
    min-width: 0;
}

.favoritos-link-accent {
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 9999px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.favoritos-link-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.63rem;
    font-weight: 600;
    color: #1e40af;
}

html.dark .favoritos-link-title {
    color: #93c5fd;
}

.favoritos-link-title:hover {
    text-decoration: underline;
}

.favoritos-link-actions {
    display: flex;
    align-items: center;
    gap: 0.16rem;
    flex: 0 0 auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.favoritos-link-card:hover .favoritos-link-actions,
.favoritos-link-card:hover .favoritos-drag-handle {
    opacity: 1;
}

.edit-mode-active .favoritos-link-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.2rem;
    min-height: 1.55rem;
    padding: 0.22rem 0.28rem;
}

.edit-mode-active .favoritos-link-title {
    font-size: 0.6rem;
    line-height: 1.1;
}

.edit-mode-active .favoritos-link-actions,
.edit-mode-active .favoritos-drag-handle {
    opacity: 1;
}

.edit-mode-active .favoritos-link-actions {
    flex: 0 0 auto;
    gap: 0.12rem;
}

.edit-mode-active .favoritos-link-action {
    width: 1.22rem;
    height: 1.22rem;
}

.edit-mode-active .favoritos-link-main {
    min-width: 0;
    padding-right: 0;
}

.edit-mode-active .favoritos-link-accent {
    width: 0.22rem;
    height: 0.22rem;
    box-shadow: none;
}

.edit-mode-active .favoritos-folder-window {
    padding: 0.32rem;
}

.edit-mode-active .favoritos-links-grid {
    gap: 0.2rem;
}

.favoritos-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    opacity: 0;
    color: #94a3b8;
    transition: opacity 0.2s ease;
}

/* Drag and drop */
.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.dragging {
    opacity: 0.55;
    transform: rotate(1deg) scale(0.985);
    transition: all 0.2s ease;
}

.drag-over {
    border: 2px dashed #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.drag-placeholder {
    background-color: rgba(59, 130, 246, 0.16);
    border: 2px dashed #3b82f6;
    border-radius: 1rem;
    height: 60px;
    margin: 4px 0;
}

/* Indicador de modo edição */
.edit-mode-active {
    position: relative;
}

.edit-mode-active::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    border: 2px solid rgba(59, 130, 246, 0.18);
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.08);
}

/* Pastas */
.pasta-header {
    transition: all 0.2s ease;
}

.pasta-header:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.pasta-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Drop zone */
.drop-zone {
    position: relative;
}

.drop-zone::after {
    content: 'Solte aqui';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.92);
    color: #fff;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
}

.drop-zone.drag-over::after {
    opacity: 1;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 640px) {
    .favoritos-topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (min-width: 768px) {
    .favoritos-panel-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .favoritos-groups {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 1024px) {
    .favoritos-groups {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

@media (min-width: 1280px) {
    .favoritos-groups {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    }
}

@media (max-width: 767px) {
    .favoritos-topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .favoritos-action-strip {
        width: 100%;
        gap: 1rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 0.85rem;
    }

    .favoritos-action-button {
        height: 5rem;
        min-height: 5rem;
    }

    .favoritos-action-icon {
        font-size: 2.05rem;
    }

    .favoritos-action-label {
        margin-top: 0.45rem;
        font-size: 0.72rem;
    }

    .drag-handle {
        display: none;
    }

    .favoritos-link-card:hover {
        transform: none;
    }

    .favoritos-groups {
        grid-template-columns: 1fr;
    }

    .favoritos-group-card {
        padding: 0.85rem;
    }

    .favoritos-group-card::before {
        left: 0.95rem;
        width: 4.2rem;
    }

    .favoritos-folder-window {
        padding: 0.65rem;
    }

    .favoritos-links-grid {
        max-height: none;
    }
}

@media (min-width: 768px) {
    .favoritos-action-strip {
        grid-template-columns: repeat(6, minmax(0, 5.5rem));
        justify-content: end;
        justify-items: stretch;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .favoritos-action-button {
        height: 3.25rem;
    }

    .favoritos-mobile-icon-button {
        gap: 0.3rem;
    }

    .favoritos-action-icon {
        font-size: 1.05rem;
    }

    .favoritos-action-label {
        margin-top: 0;
        font-size: 0.56rem;
    }
}
