*:focus-visible {
    outline: 3px solid #FFB84D !important;
    outline-offset: 3px;
    border-radius: 0.25rem;
}

body {
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s, color 0.2s;
}

html:not(.dark) body {
    background-color: #F4F1EA;
    color: #2C2B28;
}

html.dark body {
    background-color: #111827;
    color: #e5e7eb;
}

.app-bg {
    min-height: 100vh;
}

.app-card {
    background-color: #FEFCF8;
    border-color: #E2DDD2;
}

html.dark .app-card {
    background-color: #1f2937;
    border-color: #374151;
}

.app-border {
    border-color: #E2DDD2;
}

html.dark .app-border {
    border-color: #374151;
}

.app-muted {
    color: #6b665f;
}

html.dark .app-muted {
    color: #9ca3af;
}

.app-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #D6CFC2;
    background-color: #FEFCF8;
    color: #2C2B28;
    padding: 0.6rem 0.75rem;
}

html.dark .app-input {
    border-color: #4b5563;
    background-color: #111827;
    color: #e5e7eb;
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    border: 1px solid #E2DDD2;
    border-radius: 0.75rem;
    background-color: #FEFCF8;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(44, 43, 40, 0.12);
}

html.dark .auth-card {
    border-color: #374151;
    background-color: #1f2937;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-secondary,
.tab-btn,
.icon-btn,
.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 0.5rem;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
    background-color: #4A7B9D;
    color: #fff;
    padding: 0.65rem 0.85rem;
}

.btn-primary:hover {
    background-color: #2C5A75;
}

.btn-success {
    background-color: #15803d;
    color: #fff;
    padding: 0.55rem 0.75rem;
}

.btn-success:hover {
    background-color: #166534;
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
    padding: 0.55rem 0.75rem;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-secondary {
    border: 1px solid #D6CFC2;
    background-color: #EBE7DE;
    color: #2C2B28;
    padding: 0.6rem 0.8rem;
}

html.dark .btn-secondary {
    border-color: #4b5563;
    background-color: #374151;
    color: #e5e7eb;
}

.icon-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    justify-content: center;
    color: inherit;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

html.dark .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.link-btn {
    color: #4A7B9D;
}

.link-btn:hover {
    color: #2C5A75;
    text-decoration: underline;
}

.tab-btn {
    border: 1px solid transparent;
    color: #6b665f;
    padding: 0.6rem 0.8rem;
}

html.dark .tab-btn {
    color: #9ca3af;
}

.tab-btn.active {
    border-color: #4A7B9D;
    background-color: rgba(74, 123, 157, 0.12);
    color: #2C5A75;
}

html.dark .tab-btn.active {
    color: #bfdbfe;
}

.sidebar-item {
    display: flex;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: background-color 0.15s;
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: rgba(74, 123, 157, 0.12);
}

html.dark .sidebar-item:hover,
html.dark .sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.media-card {
    overflow: hidden;
    border: 1px solid #E2DDD2;
    border-radius: 0.5rem;
    background-color: #FEFCF8;
    box-shadow: 0 1px 3px rgba(44, 43, 40, 0.08);
}

html.dark .media-card {
    border-color: #374151;
    background-color: #1f2937;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.75);
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.modal:not(.hidden) {
    display: flex;
}

.modal-arrow {
    position: absolute;
    z-index: 10;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 0.85rem;
}

.modal-arrow:hover {
    background-color: rgba(0, 0, 0, 0.75);
}

.modal-arrow:disabled {
    opacity: 0.25;
}

.toast-notification {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
    max-width: 360px;
}

.field-error {
    margin-top: 0.25rem;
    color: #dc2626;
    font-size: 0.75rem;
}

.drag-over {
    outline: 2px dashed #4A7B9D;
    outline-offset: -8px;
    background-color: rgba(74, 123, 157, 0.08);
}

@media (max-width: 760px) {
    #dashboard {
        flex-direction: column;
    }

    #dashboard aside {
        width: 100%;
        max-height: 34vh;
        border-right: 0;
        border-bottom: 1px solid #E2DDD2;
    }

    html.dark #dashboard aside {
        border-bottom-color: #374151;
    }

    #folderContentGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
